# Please submit bugfixes or comments via http://bugs.tizen.org/
#
-# we use %%{?macro: ... } as it is more compact
+# we use %%{?macro: ... } as it is more compact
%if 0%{?run_tests}
%define gcc_run_tests 1
%endif
%post -n asan-build-env
# Add /usr/lib/libasan.so to /etc/ld.so.preload
-mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
-echo "/usr/lib/libasan.so" > /etc/ld.so.preload
-cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
-rm -f /etc/ld.so.preload.orig
-echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1" > /ASAN_OPTIONS
+[ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
+echo "libasan.so" > /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
+echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0" > /ASAN_OPTIONS
%preun -n asan-build-env
# Restore /etc/ld.so.preload
-mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
%package -n lsan-build-env
Summary: Lsan build environment
Lsan build environment
%post -n lsan-build-env
-# Add /usr/lib/liblsan.so to /etc/ld.so.preload
-mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
-echo "/usr/lib/liblsan.so" > /etc/ld.so.preload
-cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
-rm -f /etc/ld.so.preload.orig
+# Add /usr/lib64/liblsan.so to /etc/ld.so.preload
+[ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
+echo "%{libdir}/liblsan.so" > /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
%preun -n lsan-build-env
# Restore /etc/ld.so.preload
# Please submit bugfixes or comments via http://bugs.tizen.org/
#
-# we use %%{?macro: ... } as it is more compact
+# we use %%{?macro: ... } as it is more compact
%if 0%{?run_tests}
%define gcc_run_tests 1
%endif
%post -n asan-build-env
# Add /usr/lib/libasan.so to /etc/ld.so.preload
-mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
-echo "/usr/lib/libasan.so" > /etc/ld.so.preload
-cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
-rm -f /etc/ld.so.preload.orig
-echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1" > /ASAN_OPTIONS
+[ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
+echo "libasan.so" > /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
+echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0" > /ASAN_OPTIONS
%preun -n asan-build-env
# Restore /etc/ld.so.preload
-mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
%package -n lsan-build-env
Summary: Lsan build environment
Lsan build environment
%post -n lsan-build-env
-# Add /usr/lib/liblsan.so to /etc/ld.so.preload
-mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
-echo "/usr/lib/liblsan.so" > /etc/ld.so.preload
-cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
-rm -f /etc/ld.so.preload.orig
+# Add /usr/lib64/liblsan.so to /etc/ld.so.preload
+[ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
+echo "%{libdir}/liblsan.so" > /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
%preun -n lsan-build-env
# Restore /etc/ld.so.preload
# Please submit bugfixes or comments via http://bugs.tizen.org/
#
-# we use %%{?macro: ... } as it is more compact
+# we use %%{?macro: ... } as it is more compact
%if 0%{?run_tests}
%define gcc_run_tests 1
%endif
%post -n asan-build-env
# Add /usr/lib/libasan.so to /etc/ld.so.preload
-mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
-echo "/usr/lib/libasan.so" > /etc/ld.so.preload
-cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
-rm -f /etc/ld.so.preload.orig
-echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1" > /ASAN_OPTIONS
+[ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
+echo "libasan.so" > /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
+echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0" > /ASAN_OPTIONS
%preun -n asan-build-env
# Restore /etc/ld.so.preload
-mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
%package -n lsan-build-env
Summary: Lsan build environment
Lsan build environment
%post -n lsan-build-env
-# Add /usr/lib/liblsan.so to /etc/ld.so.preload
-mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
-echo "/usr/lib/liblsan.so" > /etc/ld.so.preload
-cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
-rm -f /etc/ld.so.preload.orig
+# Add /usr/lib64/liblsan.so to /etc/ld.so.preload
+[ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
+echo "%{libdir}/liblsan.so" > /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
+[ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
%preun -n lsan-build-env
# Restore /etc/ld.so.preload