From 3e3fac6d58ffa4a65a61bfd4fcf74c321fc18665 Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Thu, 12 May 2016 13:06:59 +0300 Subject: [PATCH] Install ASAN_OPTIONS from file Using ASAN_OPTIONS file is simpler solution that post-install script and prevents issues with sanitized bash. Change-Id: Iaa2b362f0cff0d7269635780dfc88bd6c3ec7d52 Signed-off-by: Slava Barinov --- packaging/ASAN_OPTIONS | 1 + packaging/gcc-aarch64.spec | 8 +++++++- packaging/gcc-armv7l.spec | 8 +++++++- packaging/linaro-gcc.spec | 8 +++++++- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 packaging/ASAN_OPTIONS diff --git a/packaging/ASAN_OPTIONS b/packaging/ASAN_OPTIONS new file mode 100644 index 0000000..24fcaeb --- /dev/null +++ b/packaging/ASAN_OPTIONS @@ -0,0 +1 @@ +halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0 \ No newline at end of file diff --git a/packaging/gcc-aarch64.spec b/packaging/gcc-aarch64.spec index 8ee8b07..4d900de 100644 --- a/packaging/gcc-aarch64.spec +++ b/packaging/gcc-aarch64.spec @@ -85,6 +85,7 @@ Source13: isl-0.12.2.tar.bz2 Source14: cloog-0.18.1.tar.gz Source15: gcc-force-options Source16: gcc-unforce-options +Source17: ASAN_OPTIONS Group: Development/Building Summary: The GNU C Compiler and Support Files License: GPL-3.0+ @@ -656,7 +657,6 @@ Asan build environment echo "libasan.so" > /etc/ld.so.preload [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig -echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0" > /ASAN_OPTIONS %preun -n asan-build-env # Restore /etc/ld.so.preload @@ -844,10 +844,15 @@ rm -rf %{buildroot}/%{libsubdir}/include-fixed rm -rf %{buildroot}/%{libsubdir}/include } +%{!?cross: cp %{SOURCE15} %{SOURCE16} %{buildroot}%{_prefix}/bin chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options +cp %{SOURCE17} %{buildroot} +chmod 644 %{buildroot}/ASAN_OPTIONS +} + %files %defattr(-,root,root) %{?cross: @@ -1065,6 +1070,7 @@ chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options %files -n asan-build-env %defattr(-,root,root,-) +/ASAN_OPTIONS %ifarch %lsan_arch %files -n lsan-build-env diff --git a/packaging/gcc-armv7l.spec b/packaging/gcc-armv7l.spec index 3ea0b62..e65b0e6 100644 --- a/packaging/gcc-armv7l.spec +++ b/packaging/gcc-armv7l.spec @@ -85,6 +85,7 @@ Source13: isl-0.12.2.tar.bz2 Source14: cloog-0.18.1.tar.gz Source15: gcc-force-options Source16: gcc-unforce-options +Source17: ASAN_OPTIONS Group: Development/Building Summary: The GNU C Compiler and Support Files License: GPL-3.0+ @@ -656,7 +657,6 @@ Asan build environment echo "libasan.so" > /etc/ld.so.preload [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig -echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0" > /ASAN_OPTIONS %preun -n asan-build-env # Restore /etc/ld.so.preload @@ -844,10 +844,15 @@ rm -rf %{buildroot}/%{libsubdir}/include-fixed rm -rf %{buildroot}/%{libsubdir}/include } +%{!?cross: cp %{SOURCE15} %{SOURCE16} %{buildroot}%{_prefix}/bin chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options +cp %{SOURCE17} %{buildroot} +chmod 644 %{buildroot}/ASAN_OPTIONS +} + %files %defattr(-,root,root) %{?cross: @@ -1065,6 +1070,7 @@ chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options %files -n asan-build-env %defattr(-,root,root,-) +/ASAN_OPTIONS %ifarch %lsan_arch %files -n lsan-build-env diff --git a/packaging/linaro-gcc.spec b/packaging/linaro-gcc.spec index 9aa15a6..3f46c8b 100644 --- a/packaging/linaro-gcc.spec +++ b/packaging/linaro-gcc.spec @@ -82,6 +82,7 @@ Source13: isl-0.12.2.tar.bz2 Source14: cloog-0.18.1.tar.gz Source15: gcc-force-options Source16: gcc-unforce-options +Source17: ASAN_OPTIONS Group: Development/Building Summary: The GNU C Compiler and Support Files License: GPL-3.0+ @@ -653,7 +654,6 @@ Asan build environment echo "libasan.so" > /etc/ld.so.preload [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig -echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0" > /ASAN_OPTIONS %preun -n asan-build-env # Restore /etc/ld.so.preload @@ -841,10 +841,15 @@ rm -rf %{buildroot}/%{libsubdir}/include-fixed rm -rf %{buildroot}/%{libsubdir}/include } +%{!?cross: cp %{SOURCE15} %{SOURCE16} %{buildroot}%{_prefix}/bin chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options +cp %{SOURCE17} %{buildroot} +chmod 644 %{buildroot}/ASAN_OPTIONS +} + %files %defattr(-,root,root) %{?cross: @@ -1062,6 +1067,7 @@ chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options %files -n asan-build-env %defattr(-,root,root,-) +/ASAN_OPTIONS %ifarch %lsan_arch %files -n lsan-build-env -- 2.7.4