Skip to content

Commit 891b2aa

Browse files
committed
Enable the fPIE compiler option for executables in the coreclr repo on Unix platforms
1 parent 2aeb3b4 commit 891b2aa

File tree

7 files changed

+17
-0
lines changed

7 files changed

+17
-0
lines changed

src/coreclr/hosts/osxbundlerun/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ project(osxbundlerun)
22

33
include_directories(../unixcoreruncommon)
44

5+
add_compile_options(-fPIE)
6+
57
set(CORERUN_SOURCES
68
../unixcoreruncommon/coreruncommon.cpp
79
osxbundlerun.cpp

src/coreclr/hosts/unixcoreconsole/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ project(unixcoreconsole)
22

33
include_directories(../unixcoreruncommon)
44

5+
add_compile_options(-fPIE)
6+
57
set(CORECONSOLE_SOURCES
68
coreconsole.cpp
79
)

src/coreclr/hosts/unixcorerun/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ project(unixcorerun)
22

33
include_directories(../unixcoreruncommon)
44

5+
add_compile_options(-fPIE)
6+
57
set(CORERUN_SOURCES
68
corerun.cpp
79
)

src/coreclr/hosts/unixcoreruncommon/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
project(unixcoreruncommon)
22

3+
add_compile_options(-fPIC)
4+
35
add_library(unixcoreruncommon
46
STATIC
57
coreruncommon.cpp

src/ilasm/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ add_definitions(-DFEATURE_CORECLR)
1010
include_directories(.)
1111
include_directories(../ildasm/unixcoreclrloader)
1212

13+
if(CLR_CMAKE_PLATFORM_UNIX)
14+
add_compile_options(-fPIE)
15+
endif(CLR_CMAKE_PLATFORM_UNIX)
16+
1317
set(ILASM_SOURCES
1418
assem.cpp
1519
writer.cpp

src/ildasm/exe/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ add_definitions(-DFEATURE_CORECLR)
1010
include_directories(..)
1111

1212
if(CLR_CMAKE_PLATFORM_UNIX)
13+
add_compile_options(-fPIE)
1314
include_directories(../unixcoreclrloader)
1415
build_resources(${CMAKE_CURRENT_SOURCE_DIR}/../dasm.rc dasm_rc TARGET_CPP_FILE)
1516

src/tools/crossgen/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ if(WIN32)
1212
add_definitions(-D_CRT_NON_CONFORMING_WCSTOK)
1313
endif()
1414

15+
if(CLR_CMAKE_PLATFORM_UNIX)
16+
add_compile_options(-fPIE)
17+
endif(CLR_CMAKE_PLATFORM_UNIX)
18+
1519
add_definitions(-DFX_VER_INTERNALNAME_STR=crossgen.exe)
1620
add_definitions(-DNO_NGENPDB)
1721

0 commit comments

Comments
 (0)