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

Chandler Carruth chandlerc at google.com
Tue Jan 20 13:02:38 PST 2015


LGTM

On Tue, Jan 20, 2015 at 1:00 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150120/4c0fb975/attachment.html>


More information about the llvm-commits mailing list