Enable linaro-gcc bootstrap with asan config.
[platform/upstream/linaro-gcc.git] / packaging / gcc-armv7l.spec
index e7cd626..9644de5 100644 (file)
 %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