Actually undefine source fortification on debug build 57/147157/3
authorLukasz Kostyra <l.kostyra@samsung.com>
Thu, 31 Aug 2017 11:51:14 +0000 (13:51 +0200)
committerLukasz Kostyra <l.kostyra@samsung.com>
Mon, 11 Sep 2017 14:51:52 +0000 (16:51 +0200)
Appearently -U flag was not passed to preprocessor and had
to be provided in another way. Now _FORTIFY_SOURCE warnings
on debug build will disappear.

Change-Id: I99abde5c72972e7b689b037a4bfcdf15377a8da6

CMakeLists.txt
packaging/tef-simulator.spec
simulatordaemon/CMakeLists.txt

index da7492c..6d43b07 100644 (file)
@@ -52,8 +52,8 @@ IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
     ADD_DEFINITIONS("-DTIZEN_DEBUG_ENABLE")
     ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
     ADD_DEFINITIONS("-ggdb -O0")
-    # undefine _FORTIFY_SOURCE to supress warnings
-    ADD_COMPILE_OPTIONS("-U_FORTIFY_SOURCE")
+    # undefine _FORTIFY_SOURCE - it makes no sense without optimization and produces warnings
+    ADD_DEFINITIONS("-Wp,-U_FORTIFY_SOURCE")
     ADD_DEFINITIONS("-D_LOGGING")
 ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
 
index 8be0b40..9cf378c 100644 (file)
@@ -74,7 +74,6 @@ with TEF Simulator.
 
 %build
 # cannot call cmake rpmbuild macro because of scripts removing libTEEStub.a, which is a part of devkit
-
 cmake . \
         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
         -DBIN_DIR=%{build_bin_dir} \
index 8c7d710..658ce48 100644 (file)
@@ -87,12 +87,6 @@ LINK_DIRECTORIES(
     ${LOG_PATH}
     )
 
-SET_TARGET_PROPERTIES(
-    ${TARGET_TEF_SIMULATOR_DAEMON}
-    PROPERTIES
-        COMPILE_FLAGS "-U_FORTIFY_SOURCE"
-    )
-
 TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_DAEMON}
     ${CMAKE_THREAD_LIBS_INIT}
     ${DAEMON_DEPS_LIBRARIES}