[M126 Migration] Add strip-all build option to reduce rpm size 52/320852/1
authorInsoon Kim <is46.kim@samsung.com>
Tue, 5 Nov 2024 09:14:35 +0000 (18:14 +0900)
committerInsoon Kim <is46.kim@samsung.com>
Mon, 25 Nov 2024 05:05:37 +0000 (14:05 +0900)
nodebug option builds without debuginfo rpm package. so debug symbols is
not stripped from chromium libraries. This patch helps to reduce
chromium rpm package size with nodebug option for local dev.

References:
https://review.tizen.org/gerrit/319949

Change-Id: Ife2a12c190bcad89ffcab64ea0a2d83f17e81de8
Signed-off-by: Insoon Kim <is46.kim@samsung.com>
packaging/chromium-efl.spec
tizen_src/build/common.sh

index c39eb76b29f3cddaf22c226e0db664d81ec2938a..1e915735599ee894e6c21980fee30229a162b2c2 100644 (file)
@@ -27,10 +27,16 @@ Source1: content_shell.in
 %endif
 
 %if 0%{?_nodebug}
+# Skip building the debug package for _nodebug option
 %global __debug_install_post %{nil}
 %global debug_package %{nil}
 %endif
 
+# strip all symbols for chromium-efl rpm package
+%if 0%{?_strip_all}
+%define __strip_all 1
+%endif
+
 %if 0%{?_enable_unittests}
 %define _debug_mode 1
 %endif
@@ -966,6 +972,11 @@ install -m 0755 -p -D %{OUTPUT_FOLDER}/ppapi_unittests %{buildroot}/opt/usr/utc_
   install -m 0644 wrt/native_wrtjs.d.ts                           %{buildroot}%{_includedir}/wrt/
 %endif
 
+%if 0%{?__strip_all}
+  echo "Strip all symbols from all libraries in chromium-efl rpm package"
+  find %{buildroot} -type f -name *.so | xargs strip --strip-all
+%endif
+
 %pre
 if (( $(rpm -qa | grep 'wrtjs-[[:digit:]]' | wc -l) > 1 )); then
   echo -e "\033[31m*****************************************************"
index 86b5ab7b2dcdf212cc6eafa6b257422ff6cddecf..0f53fd1caa38fc6ce3eb666c26279eaafdf64d03 100755 (executable)
@@ -225,6 +225,24 @@ function findElementInArray() {
   return 1;
 }
 
+function gbsBuldScriptUsage() {
+cat << EOF
+usage: $1 [OPTIONS]
+
+Build gbs version of chromium-efl
+
+OPTIONS:
+   -h, --help               Show this message
+   --disable-build-chrome   Build chromium-efl without chrome browser
+   --nodebug                Build -g0 option without debuginfo package
+   --strip-all              Strip all symbols for chromium-efl rpm packages
+
+examples:
+$0 --nodebug --strip-all
+EOF
+  exit
+}
+
 function setupAndExecuteTargetBuild() {
   local platform="$1"
   shift
@@ -251,6 +269,9 @@ function setupAndExecuteTargetBuild() {
 
   while [[ $# > 0 ]]; do
     case "$1" in
+    -h|--help)
+        gbsBuldScriptUsage ${0}
+        ;;
     --debug)
         ARGS+=(--define "_debug_mode 1")
     ;;
@@ -286,6 +307,9 @@ function setupAndExecuteTargetBuild() {
     --nodebug)
         ARGS+=(--define "_nodebug 1")
     ;;
+    --strip-all)
+        ARGS+=(--define "_strip_all 1")
+    ;;
     --noinit)
         NOINIT=1
         ARGS+=("$1")