[cfe-dev] clang built from source in Mac OSX 10.14 with apple-clang/Xcode missing stdlib from include search path
Arthur O'Dwyer via cfe-dev
cfe-dev at lists.llvm.org
Sat Dec 14 10:31:39 PST 2019
On Tue, Dec 10, 2019 at 10:09 PM Jens Jorgensen via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> Apply my patch and build like :
>
> cmake -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles"
> -DCMAKE_BUILD_TYPE=Release
>
> -DCLANG_XCODE_TOOLCHAIN_ROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
> ../llvm-project/llvm
>
Using Jens' patch (attached), I managed to get `make clang` to build.
However, I still can't get `make cxx` to build.
cmake -G "Ninja" -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi"
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCLANG_XCODE_TOOLCHAIN_ROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
\
../llvm
ninja cxx
[223/272] Linking CXX shared library lib/libc++abi.1.0.dylib
FAILED: lib/libc++abi.1.0.dylib
[...snip...]
Undefined symbols for architecture x86_64:
"__ZTIDu", referenced from:
-exported_symbol[s_list] command line option
"__ZTIPDu", referenced from:
-exported_symbol[s_list] command line option
"__ZTIPKDu", referenced from:
-exported_symbol[s_list] command line option
"typeinfo for __float128 const*", referenced from:
-exported_symbol[s_list] command line option
"typeinfo for __int128 const*", referenced from:
-exported_symbol[s_list] command line option
"typeinfo for unsigned __int128 const*", referenced from:
-exported_symbol[s_list] command line option
[...snip...]
Then I tried adding `compiler-rt` to LLVM_ENABLE_PROJECTS and building
`ninja compiler-rt`, but it also errors:
cmake -G "Ninja"
-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;compiler-rt"
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCLANG_XCODE_TOOLCHAIN_ROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
\
-DCOMPILER_RT_HAS_WNON_VIRTUAL_DTOR_FLAG=yes \
../llvm
ninja compiler-rt
[533/839] Building CXX object
projects/compiler-rt/lib/tsan/CMakeFiles/clang_rt.tsan_osx_dynamic.dir/rtl/tsan_interceptors_mac.cpp.o
[...]/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp:26:10:
fatal error: 'os/lock.h' file not found
#include <os/lock.h>
^
1 error generated.
Anyone got any tips for building libc++ on Mac OSX?
–Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191214/31f43848/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Jens-Jorgensen-Clang-Patch.diff
Type: application/octet-stream
Size: 2178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191214/31f43848/attachment.obj>
More information about the cfe-dev
mailing list