Skip to content

Commit df1993a

Browse files
TravisEz13adityapatwardhan
authored andcommitted
Enable security flags in native compiler (PowerShell#4933)
* Enable strong stack protection Enable address space layout randomization (ASLR) or PIE * Enable strong stack protection Enable address space layout randomization (ASLR) or PIE
1 parent 951e752 commit df1993a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/libpsl-native/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project(PSL-NATIVE)
33

44
# Can't use add_compile_options with 2.8.11
55
set(CMAKE_BUILD_TYPE "Release")
6-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
6+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror -fstack-protector-strong -fpie")
77
set(LIBRARY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/../powershell-unix")
88

99
if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")

src/libpsl-native/arm.toolchain.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
set(CMAKE_SYSTEM_NAME Linux)
22
set(CMAKE_SYSTEM_VERSION 1)
33
set(CMAKE_SYSTEM_PROCESSOR armv7l)
4-
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
4+
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++ -fstack-protector-strong -fpie)
55
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
66

77
# add_compile_options(-target armv7-linux-gnueabihf)

0 commit comments

Comments
 (0)