[patch][cmake] Use -Wl,defs when linking

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Jan 20 13:00:55 PST 2015


ELF linkers by default allow shared libraries to contain undefined
references and it is up to the dynamic linker to look for them.

On COFF and MachO, that is not the case.

This creates a situation where a .so might build on an ELF system, but
the build of the corresponding .dylib or .dll will fail.

The attached patch changes the cmake build to use -Wl,-z,defs when
linking and updates the dependencies so that -DBUILD_SHARED_LIBS=ON
build still works.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.patch
Type: text/x-patch
Size: 1381 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150120/fa4eec47/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.patch
Type: text/x-patch
Size: 467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150120/fa4eec47/attachment-0001.bin>


More information about the llvm-commits mailing list