aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-03-21 12:01:44 -0700
committerFangrui Song <i@maskray.me>2021-03-21 12:01:44 -0700
commitbcaca360f8b64d267c787a5f3088e73420e78f53 (patch)
tree8565cbc46b526f2314c1be1526edff0f148336e5 /clang/lib/CodeGen/CodeGenFunction.cpp
parentc53a1322f329e29446c7625da423f58f09ec1a55 (diff)
downloadllvm-bcaca360f8b64d267c787a5f3088e73420e78f53.zip
llvm-bcaca360f8b64d267c787a5f3088e73420e78f53.tar.gz
llvm-bcaca360f8b64d267c787a5f3088e73420e78f53.tar.bz2
[Driver] Gnu.cpp: fix libstdc++ search path for multilib
With this change, on Debian x86-64 (with a MULTILIB_OSDIRNAMES local patch ../lib64 -> ../lib; this does not matter because /usr/lib64/crt{1,i,n}.o do not exist), `clang++ --target=aarch64-linux-gnu a.cc -Wl,--dynamic-linker=/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 -Wl,-rpath,/usr/aarch64-linux-gnu/lib` built executable can run under qemu-user. Previously this failed with `/usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../include/c++/10/iostream:38:10: fatal error: 'bits/c++config.h' file not found` On Arch Linux, due to the MULTILIB_OSDIRNAMES patch and the existence of /usr/lib64/crt{1,i,n}.o, clang driver may pick /usr/lib64/crt{1,i,n}.o and cause a linker error. -B can work around the problem. `clang++ --target=aarch64-linux-gnu -B /usr/aarch64-linux-gnu/lib a.cc -Wl,--dynamic-linker=/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 -Wl,-rpath,/usr/aarch64-linux-gnu/lib64:/usr/aarch64-linux-gnu/lib`
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions