From 6efcf87c522547d50b1c39b128de6e9892e3a80b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 1 Dec 2018 11:10:22 -0800 Subject: [PATCH] build: build libdispatch as position independent When building libdispatch as a static library ensure that it is built as a PIC library. This is implicit when building a shared library. If the library is not built shared, we cannot statically link it on Unix targets. This partially resolves SR-9384! --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 06396ca2a..4790ac6d9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,6 +54,11 @@ add_library(dispatch shims/time.h shims/tsd.h shims/yield.h) + +set_target_properties(dispatch + PROPERTIES + POSITION_INDEPENDENT_CODE YES) + if(WIN32) target_sources(dispatch PRIVATE