From 8f6857b2f090110f46fb07fe6a9a98cc014e6851 Mon Sep 17 00:00:00 2001 From: Andrey Kazmin Date: Wed, 10 Mar 2021 10:38:18 +0300 Subject: Changed permissions in /emul dir for ASan/HWASan-force-options related stuff Moved from *-force-options packages to prevent broken dependency, when qemu-accel was re-installed after *-force-options post-install script was finished. Change-Id: I96f87bfae75d98e9460dd4c9a5cd47912e9aa186 Signed-off-by: Andrey Kazmin --- packaging/qemu-accel-aarch64.spec | 10 ++++++++-- packaging/qemu-accel-armv7hl.spec | 10 ++++++++-- packaging/qemu-accel-armv7l.spec | 10 ++++++++-- packaging/qemu-accel.spec.in | 10 ++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index 3531b4c..2d0ebd6 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -164,7 +164,7 @@ fi %prep %build -%if 0%{?asan} || 0%{?ubsan} +%if 0%{?asan} || 0%{?ubsan} || 0%{?hwasan} %gcc_unforce_options %endif @@ -532,7 +532,13 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # By default this is ${gcc_install_dir}/liblto_plugin.so target_liblto_plugin="$(%{target_arch}-gcc -print-file-name=liblto_plugin.so)" # update baselibs.conf, overwrite LTO plugin -sed -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," -i %{_sourcedir}/baselibs.conf + +sed -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi#PLUGIN_POSTIN_SAN#," -i %{_sourcedir}/baselibs.conf +%if 0%{?asan} || 0%{?hwasan_build} +sed -e "s,#PLUGIN_POSTIN_SAN#,\"\n post \"chmod a+w /emul/usr/bin/ \&\& chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-*/obj/gcc/ \&\& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a+w," -i %{_sourcedir}/baselibs.conf +%else +sed -e "s,#PLUGIN_POSTIN_SAN#,," -i %{_sourcedir}/baselibs.conf +%endif sed -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," -i %{_sourcedir}/baselibs.conf # Add support of gcc-unforce-options for baselibs-generated packages diff --git a/packaging/qemu-accel-armv7hl.spec b/packaging/qemu-accel-armv7hl.spec index a5d2bc3..17a5b44 100644 --- a/packaging/qemu-accel-armv7hl.spec +++ b/packaging/qemu-accel-armv7hl.spec @@ -164,7 +164,7 @@ fi %prep %build -%if 0%{?asan} || 0%{?ubsan} +%if 0%{?asan} || 0%{?ubsan} || 0%{?hwasan} %gcc_unforce_options %endif @@ -532,7 +532,13 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # By default this is ${gcc_install_dir}/liblto_plugin.so target_liblto_plugin="$(%{target_arch}-gcc -print-file-name=liblto_plugin.so)" # update baselibs.conf, overwrite LTO plugin -sed -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," -i %{_sourcedir}/baselibs.conf + +sed -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi#PLUGIN_POSTIN_SAN#," -i %{_sourcedir}/baselibs.conf +%if 0%{?asan} || 0%{?hwasan_build} +sed -e "s,#PLUGIN_POSTIN_SAN#,\"\n post \"chmod a+w /emul/usr/bin/ \&\& chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-*/obj/gcc/ \&\& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a+w," -i %{_sourcedir}/baselibs.conf +%else +sed -e "s,#PLUGIN_POSTIN_SAN#,," -i %{_sourcedir}/baselibs.conf +%endif sed -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," -i %{_sourcedir}/baselibs.conf # Add support of gcc-unforce-options for baselibs-generated packages diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index 33fb131..eee28f1 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -164,7 +164,7 @@ fi %prep %build -%if 0%{?asan} || 0%{?ubsan} +%if 0%{?asan} || 0%{?ubsan} || 0%{?hwasan} %gcc_unforce_options %endif @@ -532,7 +532,13 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # By default this is ${gcc_install_dir}/liblto_plugin.so target_liblto_plugin="$(%{target_arch}-gcc -print-file-name=liblto_plugin.so)" # update baselibs.conf, overwrite LTO plugin -sed -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," -i %{_sourcedir}/baselibs.conf + +sed -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi#PLUGIN_POSTIN_SAN#," -i %{_sourcedir}/baselibs.conf +%if 0%{?asan} || 0%{?hwasan_build} +sed -e "s,#PLUGIN_POSTIN_SAN#,\"\n post \"chmod a+w /emul/usr/bin/ \&\& chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-*/obj/gcc/ \&\& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a+w," -i %{_sourcedir}/baselibs.conf +%else +sed -e "s,#PLUGIN_POSTIN_SAN#,," -i %{_sourcedir}/baselibs.conf +%endif sed -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," -i %{_sourcedir}/baselibs.conf # Add support of gcc-unforce-options for baselibs-generated packages diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index 9fde2d6..2d9bec4 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -161,7 +161,7 @@ fi %prep %build -%if 0%{?asan} || 0%{?ubsan} +%if 0%{?asan} || 0%{?ubsan} || 0%{?hwasan} %gcc_unforce_options %endif @@ -529,7 +529,13 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # By default this is ${gcc_install_dir}/liblto_plugin.so target_liblto_plugin="$(%{target_arch}-gcc -print-file-name=liblto_plugin.so)" # update baselibs.conf, overwrite LTO plugin -sed -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," -i %{_sourcedir}/baselibs.conf + +sed -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi#PLUGIN_POSTIN_SAN#," -i %{_sourcedir}/baselibs.conf +%if 0%{?asan} || 0%{?hwasan_build} +sed -e "s,#PLUGIN_POSTIN_SAN#,\"\n post \"chmod a+w /emul/usr/bin/ \&\& chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-*/obj/gcc/ \&\& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a+w," -i %{_sourcedir}/baselibs.conf +%else +sed -e "s,#PLUGIN_POSTIN_SAN#,," -i %{_sourcedir}/baselibs.conf +%endif sed -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," -i %{_sourcedir}/baselibs.conf # Add support of gcc-unforce-options for baselibs-generated packages -- cgit v1.2.3