forked from OSchip/llvm-project
Support Solaris unused sections' gc link syntax.
It is not clear if this would work or not with LLVM_NO_DEAD_STRIP binaries, so be conservative for now. Patch by Xan López. llvm-svn: 240287
This commit is contained in:
parent
99f5fc937f
commit
c32ed570bf
|
@ -186,6 +186,9 @@ function(add_link_opts target_name)
|
||||||
# ld64's implementation of -dead_strip breaks tools that use plugins.
|
# ld64's implementation of -dead_strip breaks tools that use plugins.
|
||||||
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
|
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
|
||||||
LINK_FLAGS " -Wl,-dead_strip")
|
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)
|
elseif(NOT WIN32 AND NOT LLVM_LINKER_IS_GOLD)
|
||||||
# Object files are compiled with -ffunction-data-sections.
|
# Object files are compiled with -ffunction-data-sections.
|
||||||
# Versions of bfd ld < 2.23.1 have a bug in --gc-sections that breaks
|
# Versions of bfd ld < 2.23.1 have a bug in --gc-sections that breaks
|
||||||
|
|
Loading…
Reference in New Issue