From 4feb5cbcbeea277f7addb372b3c632e89f9ed1ae Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Fri, 23 Aug 2019 17:03:01 +0200 Subject: Fix PIE options (#26323) * Fix PIE options We were missing passing the -pie linker option. That means that while we were compiling our code as position independent, the executables (not shared libraries) were not marked as position independent and ASLR was not applied to them. They were always loaded to fixed addresses. This change adds the missing -pie option and also replaces all the individual settings of -fPIE / -fPIC on the targets we build by a centralized setting of CMAKE_POSITION_INDEPENDENT_CODE variable that causes cmake to add the appropriate compiler options everywhere. * Fix native parts of coreclr tests build The native parts of the tests are not built using the root CMakeLists.txt so I am moving enabling the position independent code to configurecompiler.cmake Change-Id: Ieafff8984ec23e5fdb00fb0c2fb017e53afbce88 --- src/strongname/api/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/strongname/api/CMakeLists.txt') diff --git a/src/strongname/api/CMakeLists.txt b/src/strongname/api/CMakeLists.txt index 4efcdb953c..6e596d8ea9 100644 --- a/src/strongname/api/CMakeLists.txt +++ b/src/strongname/api/CMakeLists.txt @@ -17,10 +17,6 @@ set(STRONGNAME_SOURCES convert_to_absolute_path(STRONGNAME_SOURCES ${STRONGNAME_SOURCES}) -if(CLR_CMAKE_PLATFORM_UNIX) - add_compile_options(-fPIC) -endif(CLR_CMAKE_PLATFORM_UNIX) - add_subdirectory(dac) add_subdirectory(wks) add_subdirectory(crossgen) -- cgit v1.2.3