From e47b48dd893a132fae8045f9e1b8fad853932aa4 Mon Sep 17 00:00:00 2001 From: Nikolai Merinov Date: Wed, 13 Feb 2019 09:03:44 +0300 Subject: [PATCH] Use -fPIC for the sources that will be part of a shared library --- interface/khronos/CMakeLists.txt | 1 + interface/vmcs_host/CMakeLists.txt | 2 ++ opensrc/helpers/libfdt/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+) diff --git a/interface/khronos/CMakeLists.txt b/interface/khronos/CMakeLists.txt index 9ad615b..d4e2f24 100755 --- a/interface/khronos/CMakeLists.txt +++ b/interface/khronos/CMakeLists.txt @@ -60,6 +60,7 @@ add_library(GLESv2 ${SHARED} ${GLES_SOURCE}) add_library(OpenVG ${SHARED} ${VG_SOURCE}) add_library(WFC ${SHARED} ${WFC_SOURCE}) add_library(khrn_client ${CLIENT_SOURCE}) +target_compile_options(khrn_client PUBLIC -fPIC) # TODO do we need EGL_static and GLESv2_static now that khrn_static exists? add_library(EGL_static STATIC ${EGL_SOURCE}) diff --git a/interface/vmcs_host/CMakeLists.txt b/interface/vmcs_host/CMakeLists.txt index fde18da..7978b27 100755 --- a/interface/vmcs_host/CMakeLists.txt +++ b/interface/vmcs_host/CMakeLists.txt @@ -6,6 +6,8 @@ # vc_vchi_gencmd.c has a type-punning problem in vc_gencmd_read_response add_definitions(-fno-strict-aliasing) +# vchostif will be part of the shared library +add_definitions(-fPIC) include_directories(${VMCS_TARGET}/vcfiled) diff --git a/opensrc/helpers/libfdt/CMakeLists.txt b/opensrc/helpers/libfdt/CMakeLists.txt index f57c61c..cf271ef 100755 --- a/opensrc/helpers/libfdt/CMakeLists.txt +++ b/opensrc/helpers/libfdt/CMakeLists.txt @@ -8,6 +8,7 @@ add_library(fdt fdt_sw.c fdt_strerror.c fdt_wip.c) +target_compile_options(fdt PUBLIC -fPIC) INSTALL(FILES) -- 2.34.1