pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/clang clang: provide patches to build on illumos ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a3304bccd125
branches:  trunk
changeset: 371663:a3304bccd125
user:      tm <tm%pkgsrc.org@localhost>
date:      Tue Jan 11 17:27:39 2022 +0000

description:
clang: provide patches to build on illumos distributions

Workaround features which are not available on old illumos (Solaris < 11.4)
linker.

diffstat:

 lang/clang/distinfo                                       |   4 +-
 lang/clang/patches/patch-tools_clang-shlib_CMakeLists.txt |  34 +++++++++++++++
 lang/clang/patches/patch-tools_libclang_CMakeLists.txt    |  14 ++++++
 3 files changed, 51 insertions(+), 1 deletions(-)

diffs (72 lines):

diff -r c64c84513524 -r a3304bccd125 lang/clang/distinfo
--- a/lang/clang/distinfo       Tue Jan 11 16:45:09 2022 +0000
+++ b/lang/clang/distinfo       Tue Jan 11 17:27:39 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.70 2021/11/23 20:55:43 wiz Exp $
+$NetBSD: distinfo,v 1.71 2022/01/11 17:27:39 tm Exp $
 
 BLAKE2s (clang-13.0.0.src.tar.xz) = 3a07b8456c7bb3e6a5446d01dbe7606cd0caeacc38606dd59632d14f89480850
 SHA512 (clang-13.0.0.src.tar.xz) = b9ae85a7f0a66ae42a6d76a4e1ea0940bf622f7fbd21d078c9fef146087c70abb0a597a1cfda4e8706b1fbc74d170986451f5f2d642f685a5c355da8a572fb26
@@ -8,3 +8,5 @@
 SHA1 (patch-lib_Driver_ToolChains_Solaris.cpp) = 1a139612ce181dfce1ea3a627dcd76bc81f05455
 SHA1 (patch-lib_Driver_ToolChains_Solaris.h) = 22d1ddef34b8df3cc29c4632108d45904797aff3
 SHA1 (patch-lib_Frontend_InitHeaderSearch.cpp) = 497ddbe1eac8726d736bed58557a795dce207d1a
+SHA1 (patch-tools_clang-shlib_CMakeLists.txt) = 13a34679d741217975333fd4ae313c3938e6f0fd
+SHA1 (patch-tools_libclang_CMakeLists.txt) = 2dce9cfc1e114a79fab457211eea1ee93c2198f4
diff -r c64c84513524 -r a3304bccd125 lang/clang/patches/patch-tools_clang-shlib_CMakeLists.txt
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/clang/patches/patch-tools_clang-shlib_CMakeLists.txt Tue Jan 11 17:27:39 2022 +0000
@@ -0,0 +1,34 @@
+$NetBSD: patch-tools_clang-shlib_CMakeLists.txt,v 1.1 2022/01/11 17:27:39 tm Exp $
+
+Only the linker on Solaris 11.4 supports GNU ld version script and only if
+the special option gnu-version-script-compat is used. Older Solaris linker
+doesn't support version script.
+
+--- tools/libclang/CMakeLists.txt.orig 2021-09-24 16:18:10.000000000 +0000
++++ tools/libclang/CMakeLists.txt
+@@ -167,11 +167,21 @@ if(ENABLE_SHARED)
+     endif()
+   endif()
+   if (USE_VERSION_SCRIPT)
+-    target_link_options(libclang PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
+-    # The Solaris 11.4 linker supports a subset of GNU ld version scripts,
+-    # but requires a special option to enable it.
+     if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+-      target_link_options(libclang PRIVATE "-Wl,-z,gnu-version-script-compat")
++      include(CheckLinkerFlag)
++      # The Solaris 11.4 linker supports a subset of GNU ld version scripts,
++      # but requires a special option to enable it.
++      llvm_check_linker_flag(CXX "-Wl,-z,gnu-version-script-compat" LINKER_SUPPORTS_Z_GNU_VERSION_SCRIPT_COMPAT)
++      # Older Solaris (and illumos) linker doesn't support GNU ld version 
++      # and doesn't support GNU version script compat.
++      if (LINKER_SUPPORTS_Z_GNU_VERSION_SCRIPT_COMPAT)
++      target_link_options(libclang PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
++      target_link_options(libclang PRIVATE "-Wl,-z,gnu-version-script-compat")
++      else()
++        target_link_options(libclang PRIVATE "-Wl,-M,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
++      endif()
++    else() 
++      target_link_options(libclang PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/libclang.map")
+     endif()
+     # Ensure that libclang.so gets rebuilt when the linker script changes.
+     set_property(SOURCE ARCMigrate.cpp APPEND PROPERTY
\ No newline at end of file
diff -r c64c84513524 -r a3304bccd125 lang/clang/patches/patch-tools_libclang_CMakeLists.txt
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/clang/patches/patch-tools_libclang_CMakeLists.txt    Tue Jan 11 17:27:39 2022 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-tools_libclang_CMakeLists.txt,v 1.1 2022/01/11 17:27:39 tm Exp $
+
+-B flag symbolic-functions is not supported on Solaris before 11.4
+
+--- tools/clang-shlib/CMakeLists.txt.orig      2021-09-24 16:18:10.000000000 +0000
++++ tools/clang-shlib/CMakeLists.txt
+@@ -50,6 +50,6 @@ add_clang_library(clang-cpp
+                   ${_DEPS})
+ # Optimize function calls for default visibility definitions to avoid PLT and
+ # reduce dynamic relocations.
+-if (NOT APPLE AND NOT MINGW)
++if (NOT APPLE AND NOT MINGW AND NOT "SunOS" MATCHES ${CMAKE_SYSTEM_NAME})
+   target_link_options(clang-cpp PRIVATE LINKER:-Bsymbolic-functions)
+ endif()



Home | Main Index | Thread Index | Old Index