1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
Index: llvm-toolchain-3.8-3.8.1/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm-toolchain-3.8-3.8.1.orig/cmake/modules/AddLLVM.cmake
+++ llvm-toolchain-3.8-3.8.1/cmake/modules/AddLLVM.cmake
@@ -82,13 +82,8 @@ function(add_llvm_symbol_exports target_
DEPENDS ${export_file}
VERBATIM
COMMENT "Creating export file for ${target_name}")
- 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")
@@ -156,7 +151,7 @@ function(add_link_opts target_name)
# Pass -O3 to the linker. This enabled different optimizations on different
# linkers.
- if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin|SunOS" OR WIN32))
+ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32))
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-O3")
endif()
@@ -174,9 +169,6 @@ function(add_link_opts target_name)
# ld64's implementation of -dead_strip breaks tools that use plugins.
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-dead_strip")
- elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- set_property(TARGET ${target_name} APPEND_STRING PROPERTY
- LINK_FLAGS " -Wl,-z -Wl,discard-unused=sections")
elseif(NOT WIN32 AND NOT LLVM_LINKER_IS_GOLD)
# Object files are compiled with -ffunction-data-sections.
# Versions of bfd ld < 2.23.1 have a bug in --gc-sections that breaks
Index: llvm-toolchain-3.8-3.8.1/tools/llvm-shlib/CMakeLists.txt
===================================================================
--- llvm-toolchain-3.8-3.8.1.orig/tools/llvm-shlib/CMakeLists.txt
+++ llvm-toolchain-3.8-3.8.1/tools/llvm-shlib/CMakeLists.txt
@@ -42,7 +42,7 @@ add_llvm_library(LLVM SHARED DISABLE_LLV
set_property(TARGET LLVM PROPERTY VERSION "1") # Append .1 to SONAME
list(REMOVE_DUPLICATES LIB_NAMES)
-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "GNU" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD") # FIXME: It should be "GNU ld for elf"
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "GNU" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "kFreeBSD" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
# GNU ld doesn't resolve symbols in the version script.
set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|