diff options
author | Brad Smith <brad@comstyle.com> | 2024-01-08 23:28:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-08 23:28:04 -0500 |
commit | 49c35f69ac6884a07f07e7c09ca7b79282707f49 (patch) | |
tree | 3afec11f02a5d723f0a7787795dfd6975b44942a /llvm/cmake | |
parent | 3fa17954dedd59bfad9cef1778719fb6312a5949 (diff) | |
download | llvm-49c35f69ac6884a07f07e7c09ca7b79282707f49.zip llvm-49c35f69ac6884a07f07e7c09ca7b79282707f49.tar.gz llvm-49c35f69ac6884a07f07e7c09ca7b79282707f49.tar.bz2 |
[CMake] Add support for building on illumos (#74930)
illumos has an older version of the Solaris linker that does not
support the GNU version script compat nor version scripts and does
not support -Bsymbolic-functions. Treat illumos linker separately.
The libclang/CMakeLists part lifted from NetBSD's pkgsrc.
Build tested on Solaris 11.4 and OpenIndiana 2023.10.
/usr/bin/ld --version
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.3260
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1790 (illumos)
Diffstat (limited to 'llvm/cmake')
-rw-r--r-- | llvm/cmake/modules/AddLLVM.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index c9bca30..14c0837 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -241,6 +241,12 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32) set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "") set(LLVM_LINKER_IS_GNULD YES CACHE INTERNAL "") message(STATUS "Linker detection: GNU ld") + elseif("${stderr}" MATCHES "(illumos)" OR + "${stdout}" MATCHES "(illumos)") + set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "") + set(LLVM_LINKER_IS_SOLARISLD YES CACHE INTERNAL "") + set(LLVM_LINKER_IS_SOLARISLD_ILLUMOS YES CACHE INTERNAL "") + message(STATUS "Linker detection: Solaris ld (illumos)") elseif("${stderr}" MATCHES "Solaris Link Editors" OR "${stdout}" MATCHES "Solaris Link Editors") set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "") |