Add Partial RELRO for executables of wearable 71/173671/4 accepted/tizen/unified/20180326.075320 submit/tizen/20180323.070121
authorYoungHun Kim <yh8004.kim@samsung.com>
Fri, 23 Mar 2018 05:04:02 +0000 (14:04 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Fri, 23 Mar 2018 06:48:41 +0000 (15:48 +0900)
Change-Id: I70bbc188138462a621937b4844e0c0de56e8475a

packaging/mused.spec
server/CMakeLists.txt

index b9dd580..042bd83 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mused
 Summary:    A multimedia daemon
-Version:    0.3.35
+Version:    0.3.36
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
@@ -73,9 +73,14 @@ export CFLAGS+=" -DMUSE_USE_CLIENT_SIGHANDLER"
 export CFLAGS+=" -DMUSE_REGISTER_VIP -DMUSE_USE_LWIPC -DMUSE_TTRACE_LOG"
 %cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIBDIR=%{_libdir} -DTZ_SYS_DATA=%TZ_SYS_DATA -DMUSE_REGISTER_VIP=1 -DMUSE_TTRACE_LOG=1 -DMUSE_USE_LWIPC=1
 %else
+%if ("%{tizen_profile_name}" == "wearable")
+export CFLAGS+=" -DMUSE_USE_POWER_OFF_STATE_CHANGE -DMUSE_USE_EXTERNAL_STORAGE_STATE_CHANGE -DMUSE_USE_WATCHDOG"
+%cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIBDIR=%{_libdir} -DTZ_SYS_DATA=%TZ_SYS_DATA -DMUSE_RELRO_ENABLE=1
+%else
 export CFLAGS+=" -DMUSE_USE_POWER_OFF_STATE_CHANGE -DMUSE_USE_EXTERNAL_STORAGE_STATE_CHANGE -DMUSE_USE_WATCHDOG"
 %cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DLIBDIR=%{_libdir} -DTZ_SYS_DATA=%TZ_SYS_DATA
 %endif
+%endif
 
 make %{?jobs:-j%jobs}
 
index 47e07b7..e53927e 100644 (file)
@@ -37,7 +37,12 @@ ENDIF("${ARCH}" STREQUAL "arm")
 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
 ADD_DEFINITIONS("-DTIZEN_DEBUG")
 
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+IF(${MUSE_RELRO_ENABLE})
+    SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,relro,--as-needed -pie")
+ELSE()
+    SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+ENDIF(${MUSE_RELRO_ENABLE})
 
 aux_source_directory(src SER_SOURCES)
 ADD_LIBRARY(${fw_name}-${server} SHARED ${SER_SOURCES})