From f627461bf167e8937ab72a6576877ba0c39dad08 Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Tue, 25 Jul 2017 11:44:17 +0300 Subject: [PATCH] packaging: Enable ASan bootstrap for ASan projects GCC will be built in ASan projects. To test the GCC package the rpm macro `asanbootstrap' should be defined in project config. Change-Id: Id91425e2895f63ec92c8e83fb96f93aaade67728 Signed-off-by: Slava Barinov --- config/bootstrap-asan.mk | 2 +- packaging/gcc-aarch64.spec | 4 ++-- packaging/gcc-armv7l.spec | 4 ++-- packaging/linaro-gcc.spec | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.mk index e73d4c2..1d377a1 100644 --- a/config/bootstrap-asan.mk +++ b/config/bootstrap-asan.mk @@ -5,7 +5,7 @@ export ASAN_OPTIONS=detect_leaks=0:use_odr_indicator=1 STAGE2_CFLAGS += -fsanitize=address STAGE3_CFLAGS += -fsanitize=address -POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \ +POSTSTAGE1_LDFLAGS += -fsanitize=address \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/ \ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs diff --git a/packaging/gcc-aarch64.spec b/packaging/gcc-aarch64.spec index 6880c64..969aafd 100644 --- a/packaging/gcc-aarch64.spec +++ b/packaging/gcc-aarch64.spec @@ -879,6 +879,7 @@ echo "" > gcc/DEV-PHASE %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION` %build +%{?asan:%gcc_unforce_options} rm -rf obj mkdir obj cd obj @@ -923,6 +924,7 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ %{!?cross: \ --enable-libcc1 \ --enable-libgfortran \ + %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \ %ifarch armv7l --with-arch=armv7-a \ --with-tune=cortex-a8 \ @@ -969,8 +971,6 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ --host=%{host_arch} \ --build=%{host_arch} - - make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{?gcc_run_tests: echo "Run testsuite" diff --git a/packaging/gcc-armv7l.spec b/packaging/gcc-armv7l.spec index 37f0f98..20f89b5 100644 --- a/packaging/gcc-armv7l.spec +++ b/packaging/gcc-armv7l.spec @@ -879,6 +879,7 @@ echo "" > gcc/DEV-PHASE %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION` %build +%{?asan:%gcc_unforce_options} rm -rf obj mkdir obj cd obj @@ -923,6 +924,7 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ %{!?cross: \ --enable-libcc1 \ --enable-libgfortran \ + %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \ %ifarch armv7l --with-arch=armv7-a \ --with-tune=cortex-a8 \ @@ -969,8 +971,6 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ --host=%{host_arch} \ --build=%{host_arch} - - make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{?gcc_run_tests: echo "Run testsuite" diff --git a/packaging/linaro-gcc.spec b/packaging/linaro-gcc.spec index 9297a19..58d2857 100644 --- a/packaging/linaro-gcc.spec +++ b/packaging/linaro-gcc.spec @@ -876,6 +876,7 @@ echo "" > gcc/DEV-PHASE %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION` %build +%{?asan:%gcc_unforce_options} rm -rf obj mkdir obj cd obj @@ -920,6 +921,7 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ %{!?cross: \ --enable-libcc1 \ --enable-libgfortran \ + %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \ %ifarch armv7l --with-arch=armv7-a \ --with-tune=cortex-a8 \ @@ -966,8 +968,6 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \ --host=%{host_arch} \ --build=%{host_arch} - - make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{?gcc_run_tests: echo "Run testsuite" -- 2.7.4