diff --git a/executer/user/CMakeLists.txt b/executer/user/CMakeLists.txt index c53dc9d9..d7a0de9a 100644 --- a/executer/user/CMakeLists.txt +++ b/executer/user/CMakeLists.txt @@ -31,9 +31,13 @@ else() target_link_libraries(mcinspect ${LIBDWARF}) endif() target_link_libraries(mcinspect ${LIBBFD}) +set_property(TARGET mcinspect PROPERTY POSITION_INDEPENDENT_CODE ON) +set_property(TARGET mcinspect PROPERTY LINK_FLAGS "-fPIE -pie") add_executable(eclair eclair.c arch/${ARCH}/arch-eclair.c) target_link_libraries(eclair ${LIBBFD}) +set_property(TARGET eclair PROPERTY POSITION_INDEPENDENT_CODE ON) +set_property(TARGET eclair PROPERTY LINK_FLAGS "-fPIE -pie") add_library(sched_yield SHARED libsched_yield.c) target_link_libraries(sched_yield dl) diff --git a/scripts/mckernel.spec.in b/scripts/mckernel.spec.in index 3303d841..9d51c637 100644 --- a/scripts/mckernel.spec.in +++ b/scripts/mckernel.spec.in @@ -71,6 +71,8 @@ This package contains headers and libraries required for build apps using IHK/Mc # We need to remove ld flags like relro for the final mckernel.img link, as well as remove cflags for mckernel # ideally mckernel should use different environment variables for the user tools and the kernel tools altogether... +%undefine _hardened_build +%define build_ldflags "" %define __global_ldflags "" %define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -grecord-gcc-switches -mtune=generic