Source23: extract-ubsan-logs
Source24: lsan.supp
Source25: TSAN_OPTIONS
+Source26: macros.asan
Group: Development/Building
Summary: GCC related scripts
-License: MIT
+License: MIT
%{?cross:ExcludeArch: %{cross}}
%description
GCC related scripts
%%gcc_unforce_options \\
%%gcc_force_options %%asan_force_options -fcommon
EOF
+
+# Add ASan's blacklist macro to tizen_macros
+cat %{_rpmconfigdir}/macros.asan >> %{_rpmconfigdir}/tizen_macros
+
# ASan needs a whole shadow address space
# Using ulimit can only set the value for current user so we need to set /etc/security/limits.conf directly.
sed '/End of file/i\abuild\tsoft\tas\t-1\nabuild\thard\tas\t-1' -i /etc/security/limits.conf
mkdir -p %{buildroot}/%{_rpmconfigdir}/tizen/
install -m 0644 %{SOURCE21} %{buildroot}/
install -m 0644 %{SOURCE22} %{buildroot}/%{_rpmconfigdir}/
+install -m 0644 %{SOURCE26} %{buildroot}/%{_rpmconfigdir}/
install -m 0755 %{SOURCE23} %{buildroot}/%{_rpmconfigdir}/tizen/
%files
%defattr(-,root,root,-)
%{_prefix}/bin/gcc-force-options
%{_prefix}/bin/gcc-unforce-options
+%{_rpmconfigdir}/macros.asan
%files -n ubsan-force-options
%defattr(-,root,root,-)
--- /dev/null
+# /etc/rpm/macros.asan
+
+# A function to blacklist packages from ASan build.
+# If package is listed in blacklist named %asan_incompatible_pkgs,
+# the %gcc_unforce_options will be applied before build
+# The blacklist can be maintained in OBS project config
+
+%__spec_build_pre \
+ %{___build_pre} \
+ %{lua: \
+ if (nil ~= string.find( \
+ " " .. rpm.expand("%asan_incompatible_pkgs") .. " ", \
+ " " .. rpm.expand("%name") .. " ")) \
+ then print(rpm.expand("%gcc_unforce_options")) \
+ end \
+ } \
+ %{nil}