Enable RELRO option for Wearable 77/173677/1 accepted/tizen/unified/20180326.075257 submit/tizen/20180323.070027
authorSeungbae Shin <seungbae.shin@samsung.com>
Fri, 23 Mar 2018 06:12:30 +0000 (15:12 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Fri, 23 Mar 2018 06:12:43 +0000 (15:12 +0900)
Change-Id: I4ab119100a7f14f2dcb3e232dd485d6caaff1304

configure.ac
packaging/murphy.spec
src/Makefile.am

index 9afa18bbfdf29768fad43d0d5352800052c57bf3..9338883677356f4b2c0fc594ebfae33c763df2ef 100644 (file)
@@ -487,6 +487,16 @@ AC_SUBST(DLOG_ENABLED)
 AC_SUBST(DLOG_CFLAGS)
 AC_SUBST(DLOG_LIBS)
 
+# Check if dlog support should be enabled.
+AC_ARG_ENABLE(relro,
+              [  --enable-relro          enable RELRO option],
+          [enable_relro=$enableval], [enable_relro=no])
+if test "$enable_relro" = "yes"; then
+    AC_DEFINE([RELRO_ENABLED], 1, [Enable RELRO option ?])
+fi
+AM_CONDITIONAL(RELRO_ENABLED, [test "$enable_relro" = "yes"])
+AC_SUBST(RELRO_ENABLED)
+
 # Set up murphy CFLAGS and LIBS.
 MURPHY_CFLAGS=""
 MURPHY_LIBS=""
@@ -752,6 +762,7 @@ echo "Murphy console plugin and client: $enable_console"
 echo "Resource management support: $with_resources"
 echo "Websockets support: $enable_websockets"
 echo "systemd support: $enable_systemd"
+echo "RELRO option: $enable_relro"
 echo "Plugins:"
 echo "  - linked-in:"
 for plugin in ${INTERNAL_PLUGINS:-none}; do
index 759e8a1a404a999937d298d188a178d3c1d87dcc..566c41342ac93238fe4898e4d6eada7d76e602e8 100644 (file)
@@ -29,7 +29,7 @@
 Summary: Resource policy framework
 Name: murphy
 Version: 0.0.74
-Release: 8
+Release: 9
 License: BSD-3-Clause
 Group: System/Service
 URL: http://01.org/murphy/
@@ -246,6 +246,11 @@ CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-websockets"
 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-smack"
 #%endif
 
+%if "%{?tizen_profile_name}" == "wearable"
+echo "tizen profile wearable"
+CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-relro"
+%endif
+
 ./bootstrap
 %configure $CONFIG_OPTIONS --with-dynamic-plugins=$DYNAMIC_PLUGINS
 %__make clean
index fa92652ebbf858e39e5caa5cada240234b3e596e..d616ed72bb1b793c79727811b3034ad7ef2997a4 100644 (file)
@@ -1503,6 +1503,10 @@ endif
 
 murphyd_LDFLAGS = -rdynamic
 
+if RELRO_ENABLED
+murphyd_LDFLAGS += -Wl,-z,relro
+endif
+
 install-data-hook::
        rm -f $(DESTDIR)/$(sysconfdir)/murphy/murphy.cfg
        echo "load-plugin lua config=\"$(sysconfdir)/murphy/main.cfg\"" \