diff options
author | Mikhail Kashkarov <m.kashkarov@partner.samsung.com> | 2018-08-30 12:20:25 +0300 |
---|---|---|
committer | Mikhail Kashkarov <m.kashkarov@partner.samsung.com> | 2018-09-06 11:50:18 +0300 |
commit | cd4c1a4a74766c220d4acd861ea03ad6529af4e9 (patch) | |
tree | 0294952a6d5f9434e11db5ea67e78628dd0f6daf | |
parent | df0472cdee9c0e009b512bad0550065d589ae1b0 (diff) | |
download | linaro-gcc-cd4c1a4a74766c220d4acd861ea03ad6529af4e9.tar.gz linaro-gcc-cd4c1a4a74766c220d4acd861ea03ad6529af4e9.tar.bz2 linaro-gcc-cd4c1a4a74766c220d4acd861ea03ad6529af4e9.zip |
packaging: Add macroses to test linaro-gcc on target devicesandbox/mkashkarov/tests_on_target_device
- run_tests_on_device:
1. Turn on linaro-gcc tests.
2. Do not remove 'obj/' directory.
3. Skip configure/make commands in the %build stage.
- exit_on_make_finish:
Exit right after "make BOOT_CFLAGS=..." step.
Change-Id: I77a85befa7756922963b63488aaf8cdc431fec0f
-rw-r--r-- | packaging/gcc-aarch64.spec | 28 | ||||
-rw-r--r-- | packaging/gcc-armv7hl.spec | 28 | ||||
-rw-r--r-- | packaging/gcc-armv7l.spec | 28 | ||||
-rw-r--r-- | packaging/linaro-gcc.spec | 28 |
4 files changed, 112 insertions, 0 deletions
diff --git a/packaging/gcc-aarch64.spec b/packaging/gcc-aarch64.spec index 8b48e6361fd..a6b21c7e2de 100644 --- a/packaging/gcc-aarch64.spec +++ b/packaging/gcc-aarch64.spec @@ -23,6 +23,23 @@ %define gcc_run_tests 1 %endif +# Enable this when testing on device to: +# 1. Enable macro to turn on testsuite building ('gcc_run_tests 1') +# 2. Keep 'obj/' folder in build stage as we do not want to rebuild all gcc +# again on device after invoking rpmbuild --short-circuit -bc ... +# 3. Skip configure and make commands and go directly to 'make check' +%if 0%{?run_tests_on_device} +%define gcc_run_tests 1 +%define gcc_keep_build_dir 1 +%define gcc_skip_configure 1 +%define gcc_skip_make 1 +%endif + +# Exit right after 'make ..' step to keep all object files produced by gcc build +%if 0%{?exit_on_make_finish} +%define gcc_exit_on_make_finish 1 +%endif + %define quadmath_arch %ix86 x86_64 ia64 %define tsan_arch x86_64 aarch64 %define esan_arch x86_64 armv7l @@ -685,8 +702,10 @@ RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointe %endif } %{?esan:%gcc_unforce_options} +%{!?gcc_keep_build_dir: rm -rf obj mkdir obj +} cd obj RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g' -e 's/-fexceptions//' -e 's/\([[:space:]]\+.*-D_FORTIFY_SOURCE=\)[[:alnum:]]\+/\10/g' @@ -713,6 +732,7 @@ fi %undefine gcc_profiledbootstrap %endif +%{!?gcc_skip_configure: CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ ../configure \ @@ -801,8 +821,16 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ --target=%{target_arch} \ --host=%{host_arch} \ --build=%{host_arch} +} +%{!?gcc_skip_make: make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}} +} + +%{?gcc_exit_on_make_finish: + exit 1 +} + %{?gcc_run_tests: echo "Run testsuite" # asan needs a whole shadow address space diff --git a/packaging/gcc-armv7hl.spec b/packaging/gcc-armv7hl.spec index 7a7e3d7e143..022cf6f206a 100644 --- a/packaging/gcc-armv7hl.spec +++ b/packaging/gcc-armv7hl.spec @@ -23,6 +23,23 @@ %define gcc_run_tests 1 %endif +# Enable this when testing on device to: +# 1. Enable macro to turn on testsuite building ('gcc_run_tests 1') +# 2. Keep 'obj/' folder in build stage as we do not want to rebuild all gcc +# again on device after invoking rpmbuild --short-circuit -bc ... +# 3. Skip configure and make commands and go directly to 'make check' +%if 0%{?run_tests_on_device} +%define gcc_run_tests 1 +%define gcc_keep_build_dir 1 +%define gcc_skip_configure 1 +%define gcc_skip_make 1 +%endif + +# Exit right after 'make ..' step to keep all object files produced by gcc build +%if 0%{?exit_on_make_finish} +%define gcc_exit_on_make_finish 1 +%endif + %define quadmath_arch %ix86 x86_64 ia64 %define tsan_arch x86_64 aarch64 %define esan_arch x86_64 armv7l @@ -685,8 +702,10 @@ RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointe %endif } %{?esan:%gcc_unforce_options} +%{!?gcc_keep_build_dir: rm -rf obj mkdir obj +} cd obj RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g' -e 's/-fexceptions//' -e 's/\([[:space:]]\+.*-D_FORTIFY_SOURCE=\)[[:alnum:]]\+/\10/g' @@ -713,6 +732,7 @@ fi %undefine gcc_profiledbootstrap %endif +%{!?gcc_skip_configure: CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ ../configure \ @@ -801,8 +821,16 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ --target=%{target_arch} \ --host=%{host_arch} \ --build=%{host_arch} +} +%{!?gcc_skip_make: make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}} +} + +%{?gcc_exit_on_make_finish: + exit 1 +} + %{?gcc_run_tests: echo "Run testsuite" # asan needs a whole shadow address space diff --git a/packaging/gcc-armv7l.spec b/packaging/gcc-armv7l.spec index 83cb8cad8b2..4503e9f3863 100644 --- a/packaging/gcc-armv7l.spec +++ b/packaging/gcc-armv7l.spec @@ -23,6 +23,23 @@ %define gcc_run_tests 1 %endif +# Enable this when testing on device to: +# 1. Enable macro to turn on testsuite building ('gcc_run_tests 1') +# 2. Keep 'obj/' folder in build stage as we do not want to rebuild all gcc +# again on device after invoking rpmbuild --short-circuit -bc ... +# 3. Skip configure and make commands and go directly to 'make check' +%if 0%{?run_tests_on_device} +%define gcc_run_tests 1 +%define gcc_keep_build_dir 1 +%define gcc_skip_configure 1 +%define gcc_skip_make 1 +%endif + +# Exit right after 'make ..' step to keep all object files produced by gcc build +%if 0%{?exit_on_make_finish} +%define gcc_exit_on_make_finish 1 +%endif + %define quadmath_arch %ix86 x86_64 ia64 %define tsan_arch x86_64 aarch64 %define esan_arch x86_64 armv7l @@ -685,8 +702,10 @@ RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointe %endif } %{?esan:%gcc_unforce_options} +%{!?gcc_keep_build_dir: rm -rf obj mkdir obj +} cd obj RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g' -e 's/-fexceptions//' -e 's/\([[:space:]]\+.*-D_FORTIFY_SOURCE=\)[[:alnum:]]\+/\10/g' @@ -713,6 +732,7 @@ fi %undefine gcc_profiledbootstrap %endif +%{!?gcc_skip_configure: CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ ../configure \ @@ -801,8 +821,16 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ --target=%{target_arch} \ --host=%{host_arch} \ --build=%{host_arch} +} +%{!?gcc_skip_make: make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}} +} + +%{?gcc_exit_on_make_finish: + exit 1 +} + %{?gcc_run_tests: echo "Run testsuite" # asan needs a whole shadow address space diff --git a/packaging/linaro-gcc.spec b/packaging/linaro-gcc.spec index c21edda9e1e..1ef45d26ca3 100644 --- a/packaging/linaro-gcc.spec +++ b/packaging/linaro-gcc.spec @@ -20,6 +20,23 @@ %define gcc_run_tests 1 %endif +# Enable this when testing on device to: +# 1. Enable macro to turn on testsuite building ('gcc_run_tests 1') +# 2. Keep 'obj/' folder in build stage as we do not want to rebuild all gcc +# again on device after invoking rpmbuild --short-circuit -bc ... +# 3. Skip configure and make commands and go directly to 'make check' +%if 0%{?run_tests_on_device} +%define gcc_run_tests 1 +%define gcc_keep_build_dir 1 +%define gcc_skip_configure 1 +%define gcc_skip_make 1 +%endif + +# Exit right after 'make ..' step to keep all object files produced by gcc build +%if 0%{?exit_on_make_finish} +%define gcc_exit_on_make_finish 1 +%endif + %define quadmath_arch %ix86 x86_64 ia64 %define tsan_arch x86_64 aarch64 %define esan_arch x86_64 armv7l @@ -682,8 +699,10 @@ RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointe %endif } %{?esan:%gcc_unforce_options} +%{!?gcc_keep_build_dir: rm -rf obj mkdir obj +} cd obj RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g' -e 's/-fexceptions//' -e 's/\([[:space:]]\+.*-D_FORTIFY_SOURCE=\)[[:alnum:]]\+/\10/g' @@ -710,6 +729,7 @@ fi %undefine gcc_profiledbootstrap %endif +%{!?gcc_skip_configure: CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ ../configure \ @@ -798,8 +818,16 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ --target=%{target_arch} \ --host=%{host_arch} \ --build=%{host_arch} +} +%{!?gcc_skip_make: make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}} +} + +%{?gcc_exit_on_make_finish: + exit 1 +} + %{?gcc_run_tests: echo "Run testsuite" # asan needs a whole shadow address space |