STAGE2_CFLAGS += -fsanitize=address
STAGE3_CFLAGS += -fsanitize=address
-POSTSTAGE1_LDFLAGS += -fsanitize=address \
+POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/ \
-B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs
%define gcc_exit_on_make_finish 1
%endif
+# Bootstrap build constrains for ASan config
+%if 0%{?asanbootstrap}
+ %ifarch %arm aarch64 # or #if 0#{?qemu_user_space_build}
+ %{error:"'asanbootstrap' supposed to be used with i586/x86_64 arch"}
+ # The #error macro primitive cannot stop the build because macros are context
+ # free, lazily expanded whereever they are needed, not only during build.
+ # Use non-existing define for now to abort the build.
+ %abort_build
+ %endif
+ # We'll get 2 libasan runtime conflict: preloaded one and another from build dir.
+ %if 0%{?asan}
+ %{error:"'asanbootstrap' could not be used with sanitized environment."}
+ %{error:"Use 'asanbootstrap' without defined 'asan'"}
+ %abort_build
+ %endif
+%endif
+
%define quadmath_arch %ix86 x86_64 ia64
%define tsan_arch x86_64 aarch64
%define esan_arch x86_64 %arm
%define gcc_exit_on_make_finish 1
%endif
+# Bootstrap build constrains for ASan config
+%if 0%{?asanbootstrap}
+ %ifarch %arm aarch64 # or #if 0#{?qemu_user_space_build}
+ %{error:"'asanbootstrap' supposed to be used with i586/x86_64 arch"}
+ # The #error macro primitive cannot stop the build because macros are context
+ # free, lazily expanded whereever they are needed, not only during build.
+ # Use non-existing define for now to abort the build.
+ %abort_build
+ %endif
+ # We'll get 2 libasan runtime conflict: preloaded one and another from build dir.
+ %if 0%{?asan}
+ %{error:"'asanbootstrap' could not be used with sanitized environment."}
+ %{error:"Use 'asanbootstrap' without defined 'asan'"}
+ %abort_build
+ %endif
+%endif
+
%define quadmath_arch %ix86 x86_64 ia64
%define tsan_arch x86_64 aarch64
%define esan_arch x86_64 %arm
%define gcc_exit_on_make_finish 1
%endif
+# Bootstrap build constrains for ASan config
+%if 0%{?asanbootstrap}
+ %ifarch %arm aarch64 # or #if 0#{?qemu_user_space_build}
+ %{error:"'asanbootstrap' supposed to be used with i586/x86_64 arch"}
+ # The #error macro primitive cannot stop the build because macros are context
+ # free, lazily expanded whereever they are needed, not only during build.
+ # Use non-existing define for now to abort the build.
+ %abort_build
+ %endif
+ # We'll get 2 libasan runtime conflict: preloaded one and another from build dir.
+ %if 0%{?asan}
+ %{error:"'asanbootstrap' could not be used with sanitized environment."}
+ %{error:"Use 'asanbootstrap' without defined 'asan'"}
+ %abort_build
+ %endif
+%endif
+
%define quadmath_arch %ix86 x86_64 ia64
%define tsan_arch x86_64 aarch64
%define esan_arch x86_64 %arm
%define gcc_exit_on_make_finish 1
%endif
+# Bootstrap build constrains for ASan config
+%if 0%{?asanbootstrap}
+ %ifarch %arm aarch64 # or #if 0#{?qemu_user_space_build}
+ %{error:"'asanbootstrap' supposed to be used with i586/x86_64 arch"}
+ # The #error macro primitive cannot stop the build because macros are context
+ # free, lazily expanded whereever they are needed, not only during build.
+ # Use non-existing define for now to abort the build.
+ %abort_build
+ %endif
+ # We'll get 2 libasan runtime conflict: preloaded one and another from build dir.
+ %if 0%{?asan}
+ %{error:"'asanbootstrap' could not be used with sanitized environment."}
+ %{error:"Use 'asanbootstrap' without defined 'asan'"}
+ %abort_build
+ %endif
+%endif
+
%define quadmath_arch %ix86 x86_64 ia64
%define tsan_arch x86_64 aarch64
%define esan_arch x86_64 %arm