%%gcc_unforce_options \\
%%gcc_force_options %%asan_force_options -fcommon
EOF
+# 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
%preun -n asan-force-options
# Restore read-only mode
[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/ \
&& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a-w
/usr/bin/gcc-unforce-options
+# Restore limit configurations set for ASan
+sed '/abuild/d' -i /etc/security/limits.conf
%package -n ubsan-force-options
Summary: Scripts to enable automatic package sanitization
%%gcc_unforce_options \\
%%gcc_force_options %%asan_force_options -fcommon
EOF
+# 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
%preun -n asan-force-options
# Restore read-only mode
[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/ \
&& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a-w
/usr/bin/gcc-unforce-options
+# Restore limit configurations set for ASan
+sed '/abuild/d' -i /etc/security/limits.conf
%package -n ubsan-force-options
Summary: Scripts to enable automatic package sanitization
%%gcc_unforce_options \\
%%gcc_force_options %%asan_force_options -fcommon
EOF
+# 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
%preun -n asan-force-options
# Restore read-only mode
[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/ \
&& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a-w
/usr/bin/gcc-unforce-options
+# Restore limit configurations set for ASan
+sed '/abuild/d' -i /etc/security/limits.conf
%package -n ubsan-force-options
Summary: Scripts to enable automatic package sanitization