[llvm-bugs] [Bug 44475] New: compiler-rt complains unnecessarily about missing C++ headers on macOS
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Jan 6 19:53:23 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=44475
Bug ID: 44475
Summary: compiler-rt complains unnecessarily about missing C++
headers on macOS
Product: compiler-rt
Version: unspecified
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: compiler-rt
Assignee: unassignedbugs at nondot.org
Reporter: steven at uplinklabs.net
CC: llvm-bugs at lists.llvm.org
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
http://llvm.org/svn/llvm-project/libcxx/trunk 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
http://llvm.org/svn/llvm-project/libcxx/trunk 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.
---
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200107/5776eb48/attachment.html>
More information about the llvm-bugs
mailing list