Disable ENABLE_EXPORTS for NetBSD static linking
Needs ReviewPublic

Authored by tomsun.0.7 on Mon, Jun 4, 7:45 AM.

Details

Summary

When trying to build static clang with flag -DLLVM_BUILD_STATIC
for cmake, ENABLE_EXPORTS=1 will introduce -Wl,--export-dynamic
flag while linking.

With this flag, NetBSD will recognize the generated clang as
dynamically linked binary with dependency to /lib/ld64.so.1,
which does not exist. The following is the information for clang
binary:

% file clang-7
clang-7: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib/ld64.so.1, for NetBSD
8.99.17, not stripped
% ldd clang-7
clang-7:
// nothing else

To prevent this, this modification chooses to directly prevent
the setting of ENABLE_EXPORTS flag, but we are not sure whether
this is a proper solution.

Diff Detail

Repository
rL LLVM
tomsun.0.7 created this revision.Mon, Jun 4, 7:45 AM
tomsun.0.7 edited the summary of this revision. (Show Details)Mon, Jun 4, 7:46 AM

+ chandlerc (CMake maintainer)
+ ruiu (lld maintainer for insight)