From 1359e4dbfecabab05500d06a8621919150a6dc38 Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Mon, 27 Aug 2018 12:29:59 +0300 Subject: [PATCH] Add gfortran acceleration Since Tizen now has packages which require Fortran compiler, we need to restore acceleration of Fortran compiler. Change-Id: Ia605a42737c8db997ed361712d9bf5d02d5fd50b Signed-off-by: Slava Barinov --- packaging/qemu-accel-aarch64.spec | 9 +++++---- packaging/qemu-accel-armv7hl.spec | 15 ++++++++------- packaging/qemu-accel-armv7l.spec | 9 +++++---- packaging/qemu-accel.spec.in | 9 +++++---- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index a9db760..6c2ebbb 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -40,6 +40,7 @@ Release: 0 AutoReqProv: off BuildRequires: gcc-%{cross} BuildRequires: binutils-%{cross} +BuildRequires: gcc-fortran #BuildRequires: expect BuildRequires: fdupes BuildRequires: gettext-runtime @@ -157,8 +158,8 @@ for executable in $LD \ %{_bindir}/xsltproc \ %{_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} \ - %{libdir}/gcc/%{target_arch}/${gcc_version}/{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so*} \ + %{_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} \ %{_bindir}/file \ %{_bindir}/icecc \ %{_bindir}/icerun \ @@ -368,7 +369,7 @@ cp %{_libdir}/python${python_version}/encodings/*.py %{buildroot}%{our_path}%{_l find %{buildroot} -name 'python*' | sed -e 's|%{buildroot}%{our_path}||' | tee -a python.list # rename gcc binaries -for bin in c++ g++ gcc +for bin in c++ g++ gcc gfortran do [ x"$sanitizer_enabled" == x"1" ] && bin+="-real" mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin @@ -400,7 +401,7 @@ do ln -sf %{our_path}%{_bindir}/${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 -for binary in cc1 cc1plus collect2 lto1 lto-wrapper +for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do ln -sf %{our_path}/usr/lib/gcc/%{target_arch}/${gcc_version}/${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 diff --git a/packaging/qemu-accel-armv7hl.spec b/packaging/qemu-accel-armv7hl.spec index 5d95ca9..3b4626d 100644 --- a/packaging/qemu-accel-armv7hl.spec +++ b/packaging/qemu-accel-armv7hl.spec @@ -40,6 +40,7 @@ Release: 0 AutoReqProv: off BuildRequires: gcc-%{cross} BuildRequires: binutils-%{cross} +BuildRequires: gcc-fortran #BuildRequires: expect BuildRequires: fdupes BuildRequires: gettext-runtime @@ -157,8 +158,8 @@ for executable in $LD \ %{_bindir}/xsltproc \ %{_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} \ - %{libdir}/gcc/%{target_arch}/${gcc_version}/{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so*} \ + %{_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} \ %{_bindir}/file \ %{_bindir}/icecc \ %{_bindir}/icerun \ @@ -368,7 +369,7 @@ cp %{_libdir}/python${python_version}/encodings/*.py %{buildroot}%{our_path}%{_l find %{buildroot} -name 'python*' | sed -e 's|%{buildroot}%{our_path}||' | tee -a python.list # rename gcc binaries -for bin in c++ g++ gcc +for bin in c++ g++ gcc gfortran do [ x"$sanitizer_enabled" == x"1" ] && bin+="-real" mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin @@ -400,7 +401,7 @@ do ln -sf %{our_path}%{_bindir}/${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 -for binary in cc1 cc1plus collect2 lto1 lto-wrapper +for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do ln -sf %{our_path}/usr/lib/gcc/%{target_arch}/${gcc_version}/${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 @@ -426,16 +427,16 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # Find gcc install directory gcc_install_dir=$(%{target_arch}-gcc -print-search-dirs | sed -ne '/install: /s/install: //p') # update baselibs.conf, overwrite LTO plugin -sed -i -e "s,#PLUGIN_POSTIN#,ln -sf %{our_path}${gcc_install_dir}/liblto_plugin.so %{libdir}/gcc/%{target_arch}/${gcc_version}/liblto_plugin.so," %{_sourcedir}/baselibs.conf +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 # Use /usr/lib for cross clang libdir on armv7l architecture %{?armv7l: -awk '/post "/ && !x {print $0; print " post \"echo export\\ CLANG_NO_LIBDIR_SUFFIX=1 >> /etc/profile\""; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf +awk '/post "/ && !x {print " post \"echo export\\ CLANG_NO_LIBDIR_SUFFIX=1 >> /etc/profile\""; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf } %{?multilib: -awk '/post "/ && !x {print $0; print " post \"echo '%{our_path}/lib' >> /etc/ld.so.conf\"\n"; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf +awk '/post "/ && !x {print " post \"echo '%{our_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf } # Remove the ld-$VERSION.so to prevent name clashing with native ld.so diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index 216e0ff..a399ec8 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -40,6 +40,7 @@ Release: 0 AutoReqProv: off BuildRequires: gcc-%{cross} BuildRequires: binutils-%{cross} +BuildRequires: gcc-fortran #BuildRequires: expect BuildRequires: fdupes BuildRequires: gettext-runtime @@ -157,8 +158,8 @@ for executable in $LD \ %{_bindir}/xsltproc \ %{_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} \ - %{libdir}/gcc/%{target_arch}/${gcc_version}/{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so*} \ + %{_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} \ %{_bindir}/file \ %{_bindir}/icecc \ %{_bindir}/icerun \ @@ -368,7 +369,7 @@ cp %{_libdir}/python${python_version}/encodings/*.py %{buildroot}%{our_path}%{_l find %{buildroot} -name 'python*' | sed -e 's|%{buildroot}%{our_path}||' | tee -a python.list # rename gcc binaries -for bin in c++ g++ gcc +for bin in c++ g++ gcc gfortran do [ x"$sanitizer_enabled" == x"1" ] && bin+="-real" mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin @@ -400,7 +401,7 @@ do ln -sf %{our_path}%{_bindir}/${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 -for binary in cc1 cc1plus collect2 lto1 lto-wrapper +for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do ln -sf %{our_path}/usr/lib/gcc/%{target_arch}/${gcc_version}/${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 diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index 2096e72..c3f9f98 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -37,6 +37,7 @@ Release: 0 AutoReqProv: off BuildRequires: gcc-%{cross} BuildRequires: binutils-%{cross} +BuildRequires: gcc-fortran #BuildRequires: expect BuildRequires: fdupes BuildRequires: gettext-runtime @@ -154,8 +155,8 @@ for executable in $LD \ %{_bindir}/xsltproc \ %{_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} \ - %{libdir}/gcc/%{target_arch}/${gcc_version}/{cc1,cc1plus,collect2,lto1,lto-wrapper,liblto_plugin.so*} \ + %{_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} \ %{_bindir}/file \ %{_bindir}/icecc \ %{_bindir}/icerun \ @@ -365,7 +366,7 @@ cp %{_libdir}/python${python_version}/encodings/*.py %{buildroot}%{our_path}%{_l find %{buildroot} -name 'python*' | sed -e 's|%{buildroot}%{our_path}||' | tee -a python.list # rename gcc binaries -for bin in c++ g++ gcc +for bin in c++ g++ gcc gfortran do [ x"$sanitizer_enabled" == x"1" ] && bin+="-real" mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}/%{our_path}%{_bindir}/$bin @@ -397,7 +398,7 @@ do ln -sf %{our_path}%{_bindir}/${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 -for binary in cc1 cc1plus collect2 lto1 lto-wrapper +for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do ln -sf %{our_path}/usr/lib/gcc/%{target_arch}/${gcc_version}/${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 -- 2.7.4