[lld] r303400 - Merging r294690:
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Thu May 18 18:55:37 PDT 2017
Author: tstellar
Date: Thu May 18 20:55:37 2017
New Revision: 303400
URL: http://llvm.org/viewvc/llvm-project?rev=303400&view=rev
Log:
Merging r294690:
------------------------------------------------------------------------
r294690 | ericwf | 2017-02-09 20:59:20 -0500 (Thu, 09 Feb 2017) | 13 lines
[CMake] Fix pthread handling for out-of-tree builds
LLVM defines `PTHREAD_LIB` which is used by AddLLVM.cmake and various projects
to correctly link the threading library when needed. Unfortunately
`PTHREAD_LIB` is defined by LLVM's `config-ix.cmake` file which isn't installed
and therefore can't be used when configuring out-of-tree builds. This causes
such builds to fail since `pthread` isn't being correctly linked.
This patch attempts to fix that problem by renaming and exporting
`LLVM_PTHREAD_LIB` as part of`LLVMConfig.cmake`. I renamed `PTHREAD_LIB`
because It seemed likely to cause collisions with downstream users of
`LLVMConfig.cmake`.
------------------------------------------------------------------------
Modified:
lld/branches/release_40/COFF/CMakeLists.txt
lld/branches/release_40/ELF/CMakeLists.txt
lld/branches/release_40/lib/ReaderWriter/MachO/CMakeLists.txt
lld/branches/release_40/unittests/CoreTests/CMakeLists.txt
Modified: lld/branches/release_40/COFF/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_40/COFF/CMakeLists.txt?rev=303400&r1=303399&r2=303400&view=diff
==============================================================================
--- lld/branches/release_40/COFF/CMakeLists.txt (original)
+++ lld/branches/release_40/COFF/CMakeLists.txt Thu May 18 20:55:37 2017
@@ -40,7 +40,7 @@ add_lld_library(lldCOFF
LINK_LIBS
lldCore
- ${PTHREAD_LIB}
+ ${LLVM_PTHREAD_LIB}
DEPENDS
COFFOptionsTableGen
Modified: lld/branches/release_40/ELF/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_40/ELF/CMakeLists.txt?rev=303400&r1=303399&r2=303400&view=diff
==============================================================================
--- lld/branches/release_40/ELF/CMakeLists.txt (original)
+++ lld/branches/release_40/ELF/CMakeLists.txt Thu May 18 20:55:37 2017
@@ -53,7 +53,7 @@ add_lld_library(lldELF
LINK_LIBS
lldConfig
lldCore
- ${PTHREAD_LIB}
+ ${LLVM_PTHREAD_LIB}
DEPENDS
ELFOptionsTableGen
Modified: lld/branches/release_40/lib/ReaderWriter/MachO/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_40/lib/ReaderWriter/MachO/CMakeLists.txt?rev=303400&r1=303399&r2=303400&view=diff
==============================================================================
--- lld/branches/release_40/lib/ReaderWriter/MachO/CMakeLists.txt (original)
+++ lld/branches/release_40/lib/ReaderWriter/MachO/CMakeLists.txt Thu May 18 20:55:37 2017
@@ -28,7 +28,7 @@ add_lld_library(lldMachO
LINK_LIBS
lldCore
lldYAML
- ${PTHREAD_LIB}
+ ${LLVM_PTHREAD_LIB}
)
include_directories(.)
Modified: lld/branches/release_40/unittests/CoreTests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_40/unittests/CoreTests/CMakeLists.txt?rev=303400&r1=303399&r2=303400&view=diff
==============================================================================
--- lld/branches/release_40/unittests/CoreTests/CMakeLists.txt (original)
+++ lld/branches/release_40/unittests/CoreTests/CMakeLists.txt Thu May 18 20:55:37 2017
@@ -3,5 +3,5 @@ add_lld_unittest(CoreTests
)
target_link_libraries(CoreTests
- ${PTHREAD_LIB}
+ ${LLVM_PTHREAD_LIB}
)
More information about the llvm-commits
mailing list