Fix compile/linker flags 08/93708/1
authorSangyoon Jang <s89.jang@samsung.com>
Tue, 25 Oct 2016 10:35:53 +0000 (19:35 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 25 Oct 2016 10:35:53 +0000 (19:35 +0900)
Add -fPIE, -fPIE flag.
(for applying ASLR)

Change-Id: Icaddc19acd06e41053329596c23432bc3dd60a32
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
installer/CMakeLists.txt

index b408005f707a0cd607aa1207a7b51a02f04099cc..3d27a95805ac2bd98584ee79a0d83825b0177406 100644 (file)
@@ -42,7 +42,7 @@ ENDFOREACH()
 add_library(pkgmgr_installer SHARED pkgmgr_installer.c)
 set_target_properties(pkgmgr_installer PROPERTIES SOVERSION ${VERSION_MAJOR})
 set_target_properties(pkgmgr_installer PROPERTIES VERSION ${VERSION})
-set_target_properties(pkgmgr_installer PROPERTIES COMPILE_FLAGS "${installer_pkgs_CFLAGS_str}")
+set_target_properties(pkgmgr_installer PROPERTIES COMPILE_FLAGS "${installer_pkgs_CFLAGS_str} -fPIC")
 target_link_libraries(pkgmgr_installer ${installer_pkgs_LDFLAGS})
 
 ### Create pc file
@@ -56,7 +56,7 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgmgr-installer.pc DESTINATION ${LIB_
 
 ## pkgmgr_installer_signal_agent
 ADD_EXECUTABLE(pkgmgr-installer-signal-agent pkgmgr_installer_signal_agent.c)
-SET_TARGET_PROPERTIES(pkgmgr-installer-signal-agent PROPERTIES COMPILE_FLAGS "${AGENT_CFLAGS}")
-TARGET_LINK_LIBRARIES(pkgmgr-installer-signal-agent ${AGENT_DEPS_LDFLAGS})
+SET_TARGET_PROPERTIES(pkgmgr-installer-signal-agent PROPERTIES COMPILE_FLAGS "${AGENT_CFLAGS} -fPIE")
+TARGET_LINK_LIBRARIES(pkgmgr-installer-signal-agent ${AGENT_DEPS_LDFLAGS} "-pie")
 
 INSTALL(TARGETS pkgmgr-installer-signal-agent DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)