$OpenBSD: patch-cmake_modules_AddLLVM_cmake,v 1.3 2017/02/10 09:37:43 ajacoutot Exp $
--- cmake/modules/AddLLVM.cmake.orig	Mon Oct 10 19:43:29 2016
+++ cmake/modules/AddLLVM.cmake	Mon Oct 10 20:18:00 2016
@@ -185,7 +185,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
