diff options
Diffstat (limited to 'packaging/qemu-accel-armv7hl.spec')
-rw-r--r-- | packaging/qemu-accel-armv7hl.spec | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/packaging/qemu-accel-armv7hl.spec b/packaging/qemu-accel-armv7hl.spec index 212db5b..163e68e 100644 --- a/packaging/qemu-accel-armv7hl.spec +++ b/packaging/qemu-accel-armv7hl.spec @@ -117,7 +117,13 @@ This package is used in qemu-accel to accelerate clang compiler. %install set +x +# gcc version major.minor.patch gcc_version=`gcc --version | sed -ne '1s/[^0-9]*\(\([0-9]\.\?\)*\).*/\1/p'` +# Find cross-gcc install directory, like: +# - /usr/lib/gcc/armv7l-tizen-linux-gnueabi/6.2.1/ for armv7l, +# - /usr/lib64/gcc/aarch64-tizen-linux-gnu/6.2.1/ for aarch64 +gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" + # just like it is determided in python.spec python_version=`python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3` @@ -157,7 +163,7 @@ for executable in $LD \ %{_bindir}/{ccmake,cmake,cpack,ctest} \ %{_bindir}/%{target_arch}-{addr2line,ar,as,c++filt,dwp,elfedit,gprof,ld,ld.bfd,ld.gold,nm,objcopy,objdump,ranlib,readelf,size,strings,strip} \ %{_bindir}/%{target_arch}-{c++,g++,cpp,gcc,gcc-${gcc_version},gcc-ar,gcc-nm,gcc-ranlib,gcov,gfortran} \ - %{libdir}/gcc/%{target_arch}/${gcc_version}/{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so*,f951} \ + ${gcc_install_dir}{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so*,f951} \ %{_bindir}/file \ %{_bindir}/icecc \ %{_bindir}/icerun \ @@ -279,7 +285,7 @@ ln -sf %{our_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_ echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list # create symlinks for libgcc-32bit -# libgcc-32bit library is placed under %{_libdir}/gcc/%{target_arch}/${gcc_version}/32/ not just /lib for 32bit +# libgcc-32bit library is placed under ${gcc_install_dir}32/ not just /lib for 32bit for f in $(rpm -ql libgcc-32bit) do filename=$(basename $f) @@ -393,7 +399,7 @@ do done for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do - ln -sf %{our_path}%{libdir}/gcc/%{target_arch}/${gcc_version}/${binary} %{buildroot}%{our_path}/home/abuild/rpmbuild/BUILD/gcc-${gcc_version}/obj/gcc/${binary} + ln -sf %{our_path}${gcc_install_dir}${binary} %{buildroot}%{our_path}/home/abuild/rpmbuild/BUILD/gcc-${gcc_version}/obj/gcc/${binary} echo "%{our_path}/home/abuild/rpmbuild/BUILD/gcc-${gcc_version}/obj/gcc/${binary}" >> %{_sourcedir}/all-accel.list done ln -sf %{our_path}%{_bindir}/gcc %{buildroot}%{our_path}/home/abuild/rpmbuild/BUILD/gcc-${gcc_version}/obj/gcc/xgcc @@ -414,11 +420,11 @@ arch x86_64 targets %{cross}:x86_64-%{cross} EOF cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/baselibs.conf -# Find gcc install directory -gcc_install_dir=$(%{target_arch}-gcc -print-search-dirs | sed -ne '/install: /s/install: //p') +# 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 -i -e "s,#PLUGIN_POSTIN#,if [ -d %{libdir}/gcc/%{target_arch}/${gcc_version} ]; then\"\n post \" ln -sf %{our_path}${gcc_install_dir}/liblto_plugin.so %{libdir}/gcc/%{target_arch}/${gcc_version}/liblto_plugin.so\"\n post \"fi," %{_sourcedir}/baselibs.conf -sed -i -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${gcc_install_dir}/liblto_plugin.so," %{_sourcedir}/baselibs.conf +sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{our_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf +sed -i -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," %{_sourcedir}/baselibs.conf # Use /usr/lib for cross clang libdir on armv7l architecture %{?armv7l: |