Add the PIE option for the excutable binary 93/143193/1 accepted/tizen/unified/20170811.021137 submit/tizen/20170809.230017
authorDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 9 Aug 2017 04:16:41 +0000 (13:16 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 9 Aug 2017 04:16:41 +0000 (13:16 +0900)
Change-Id: Ia2a6bb65e6da5b2b7a083bd29acbe4eb671b071c
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
test/CMakeLists.txt

index cc4ad7dd4bd0d6a753c019f84df46941a5b7307a..84eb9f034497bdc76be89db2d77d05d9ee537111 100644 (file)
@@ -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")