llvm-project
ebaa9bf8 - [Toolchains][FreeBSD] Honor system libgcc

Commit
73 days ago
[Toolchains][FreeBSD] Honor system libgcc On Linux, the system libgcc may act as the compiler runtime, and Clang provides -rtlib=compiler-rt to switch implementations. FreeBSD ships libcompiler_rt.a (LLVM’s builtins) in the base system, with libgcc.a as a symlink to it. These libraries are linked via -L and -lgcc. An interesting detail is that even if the Clang resource directory (llvm-xx/lib/clang/xx) appears before the system path in the search order, it is still not used. This is because the linker looks for libgcc.a rather than libclang_rt.builtins.a. Since FreeBSD does not currently support -rtlib, honor the system libgcc by hardcoding its path. Detect and handle cases where a custom compiler-rt is injected via -L as an override workaround.
Author
Committer
Parents
Loading