-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Open
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Description
Hi,
I'm trying to use clang with a custom sysroot (containing glibc) as well as a custom GCC, as follows:
clang++ -fuse-ld=lld --sysroot=sysroot_x86_64_linux/ --gcc-install-dir=gcc_9_x86_64_linux/usr/lib/gcc/x86_64-pc-linux-gnu/9.4.0/ foo.cpp
Compilation works as expected, however the linker cannot find libstdc++:
ld.lld: error: unable to find library -lstdc++
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: unable to find library -lgcc_s
My expectation is that --gcc-install-dir
would allow clang to find these libraries, potentially even passing relevant -L
paths to the linker (lld). Is my expectation wrong?
I take from this post from @MaskRay that using sysroot
and gcc-install-dir
should be working combination:
When the GCC installation is not contained in the sysroot, typically the user wants to fix the GCC version as well.
The new --gcc-install-dir= can be used instead.
I have also tried --gcc-toolchain
and get the same problems.
Thanks!
Metadata
Metadata
Assignees
Labels
clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl''clang' and 'clang++' user-facing binaries. Not 'clang-cl'