From 6db0df8f767eddb8e4406afe81d0f631e64d5b0d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 22 Jan 2015 20:57:30 +0000 Subject: [PATCH] Don't use -z,defs on FreeBSD. Looks like environ is defined only in the main binary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226862 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/HandleLLVMOptions.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake index 9397225d5db..874769450ec 100644 --- a/cmake/modules/HandleLLVMOptions.cmake +++ b/cmake/modules/HandleLLVMOptions.cmake @@ -106,8 +106,9 @@ endif() # Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO # build might work on ELF but fail on MachO/COFF. -if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32) AND - NOT LLVM_USE_SANITIZER) +if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR + ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") AND + NOT LLVM_USE_SANITIZER) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs") endif()