summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonghee Han <onstudy@samsung.com>2016-06-07 16:23:53 -0700
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2016-06-07 16:23:53 -0700
commit51699202ffcd20f38654ffc0e31a8a25c8d7cb69 (patch)
treef8e952830ea39a24c5d99638c1d881094435f9e5
parentfcef71d9dc29398d4ba468247aecb8c7a55edc70 (diff)
parent86591bb9ab591a70a6fdae0ab45671d5ed6dd510 (diff)
downloadqemu-accel-51699202ffcd20f38654ffc0e31a8a25c8d7cb69.tar.gz
qemu-accel-51699202ffcd20f38654ffc0e31a8a25c8d7cb69.tar.bz2
qemu-accel-51699202ffcd20f38654ffc0e31a8a25c8d7cb69.zip
Merge "Add support for toolchain with sanitizers support" into tizen_basesubmit/tizen_base/20160608.005905accepted/tizen/base/20160608.180438
-rw-r--r--packaging/qemu-accel-aarch64.spec21
-rw-r--r--packaging/qemu-accel-armv7l.spec21
-rw-r--r--packaging/qemu-accel.spec.in21
3 files changed, 60 insertions, 3 deletions
diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec
index 2a6e077..366311c 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
[ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && continue
[ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && continue
@@ -231,7 +244,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 fb957db..6c3100f 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
[ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && continue
[ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && continue
@@ -231,7 +244,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 0a71b82..ee546d6 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
[ ! -e $binary ] && echo "WARNING: File '${binary}' not found, ignoring" && continue
[ -f $outfile ] && echo "WARNING: File '${outfile}' exists, ignoring" && continue
@@ -228,7 +241,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