[cfe-dev] clang built from source in Mac OSX 10.14 with apple-clang/Xcode missing stdlib from include search path
Jens Jorgensen via cfe-dev
cfe-dev at lists.llvm.org
Sat Dec 14 19:33:41 PST 2019
Hmmm, unfortunately I don't use libc++.
On 12/15/19 2:31 AM, Arthur O'Dwyer wrote:
> On Tue, Dec 10, 2019 at 10:09 PM Jens Jorgensen via cfe-dev
> <cfe-dev at lists.llvm.org <mailto: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
--
Jens B. Jorgensen
jbj1 at ultraemail.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191215/b34c2265/attachment.html>
More information about the cfe-dev
mailing list