packaging: Enable ASan bootstrap for ASan projects
authorSlava Barinov <v.barinov@samsung.com>
Tue, 25 Jul 2017 08:44:17 +0000 (11:44 +0300)
committerSlava Barinov <v.barinov@samsung.com>
Fri, 28 Jul 2017 13:20:59 +0000 (16:20 +0300)
Sanitized GCC will be built in ASan projects.

Change-Id: Id91425e2895f63ec92c8e83fb96f93aaade67728
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
config/bootstrap-asan.mk
packaging/gcc-aarch64.spec
packaging/gcc-armv7l.spec
packaging/linaro-gcc.spec

index 70baaf9..d22b10c 100644 (file)
@@ -5,7 +5,7 @@ export LSAN_OPTIONS="detect_leaks=0"
 
 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
index 40d1ae6..6648fdc 100644 (file)
@@ -839,6 +839,10 @@ echo "" > gcc/DEV-PHASE
 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
 
 %build
+%{?asan:
+%gcc_unforce_options
+export ac_cv_search_dlopen="-ldl"
+}
 rm -rf obj
 mkdir obj
 cd obj
@@ -883,6 +887,7 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
 %{!?cross: \
        --enable-libcc1 \
        --enable-libgfortran \
+       %{?asan:--enable-bootstrap --with-build-config=bootstrap-asan} \
 %ifarch armv7l
        --with-arch=armv7-a \
        --with-tune=cortex-a8 \
@@ -929,8 +934,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"
index f3ad3bd..b482725 100644 (file)
@@ -839,6 +839,10 @@ echo "" > gcc/DEV-PHASE
 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
 
 %build
+%{?asan:
+%gcc_unforce_options
+export ac_cv_search_dlopen="-ldl"
+}
 rm -rf obj
 mkdir obj
 cd obj
@@ -883,6 +887,7 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
 %{!?cross: \
        --enable-libcc1 \
        --enable-libgfortran \
+       %{?asan:--enable-bootstrap --with-build-config=bootstrap-asan} \
 %ifarch armv7l
        --with-arch=armv7-a \
        --with-tune=cortex-a8 \
@@ -929,8 +934,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"
index c6460cf..f79bbf8 100644 (file)
@@ -836,6 +836,10 @@ echo "" > gcc/DEV-PHASE
 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
 
 %build
+%{?asan:
+%gcc_unforce_options
+export ac_cv_search_dlopen="-ldl"
+}
 rm -rf obj
 mkdir obj
 cd obj
@@ -880,6 +884,7 @@ TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
 %{!?cross: \
        --enable-libcc1 \
        --enable-libgfortran \
+       %{?asan:--enable-bootstrap --with-build-config=bootstrap-asan} \
 %ifarch armv7l
        --with-arch=armv7-a \
        --with-tune=cortex-a8 \
@@ -926,8 +931,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"