From: DoHyun Pyun Date: Wed, 9 Aug 2017 04:16:41 +0000 (+0900) Subject: Add the PIE option for the excutable binary X-Git-Tag: accepted/tizen/unified/20170811.021137^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git;a=commitdiff_plain;h=3cf301c3bb3b416d95ef88efbfc64d3902aecc7f Add the PIE option for the excutable binary Change-Id: Ia2a6bb65e6da5b2b7a083bd29acbe4eb671b071c Signed-off-by: DoHyun Pyun --- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cc4ad7d..84eb9f0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -15,7 +15,8 @@ FOREACH(flag ${package_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")