From c5401873b23dc61d0edda0f435bee5c6532c3988 Mon Sep 17 00:00:00 2001 From: Seungbae Shin Date: Fri, 23 Mar 2018 15:12:30 +0900 Subject: [PATCH] Enable RELRO option for Wearable Change-Id: I4ab119100a7f14f2dcb3e232dd485d6caaff1304 --- configure.ac | 11 +++++++++++ packaging/murphy.spec | 7 ++++++- src/Makefile.am | 4 ++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9afa18b..9338883 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/packaging/murphy.spec b/packaging/murphy.spec index 759e8a1..566c413 100644 --- a/packaging/murphy.spec +++ b/packaging/murphy.spec @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index fa92652..d616ed7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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\"" \ -- 2.34.1