diff options
author | Slava Barinov <v.barinov@samsung.com> | 2016-05-11 14:10:38 +0300 |
---|---|---|
committer | Slava Barinov <v.barinov@samsung.com> | 2016-06-07 18:22:07 +0300 |
commit | 86591bb9ab591a70a6fdae0ab45671d5ed6dd510 (patch) | |
tree | 211298efac723cb241d5a0bb724d0a6fe9e06fbc | |
parent | 49c09d02db5394aecff9ea467e47eba00238bdeb (diff) | |
download | qemu-accel-86591bb9ab591a70a6fdae0ab45671d5ed6dd510.tar.gz qemu-accel-86591bb9ab591a70a6fdae0ab45671d5ed6dd510.tar.bz2 qemu-accel-86591bb9ab591a70a6fdae0ab45671d5ed6dd510.zip |
Add support for toolchain with sanitizers support
Since Tizen toolchain with sanitizers enabled uses {c++,g++,gcc}-real
files the acceleration is needed for them.
The check before 'objdump' added to prevent acceleration of shell
scripts since this is useless and the bash is already accelerated.
All sanitizer libraries (e.g. libasan.so) are packaged always since they
are needed for applying sanitizer to single package, not only the case
of sull project sanitization.
Change-Id: Iec1ca5f426f3354d442858b47381a3bca55ac440
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
-rw-r--r-- | packaging/qemu-accel-aarch64.spec | 21 | ||||
-rw-r--r-- | packaging/qemu-accel-armv7l.spec | 21 | ||||
-rw-r--r-- | packaging/qemu-accel.spec.in | 21 |
3 files changed, 60 insertions, 3 deletions
diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index 6d637d8..83db519 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -55,6 +55,7 @@ BuildRequires: python-xml BuildRequires: python-magic BuildRequires: python-rpm BuildRequires: file +BuildRequires: libasan Summary: Native binaries for speeding up cross compile License: GPL-2.0 Group: Development/Cross Compilation @@ -94,6 +95,12 @@ binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlo LD="/%{_lib}/ld-linux-x86-64.so.2" %endif +# Check if we use toolchain with sanitizers support +[ -f /usr/bin/gcc-force-options ] && sanitizer_enabled=1 +if [ x"$sanitizer_enabled" == x"1" ]; then + real_compiler=`find %{_bindir} -name '*-real' -printf '%{_bindir}/%%f '` +fi + for executable in $LD \ %{_bindir}/bash \ %{_bindir}/{rpm,rpm2cpio,rpmdb,rpmkeys,rpmqpack,rpmbuild,rpmsign,rpmspec} \ @@ -102,6 +109,7 @@ for executable in $LD \ %{_bindir}/{tar,gzip,bzip2,xz,xzdec} \ %{_bindir}/{grep,sed} \ %{_libdir}/libnssdbm3.so %{_libdir}/libsoftokn3.so %{_libdir}/libfreebl3.so \ + %{_libdir}/lib*san.so* \ %{_bindir}/{cat,expr,mkdir,mv,rm,rmdir} \ %{_bindir}/{msgexec,msgfmt,msgcat,msgmerge} \ %{_bindir}/make \ @@ -121,6 +129,7 @@ for executable in $LD \ %{_bindir}/%{target_arch}-{c++,g++,cpp,gcc,gcc-${gcc_version},gcc-ar,gcc-nm,gcc-ranlib,gcov} \ %{libdir}/gcc/%{target_arch}/${gcc_version}/{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so} \ %{_bindir}/file \ + ${real_compiler} \ %{_bindir}/{find,xargs,readlink,ls} do binaries="$binaries $executable `ldd $executable | sed -n 's,.*=> \(/[^ ]*\) .*,\1,p'`" @@ -139,6 +148,10 @@ echo "" for binary in $binaries do + # We don't need to accelerate shell scripts + filetype=`file --brief $binary` + [[ x"$filetype" == x"POSIX shell script"* ]] && continue + outfile=%{buildroot}/%{our_path}/$binary [ -f $outfile ] && continue mkdir -p ${outfile%/*} @@ -230,7 +243,13 @@ cp %{_libdir}/python${python_version}/encodings/*.py %{buildroot}%{our_path}%{_l # rename gcc binaries -for bin in c++ g++ cpp gcc gcc-ar gcc-nm gcc-ranlib +for bin in c++ g++ gcc +do + [ x"$sanitizer_enabled" == x"1" ] && bin+="-real" + mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin + ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin +done +for bin in cpp gcc-ar gcc-nm gcc-ranlib do mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index 8bcac10..12b1e49 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -55,6 +55,7 @@ BuildRequires: python-xml BuildRequires: python-magic BuildRequires: python-rpm BuildRequires: file +BuildRequires: libasan Summary: Native binaries for speeding up cross compile License: GPL-2.0 Group: Development/Cross Compilation @@ -94,6 +95,12 @@ binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlo LD="/%{_lib}/ld-linux-x86-64.so.2" %endif +# Check if we use toolchain with sanitizers support +[ -f /usr/bin/gcc-force-options ] && sanitizer_enabled=1 +if [ x"$sanitizer_enabled" == x"1" ]; then + real_compiler=`find %{_bindir} -name '*-real' -printf '%{_bindir}/%%f '` +fi + for executable in $LD \ %{_bindir}/bash \ %{_bindir}/{rpm,rpm2cpio,rpmdb,rpmkeys,rpmqpack,rpmbuild,rpmsign,rpmspec} \ @@ -102,6 +109,7 @@ for executable in $LD \ %{_bindir}/{tar,gzip,bzip2,xz,xzdec} \ %{_bindir}/{grep,sed} \ %{_libdir}/libnssdbm3.so %{_libdir}/libsoftokn3.so %{_libdir}/libfreebl3.so \ + %{_libdir}/lib*san.so* \ %{_bindir}/{cat,expr,mkdir,mv,rm,rmdir} \ %{_bindir}/{msgexec,msgfmt,msgcat,msgmerge} \ %{_bindir}/make \ @@ -121,6 +129,7 @@ for executable in $LD \ %{_bindir}/%{target_arch}-{c++,g++,cpp,gcc,gcc-${gcc_version},gcc-ar,gcc-nm,gcc-ranlib,gcov} \ %{libdir}/gcc/%{target_arch}/${gcc_version}/{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so} \ %{_bindir}/file \ + ${real_compiler} \ %{_bindir}/{find,xargs,readlink,ls} do binaries="$binaries $executable `ldd $executable | sed -n 's,.*=> \(/[^ ]*\) .*,\1,p'`" @@ -139,6 +148,10 @@ echo "" for binary in $binaries do + # We don't need to accelerate shell scripts + filetype=`file --brief $binary` + [[ x"$filetype" == x"POSIX shell script"* ]] && continue + outfile=%{buildroot}/%{our_path}/$binary [ -f $outfile ] && continue mkdir -p ${outfile%/*} @@ -230,7 +243,13 @@ cp %{_libdir}/python${python_version}/encodings/*.py %{buildroot}%{our_path}%{_l # rename gcc binaries -for bin in c++ g++ cpp gcc gcc-ar gcc-nm gcc-ranlib +for bin in c++ g++ gcc +do + [ x"$sanitizer_enabled" == x"1" ] && bin+="-real" + mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin + ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin +done +for bin in cpp gcc-ar gcc-nm gcc-ranlib do mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index 35cded6..fcfdfec 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -52,6 +52,7 @@ BuildRequires: python-xml BuildRequires: python-magic BuildRequires: python-rpm BuildRequires: file +BuildRequires: libasan Summary: Native binaries for speeding up cross compile License: GPL-2.0 Group: Development/Cross Compilation @@ -91,6 +92,12 @@ binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlo LD="/%{_lib}/ld-linux-x86-64.so.2" %endif +# Check if we use toolchain with sanitizers support +[ -f /usr/bin/gcc-force-options ] && sanitizer_enabled=1 +if [ x"$sanitizer_enabled" == x"1" ]; then + real_compiler=`find %{_bindir} -name '*-real' -printf '%{_bindir}/%%f '` +fi + for executable in $LD \ %{_bindir}/bash \ %{_bindir}/{rpm,rpm2cpio,rpmdb,rpmkeys,rpmqpack,rpmbuild,rpmsign,rpmspec} \ @@ -99,6 +106,7 @@ for executable in $LD \ %{_bindir}/{tar,gzip,bzip2,xz,xzdec} \ %{_bindir}/{grep,sed} \ %{_libdir}/libnssdbm3.so %{_libdir}/libsoftokn3.so %{_libdir}/libfreebl3.so \ + %{_libdir}/lib*san.so* \ %{_bindir}/{cat,expr,mkdir,mv,rm,rmdir} \ %{_bindir}/{msgexec,msgfmt,msgcat,msgmerge} \ %{_bindir}/make \ @@ -118,6 +126,7 @@ for executable in $LD \ %{_bindir}/%{target_arch}-{c++,g++,cpp,gcc,gcc-${gcc_version},gcc-ar,gcc-nm,gcc-ranlib,gcov} \ %{libdir}/gcc/%{target_arch}/${gcc_version}/{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so} \ %{_bindir}/file \ + ${real_compiler} \ %{_bindir}/{find,xargs,readlink,ls} do binaries="$binaries $executable `ldd $executable | sed -n 's,.*=> \(/[^ ]*\) .*,\1,p'`" @@ -136,6 +145,10 @@ echo "" for binary in $binaries do + # We don't need to accelerate shell scripts + filetype=`file --brief $binary` + [[ x"$filetype" == x"POSIX shell script"* ]] && continue + outfile=%{buildroot}/%{our_path}/$binary [ -f $outfile ] && continue mkdir -p ${outfile%/*} @@ -227,7 +240,13 @@ cp %{_libdir}/python${python_version}/encodings/*.py %{buildroot}%{our_path}%{_l # rename gcc binaries -for bin in c++ g++ cpp gcc gcc-ar gcc-nm gcc-ranlib +for bin in c++ g++ gcc +do + [ x"$sanitizer_enabled" == x"1" ] && bin+="-real" + mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin + ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin +done +for bin in cpp gcc-ar gcc-nm gcc-ranlib do mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin |