Use -Wl,defs when linking.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 20 Jan 2015 21:23:15 +0000 (21:23 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 20 Jan 2015 21:23:15 +0000 (21:23 +0000)
commitcb274c0c4724c65b8c9cef32e431cf6152b0410e
tree74aaa9ea7063b99e67579eed78f38db7f5e870a4
parentb3d03df3acacd6ce69064ec8d028a40e86ee977c
Use -Wl,defs when linking.

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.

This 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.

llvm-svn: 226611
llvm/cmake/modules/HandleLLVMOptions.cmake
llvm/utils/unittest/CMakeLists.txt