From bc52e97f7866370ac334ea4d098dd6daff85d6f5 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 15 Nov 2019 11:02:49 +0900 Subject: [PATCH] Support prelink feature If the `_prelink_enable` is defined, the app_launcher tool will be compiled without -pie option. Change-Id: I0ece66dd0dbd040c8493d39376ba09b6045a55e2 Signed-off-by: Hwankyu Jhun --- packaging/aul.spec | 11 +++++++++++ tool/CMakeLists.txt | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/packaging/aul.spec b/packaging/aul.spec index 0322476..144beb0 100755 --- a/packaging/aul.spec +++ b/packaging/aul.spec @@ -56,6 +56,12 @@ Requires: %{name} = %{version}-%{release} %description test Application utility library (test tools) +%if "%{?_prelink_enable}" == "y" +%define tizen_feature_prelink 1 +%else +%define tizen_feature_prelink 0 +%endif + %prep %setup -q sed -i 's|TZ_SYS_DB|%{TZ_SYS_DB}|g' %{SOURCE1001} @@ -66,9 +72,14 @@ cp %{SOURCE1001} . CFLAGS="%{optflags} -D__emul__"; export CFLAGS %endif +%if 0%{?tizen_feature_prelink} +_TIZEN_FEATURE_PRELINK=ON +%endif + MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake -DFULLVER=%{version} \ -DMAJORVER=${MAJORVER} \ + -D_TIZEN_FEATURE_PRELINK:BOOL=${_TIZEN_FEATURE_PRELINK} \ . %__make %{?_smp_mflags} diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt index fd4c5d7..b63af07 100644 --- a/tool/CMakeLists.txt +++ b/tool/CMakeLists.txt @@ -28,7 +28,15 @@ INSTALL(TARGETS launch_debug DESTINATION bin) add_executable(app_launcher app_launcher.c) + +IF(_TIZEN_FEATURE_PRELINK) +message(STATUS "[__PRELINK__] Enable") +target_link_libraries(app_launcher aul ${pkgs_LDFLAGS}) +ELSE(_TIZEN_FEATURE_PRELINK) +message(STATUS "[__PRELINK__] Disable") target_link_libraries(app_launcher aul ${pkgs_LDFLAGS} "-pie") +ENDIF(_TIZEN_FEATURE_PRELINK) + INSTALL(TARGETS app_launcher DESTINATION bin) add_executable(appgroup_info -- 2.7.4