mirror of
https://github.com/emqx/neuron.git
synced 2026-10-17 04:40:42 +08:00
enable pie
This commit is contained in:
@@ -40,11 +40,13 @@ if(USE_GCOV)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
|
||||
endif(USE_GCOV)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -g")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=format-truncation")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O0")
|
||||
add_compile_options(-fstack-protector-strong)
|
||||
add_link_options(-fstack-protector-strong)
|
||||
add_link_options(-pie -Wl,-z,relro,-z,now)
|
||||
|
||||
if(NOT DISABLE_ASAN)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -fsanitize=address")
|
||||
|
||||
Reference in New Issue
Block a user