Apply ASLR in executable 23/41323/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 31 Mar 2015 01:17:42 +0000 (10:17 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 12 Jun 2015 11:40:14 +0000 (20:40 +0900)
Change-Id: Id7de9f400eed1d638b8bef7b883fcc8a70fad0aa

xml2binary/CMakeLists.txt

index c670682..629e733 100644 (file)
@@ -55,9 +55,11 @@ FOREACH(flag ${pkgs_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fpie -Wall")
-SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fpie -fPIE -Wall")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fPIE")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g -fPIE")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 
 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})