From e3908751b71e2ae704e76f018af0db91319750f2 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/unwinder/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/unwinder/CMakeLists.txt') diff --git a/src/unwinder/CMakeLists.txt b/src/unwinder/CMakeLists.txt index 5cd7bae337..9a5d7829c8 100644 --- a/src/unwinder/CMakeLists.txt +++ b/src/unwinder/CMakeLists.txt @@ -19,10 +19,6 @@ list(APPEND UNWINDER_SOURCES convert_to_absolute_path(UNWINDER_SOURCES ${UNWINDER_SOURCES}) -if(CLR_CMAKE_PLATFORM_UNIX) - add_compile_options(-fPIC) -endif(CLR_CMAKE_PLATFORM_UNIX) - if(CLR_CMAKE_PLATFORM_UNIX) add_subdirectory(wks) endif(CLR_CMAKE_PLATFORM_UNIX) -- cgit v1.2.3