[PATCH] D15290: [libFuzzer] CMake support for libFuzzer on OS X

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 23:54:14 PST 2015


kubabrecka added a comment.

In http://reviews.llvm.org/D15290#306779, @kcc wrote:

> Shouldn't this just work out of the box? (I assume that weak functions are functioning on OSX)


Weak functions work differently on OS X, due to two-level namespaces.  Regular `__attribute__((weak))` still needs to link against something that provides the symbol, so that we know in which library should we look the symbol up.  Otherwise, we simply fail to link with a "Undefined symbol" error.  There is a linker flag, `-undefined dynamic_lookup`, which causes all undefined symbols to be resolved only at runtime and in all loaded libraries (and "weak" then works as you expect).  I'd rather not use it, because it then hides a lot of linking errors.  And the user is not likely to use this flag.  I don't know what's a viable solution here, other than using `dlsym()`.


http://reviews.llvm.org/D15290





More information about the llvm-commits mailing list