Apply ASLR 57/123057/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 4 Apr 2017 08:39:35 +0000 (17:39 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 4 Apr 2017 08:39:35 +0000 (17:39 +0900)
Change-Id: I4961346d140db3758a6c5b7b1c1489fb57f69f8d
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
CMakeLists.txt

index 18fb0bb..08ece77 100644 (file)
@@ -73,10 +73,11 @@ FOREACH(flag ${ISE_PKGS_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -fPIE -Wall")
 #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -finstrument-functions")
 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 
 ADD_DEFINITIONS("-DPACKAGE=\"${ISE_PACKAGE}\"")
 ADD_DEFINITIONS("-DPACKAGE_NAME=\"${ISE_PKGNAME}\"")