Closed xiedeacc closed 6 days ago
it seems libc in llvm cannot be used for now???
for anyone who want to cross compile use libc++ not stdlibc++ can use below command
/usr/local/llvm/18/bin/clang++ -v --target=aarch64-unknown-linux-gnu \
--sysroot=/root/src/software/clang_sysroot \
-I/root/src/software/clang_sysroot/include \
-I/root/src/software/clang_sysroot/include/aarch64-unknown-linux-gnu/c++/v1 \
-I/root/src/software/clang_sysroot/include/c++/v1 \
-I/root/src/software/gcc-arm-11.2/usr/include \
-B/usr/local/llvm/18/bin \
-L/root/src/software/clang_sysroot/lib \
-L/root/src/software/clang_sysroot/lib/aarch64-unknown-linux-gnu \
-L/root/src/software/clang_sysroot/lib/clang/18/lib/aarch64-unknown-linux-gnu \
-L/root/src/software/clang_sysroot/usr/lib \
-static -stdlib=libc++ -lc++ -lc++abi -lunwind -fuse-ld=lld --rtlib=compiler-rt \
main.cc
LLVM libc is still in complete, and there are some recent effort to bootstrap clang and/or libc++ with LLVM libc.
https://github.com/llvm/llvm-project/issues/97191 might be interesting to you?
my clang/llvm build from source use tag:18.1.8, target header and library download from clang+llvm-18.1.8-aarch64-linux-gnu, when I use below command to build a hello_world program for aarch64 on x86_64, it said cannot find -lc, llvm contain libc runtime, but I cannot find libc.so, where it is?
clang/llvm build command