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.