From f3df95bc38d98acadd86a054f05b3a00ad5efd95 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/md/enc/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/md/enc/CMakeLists.txt') diff --git a/src/md/enc/CMakeLists.txt b/src/md/enc/CMakeLists.txt index 32d640a09a..2f1398d6f1 100644 --- a/src/md/enc/CMakeLists.txt +++ b/src/md/enc/CMakeLists.txt @@ -44,10 +44,6 @@ endif(WIN32) convert_to_absolute_path(MDRUNTIMERW_HEADERS ${MDRUNTIMERW_HEADERS}) convert_to_absolute_path(MDRUNTIMERW_SOURCES ${MDRUNTIMERW_SOURCES}) -if(CLR_CMAKE_PLATFORM_UNIX) - add_compile_options(-fPIC) -endif(CLR_CMAKE_PLATFORM_UNIX) - add_subdirectory(dac) add_subdirectory(wks) add_subdirectory(dbi) -- cgit v1.2.3