[llvm] r335425 - [CMake] Do not use --gc-sections on OpenBSD
Brad Smith via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 23 14:43:27 PDT 2018
Author: brad
Date: Sat Jun 23 14:43:27 2018
New Revision: 335425
URL: http://llvm.org/viewvc/llvm-project?rev=335425&view=rev
Log:
[CMake] Do not use --gc-sections on OpenBSD
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=335425&r1=335424&r2=335425&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Sat Jun 23 14:43:27 2018
@@ -221,7 +221,7 @@ function(add_link_opts target_name)
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 AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
# Object files are compiled with -ffunction-data-sections.
# Versions of bfd ld < 2.23.1 have a bug in --gc-sections that breaks
# tools that use plugins. Always pass --gc-sections once we require
More information about the llvm-commits
mailing list