https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101111

--- Comment #2 from Mosè Giordano <mose at gnu dot org> ---
I've gathered some more information.  In LLVM, libsanitizer uses
-Wl,-U,<symbol-name> to allow the macOS linker accept undefined symbols and
mimic ELF weak symbols, see
<https://github.com/llvm/llvm-project/blob/cbfb12469ba312c8ff513397b29bef470f151caa/compiler-rt/cmake/Modules/SanitizerUtils.cmake#L71>,
and
<https://github.com/llvm/llvm-project/blob/cbfb12469ba312c8ff513397b29bef470f151caa/compiler-rt/lib/lsan/weak_symbols.txt>
for the list of weak symbols in lsan.

GCC uses libtool checks to set these flags:
<https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libsanitizer/configure;h=1d9ae59be6798555b7020a66e0f622ff8bf752cc;hb=50bc9185c2821350f0b785d6e23a6e9dcde58466#l8839>.
 This is a check on `$host_cpu-$host_os`, however I'm compiling a
cross-compiler (`build == host == x86_64-linux-musl`, `target ==
x86_64-apple-darwin`, I may have been inaccurate before), so shouldn't this
check use `$target_cpu-$target_os` instead?

Reply via email to