dotnet3.1/SOURCES/corefx-hardening-flags.patch
2021-09-09 16:09:23 +00:00

12 lines
488 B
Diff

--- a/src/Native/Unix/System.Native/CMakeLists.txt
+++ b/src/Native/Unix/System.Native/CMakeLists.txt
@@ -48,6 +48,8 @@
set_target_properties(System.Native-Static PROPERTIES PREFIX "")
set_target_properties(System.Native-Static PROPERTIES OUTPUT_NAME System.Native CLEAN_DIRECT_OUTPUT 1)
+set_target_properties(System.Native PROPERTIES LINK_FLAGS -pie)
+
if (CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CLR_CMAKE_PLATFORM_ANDROID)
target_link_libraries(System.Native rt)
endif ()