[Bug sanitizer/101111] xgcc cross-compiler for x86_64-apple-darwin in GCC 11.1 doesn't generate weak symbols, resulting in undefined reference to ___lsan_default_suppressions

mose at gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Jun 18 22:46:48 GMT 2021


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

--- Comment #4 from Mosè Giordano <mose at gnu dot org> ---
You're right, in `x86_64-apple-darwin14/libsanitizer/config.log` I can see that
`build == x86_64-linux-musl` and `host == target == x86_64-apple-darwin`, but
still, in `x86_64-apple-darwin14/libsanitizer` I don't see any reference to
linker flags like `-undefined dynamic_lookup`, `-U <symbol-name>`, `-undefined
suppress` or anything like that.  Maybe libsanitizer should use something
similar to `GCC_CHECK_ELF_STYLE_WEAKREF`
(<https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=config/weakref.m4;h=ecb85672805882b330cac43e0fc12e7fe96aeec9;hb=HEAD>)
to actually use any these flags?  The undefined functions mentioned in the
error message use ELF-style weak symbols, but without appropriate flags the
macOS linker will complain.


More information about the Gcc-bugs mailing list