%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
%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'
%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 \
--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
%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
%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'
%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 \
--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
%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
%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'
%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 \
--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
%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
%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'
%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 \
--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