<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - compiler-rt complains unnecessarily about missing C++ headers on macOS"
href="https://bugs.llvm.org/show_bug.cgi?id=44475">44475</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>compiler-rt complains unnecessarily about missing C++ headers on macOS
</td>
</tr>
<tr>
<th>Product</th>
<td>compiler-rt
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>compiler-rt
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>steven@uplinklabs.net
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>It seems really strange that compiler-rt's
cmake/Modules/CompilerRTCompile.cmake complains about C++ headers being missing
on macOS, when the build in question is happening in a full git clone of the
llvm-project tree, and "libcxx;libcxxabi" are present in LLVM_ENABLE_PROJECTS
for the build.
The message recommends pursuing a manual step of running "installheaders" in
libcxx. Couldn't that be replaced by a build step when libcxx/libcxxabi are
part of the build?
The output in question:
---
[6289/6380] Checking that just-built clang can find C++ headers...
FAILED:
projects/compiler-rt/lib/sanitizer_common/tests/CMakeFiles/CompilerRTUnitTestCheckCxx
cd
/Users/steven/dev/llvm/build/llvm/projects/compiler-rt/lib/sanitizer_common/tests
&& bash -c "echo '#include <iostream>' |
/Users/steven/dev/llvm/build/llvm/./bin/clang
-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
-E -x c++ - > /dev/null;if [ \$? != 0 ] ; then echo; echo 'Your just-built
clang cannot find C++ headers, which are needed to build and run compiler-rt
tests.'; echo 'You should copy or symlink your system C++ headers into
/Users/steven/dev/llvm/build/llvm/include/c++'; if [ -d \$(dirname \$(dirname
\$(xcrun -f clang)))/include/c++ ]; then echo 'e.g. with:'; echo ' cp
-r' \$(dirname \$(dirname \$(xcrun -f clang)))/include/c++
'/Users/steven/dev/llvm/build/llvm/include/'; elif [ -d \$(dirname \$(dirname
\$(xcrun -f clang)))/lib/c++ ]; then echo 'e.g. with:'; echo ' cp -r'
\$(dirname \$(dirname \$(xcrun -f clang)))/lib/c++
'/Users/steven/dev/llvm/build/llvm/include/'; fi; echo 'This can also be
fixed by checking out the libcxx project from llvm.org and installing the
headers'; echo 'into your build directory:'; echo ' cd
/Users/steven/dev/llvm/llvm-project/llvm/projects && svn co
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk">http://llvm.org/svn/llvm-project/libcxx/trunk</a> libcxx'; echo ' cd
/Users/steven/dev/llvm/build/llvm && make -C
/Users/steven/dev/llvm/llvm-project/llvm/projects/libcxx installheaders
HEADER_DIR=/Users/steven/dev/llvm/build/llvm/include'; echo; false;fi"
<stdin>:1:10: fatal error: 'iostream' file not found
#include <iostream>
^~~~~~~~~~
1 error generated.
Your just-built clang cannot find C++ headers, which are needed to build and
run compiler-rt tests.
You should copy or symlink your system C++ headers into
/Users/steven/dev/llvm/build/llvm/include/c++
e.g. with:
cp -r
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++
/Users/steven/dev/llvm/build/llvm/include/
This can also be fixed by checking out the libcxx project from llvm.org and
installing the headers
into your build directory:
cd /Users/steven/dev/llvm/llvm-project/llvm/projects && svn co
<a href="http://llvm.org/svn/llvm-project/libcxx/trunk">http://llvm.org/svn/llvm-project/libcxx/trunk</a> libcxx
cd /Users/steven/dev/llvm/build/llvm && make -C
/Users/steven/dev/llvm/llvm-project/llvm/projects/libcxx installheaders
HEADER_DIR=/Users/steven/dev/llvm/build/llvm/include
ninja: build stopped: subcommand failed.
---</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>