summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergiy Kuryata <sergeyk@microsoft.com>2016-01-14 12:40:37 -0800
committerSergiy Kuryata <sergeyk@microsoft.com>2016-01-14 12:40:37 -0800
commit891b2aa2b1c65ff157a840c3462fa6d007f2dac9 (patch)
tree93c7490afaac07fbe664ca48aab6ca654ec9a09c
parent2aeb3b4c577d9e742f821c7ea3506cea6536869a (diff)
downloadcoreclr-891b2aa2b1c65ff157a840c3462fa6d007f2dac9.tar.gz
coreclr-891b2aa2b1c65ff157a840c3462fa6d007f2dac9.tar.bz2
coreclr-891b2aa2b1c65ff157a840c3462fa6d007f2dac9.zip
Enable the fPIE compiler option for executables in the coreclr repo on Unix platforms
-rw-r--r--src/coreclr/hosts/osxbundlerun/CMakeLists.txt2
-rw-r--r--src/coreclr/hosts/unixcoreconsole/CMakeLists.txt2
-rw-r--r--src/coreclr/hosts/unixcorerun/CMakeLists.txt2
-rw-r--r--src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt2
-rw-r--r--src/ilasm/CMakeLists.txt4
-rw-r--r--src/ildasm/exe/CMakeLists.txt1
-rw-r--r--src/tools/crossgen/CMakeLists.txt4
7 files changed, 17 insertions, 0 deletions
diff --git a/src/coreclr/hosts/osxbundlerun/CMakeLists.txt b/src/coreclr/hosts/osxbundlerun/CMakeLists.txt
index 31ed5704a1..9c8fd7a275 100644
--- a/src/coreclr/hosts/osxbundlerun/CMakeLists.txt
+++ b/src/coreclr/hosts/osxbundlerun/CMakeLists.txt
@@ -2,6 +2,8 @@ project(osxbundlerun)
include_directories(../unixcoreruncommon)
+add_compile_options(-fPIE)
+
set(CORERUN_SOURCES
../unixcoreruncommon/coreruncommon.cpp
osxbundlerun.cpp
diff --git a/src/coreclr/hosts/unixcoreconsole/CMakeLists.txt b/src/coreclr/hosts/unixcoreconsole/CMakeLists.txt
index 905ed261a1..ec5f0e7f6b 100644
--- a/src/coreclr/hosts/unixcoreconsole/CMakeLists.txt
+++ b/src/coreclr/hosts/unixcoreconsole/CMakeLists.txt
@@ -2,6 +2,8 @@ project(unixcoreconsole)
include_directories(../unixcoreruncommon)
+add_compile_options(-fPIE)
+
set(CORECONSOLE_SOURCES
coreconsole.cpp
)
diff --git a/src/coreclr/hosts/unixcorerun/CMakeLists.txt b/src/coreclr/hosts/unixcorerun/CMakeLists.txt
index d17ca0ba7a..48da17c9e0 100644
--- a/src/coreclr/hosts/unixcorerun/CMakeLists.txt
+++ b/src/coreclr/hosts/unixcorerun/CMakeLists.txt
@@ -2,6 +2,8 @@ project(unixcorerun)
include_directories(../unixcoreruncommon)
+add_compile_options(-fPIE)
+
set(CORERUN_SOURCES
corerun.cpp
)
diff --git a/src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt b/src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt
index 92c5cfd8b2..f71e979cc6 100644
--- a/src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt
+++ b/src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt
@@ -1,5 +1,7 @@
project(unixcoreruncommon)
+add_compile_options(-fPIC)
+
add_library(unixcoreruncommon
STATIC
coreruncommon.cpp
diff --git a/src/ilasm/CMakeLists.txt b/src/ilasm/CMakeLists.txt
index bd7934965f..5e82cd2e11 100644
--- a/src/ilasm/CMakeLists.txt
+++ b/src/ilasm/CMakeLists.txt
@@ -10,6 +10,10 @@ add_definitions(-DFEATURE_CORECLR)
include_directories(.)
include_directories(../ildasm/unixcoreclrloader)
+if(CLR_CMAKE_PLATFORM_UNIX)
+ add_compile_options(-fPIE)
+endif(CLR_CMAKE_PLATFORM_UNIX)
+
set(ILASM_SOURCES
assem.cpp
writer.cpp
diff --git a/src/ildasm/exe/CMakeLists.txt b/src/ildasm/exe/CMakeLists.txt
index 84c9d2a242..7d86bf48c8 100644
--- a/src/ildasm/exe/CMakeLists.txt
+++ b/src/ildasm/exe/CMakeLists.txt
@@ -10,6 +10,7 @@ add_definitions(-DFEATURE_CORECLR)
include_directories(..)
if(CLR_CMAKE_PLATFORM_UNIX)
+ add_compile_options(-fPIE)
include_directories(../unixcoreclrloader)
build_resources(${CMAKE_CURRENT_SOURCE_DIR}/../dasm.rc dasm_rc TARGET_CPP_FILE)
diff --git a/src/tools/crossgen/CMakeLists.txt b/src/tools/crossgen/CMakeLists.txt
index ceb808106b..1700eb3dbf 100644
--- a/src/tools/crossgen/CMakeLists.txt
+++ b/src/tools/crossgen/CMakeLists.txt
@@ -12,6 +12,10 @@ if(WIN32)
add_definitions(-D_CRT_NON_CONFORMING_WCSTOK)
endif()
+if(CLR_CMAKE_PLATFORM_UNIX)
+ add_compile_options(-fPIE)
+endif(CLR_CMAKE_PLATFORM_UNIX)
+
add_definitions(-DFX_VER_INTERNALNAME_STR=crossgen.exe)
add_definitions(-DNO_NGENPDB)