[PATCH] Use right syntax to pass version script to Solaris' ld

Xan López xan at igalia.com
Fri Jun 19 03:42:14 PDT 2015


.
-------------- next part --------------
>From 3abc552e32920c5c822970edc1c6c980bb91f621 Mon Sep 17 00:00:00 2001
From: Xan Lopez <xan at igalia.com>
Date: Fri, 19 Jun 2015 06:38:25 -0400
Subject: [PATCH] AddLLVM: use the right syntax to pass the version script to
 the linker

--version-script is for GNU ld, Solaris uses -M.
---
 cmake/modules/AddLLVM.cmake | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 571339f..e6787db 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -84,8 +84,13 @@ function(add_llvm_symbol_exports target_name export_file)
       DEPENDS ${export_file}
       VERBATIM
       COMMENT "Creating export file for ${target_name}")
-    set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                 LINK_FLAGS "  -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+    if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+      set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                   LINK_FLAGS "  -Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+    else()
+      set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                   LINK_FLAGS "  -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+    endif()
   else()
     set(native_export_file "${target_name}.def")
 
-- 
2.4.3



More information about the llvm-commits mailing list