Blame SOURCES/core-setup-hardening-flags.patch

f2d766
diff --git a/src/settings.cmake b/src/settings.cmake
f2d766
--- a/src/settings.cmake
f2d766
+++ b/src/settings.cmake
f2d766
@@ -218,6 +218,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
f2d766
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
f2d766
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id=sha1")
f2d766
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pie")
f2d766
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id=sha1")
f2d766
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
f2d766
     add_compile_options(-fstack-protector-strong)
f2d766
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
f2d766
     add_compile_options(-fstack-protector)
f2d766
--- a/src/corehost/cli/apphost/CMakeLists.txt
f2d766
+++ b/src/corehost/cli/apphost/CMakeLists.txt
f2d766
@@ -50,6 +50,8 @@
f2d766
 
f2d766
 add_definitions(-DFEATURE_APPHOST=1)
f2d766
 
f2d766
+set_target_properties("apphost" PROPERTIES LINK_FLAGS -pie)
f2d766
+
f2d766
 # Disable manifest generation into the file .exe on Windows
f2d766
 if(WIN32)
f2d766
     set_property(TARGET ${PROJECT_NAME} PROPERTY