From: Dongsun Lee Date: Fri, 26 Apr 2024 09:48:26 +0000 (+0900) Subject: Add build flags for PIE X-Git-Tag: accepted/tizen/7.0/unified/20240502.113454^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F310404%2F1;p=platform%2Fcore%2Fsecurity%2Fwebauthn.git Add build flags for PIE Change-Id: Iffaac9946139daa0bfd2da41f20ed45b048e4d10 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 578c2b4..087c268 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,10 @@ SET(LDFLAGS "${LDFLAGS} -lgcov") ADD_DEFINITIONS("-DGCOV_BUILD=\"${GCOV_BUILD}\"") ENDIF(GCOV_BUILD) +# Force PIE +SET(CMAKE_POSITION_INDEPENDENT_CODE "True") +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") + # If supported for the target machine, emit position-independent code,suitable # for dynamic linking and avoiding any limit on the size of the global offset # table. This option makes a difference on the m68k, PowerPC and SPARC.