Add build option, PIE 43/260043/1 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/7.0/unified/20221110.062853 accepted/tizen/7.0/unified/hotfix/20221116.112011 accepted/tizen/8.0/unified/20231005.100110 accepted/tizen/unified/20210624.131831 submit/tizen/20210618.022653 submit/tizen_6.5/20211028.164001 submit/tizen_6.5/20211029.140001 tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorkiso.chang <kiso.chang@samsung.com>
Fri, 18 Jun 2021 02:16:46 +0000 (11:16 +0900)
committerkiso.chang <kiso.chang@samsung.com>
Fri, 18 Jun 2021 02:17:21 +0000 (11:17 +0900)
Change-Id: I0b5fbd856ddc3e63f2eb0cc865bb8f084819cea3
Signed-off-by: kiso.chang <kiso.chang@samsung.com>
CMakeLists.txt

index 0174ae5b9c4042b082c486edf91ccb0f82a3cfd6..408a7caa71de2c0c72d06f14c7f90b3782b8877a 100755 (executable)
@@ -115,14 +115,14 @@ FOREACH(flag ${PKGS_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror -fPIE")
 SET(GC_SECTIONS_FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections -Werror-implicit-function-declaration -Wparentheses -feliminate-unused-debug-types -pipe -Wall -Wp, -D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -fdiagnostics-color=never -Wno-deprecated-declarations")
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
 
 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
 
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS} -pie)
 
 CONFIGURE_FILE(${PACKAGE_NAME}.xml.in ${PACKAGE_NAME}.xml)