%package -n asan-force-options
Summary: Scripts to enable automatic package sanitization
Group: System Environment
-Requires: gcc
+Requires: gcc rpm
Requires: libasan
%description -n asan-force-options
%post -n asan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fno-common -fno-omit-frame-pointer -U_FORTIFY_SOURCE
+# Add restore_fcommon macro
+cat >> /usr/lib/rpm/tizen_macros << EOF
+
+%restore_fcommon \\
+ /usr/bin/gcc-unforce-options \\
+ /usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fcommon -fno-omit-frame-pointer -U_FORTIFY_SOURCE
+
+EOF
%preun -n asan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n ubsan-force-options
%post -n ubsan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize=undefined,bounds-strict,float-divide-by-zero,float-cast-overflow
%preun -n ubsan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n lsan-force-options
%post -n lsan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize=leak
%preun -n lsan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n asan-build-env
%package -n asan-force-options
Summary: Scripts to enable automatic package sanitization
Group: System Environment
-Requires: gcc
+Requires: gcc rpm
Requires: libasan
%description -n asan-force-options
%post -n asan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fno-common -fno-omit-frame-pointer -U_FORTIFY_SOURCE
+# Add restore_fcommon macro
+cat >> /usr/lib/rpm/tizen_macros << EOF
+
+%restore_fcommon \\
+ /usr/bin/gcc-unforce-options \\
+ /usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fcommon -fno-omit-frame-pointer -U_FORTIFY_SOURCE
+
+EOF
%preun -n asan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n ubsan-force-options
%post -n ubsan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize=undefined,bounds-strict,float-divide-by-zero,float-cast-overflow
%preun -n ubsan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n lsan-force-options
%post -n lsan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize=leak
%preun -n lsan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n asan-build-env
%package -n asan-force-options
Summary: Scripts to enable automatic package sanitization
Group: System Environment
-Requires: gcc
+Requires: gcc rpm
Requires: libasan
%description -n asan-force-options
%post -n asan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fno-common -fno-omit-frame-pointer -U_FORTIFY_SOURCE
+# Add restore_fcommon macro
+cat >> /usr/lib/rpm/tizen_macros << EOF
+
+%restore_fcommon \\
+ /usr/bin/gcc-unforce-options \\
+ /usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fcommon -fno-omit-frame-pointer -U_FORTIFY_SOURCE
+
+EOF
%preun -n asan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n ubsan-force-options
%post -n ubsan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize=undefined,bounds-strict,float-divide-by-zero,float-cast-overflow
%preun -n ubsan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n lsan-force-options
%post -n lsan-force-options
# Change mode to allow all users to run gcc-force/unforce-options
chmod a+w /usr/bin
-[ -d /emul/ ] && chmod a+w /emul/usr/bin/
+[ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-force-options -fsanitize=leak
%preun -n lsan-force-options
# Restore read-only mode
chmod a-w /usr/bin
-[ -d /emul/ ] && chmod a-w /emul/usr/bin/
+[ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-4.9.2/obj/gcc/
/usr/bin/gcc-unforce-options
%package -n asan-build-env