packaging: Force options for native compiler only 55/143555/2
authorSlava Barinov <v.barinov@samsung.com>
Thu, 10 Aug 2017 08:05:46 +0000 (11:05 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Wed, 30 Aug 2017 00:43:32 +0000 (00:43 +0000)
If both native and cross-compiler are installed (e. g. in qemu-accel build) the
gcc-force-options should only accelerate native compiler in order to keep
gcc-unforce-options work.

Change-Id: I1454fb199e6f849b89f7b16129e005894d800cbc
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
packaging/gcc-aarch64.spec
packaging/gcc-armv7l.spec
packaging/gcc-force-options
packaging/linaro-gcc.spec

index cbc4015..70ca3d8 100644 (file)
@@ -1027,6 +1027,8 @@ rm -rf %{buildroot}/%{libsubdir}/include
 }
 
 %{!?cross:
+sed -e 's|GCC_LIBSUBDIR|%{libsubdir}|' -i %{SOURCE15}
+
 cp %{SOURCE15} %{SOURCE16} %{SOURCE18} %{buildroot}%{_prefix}/bin
 chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options
 chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options
index 0ff3c08..eb63ff1 100644 (file)
@@ -1027,6 +1027,8 @@ rm -rf %{buildroot}/%{libsubdir}/include
 }
 
 %{!?cross:
+sed -e 's|GCC_LIBSUBDIR|%{libsubdir}|' -i %{SOURCE15}
+
 cp %{SOURCE15} %{SOURCE16} %{SOURCE18} %{buildroot}%{_prefix}/bin
 chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options
 chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options
index 0dfdd9a..5813d78 100644 (file)
@@ -113,7 +113,7 @@ fi
 EOF
 chmod +x $LD_TMP
 
-find -L /usr/*/gcc -type f -a -perm -a=x -name 'collect2' | while read tool; do
+find -L GCC_LIBSUBDIR -type f -a -perm -a=x -name 'collect2' | while read tool; do
        mv $tool $tool-real
        cp $LD_TMP $tool
 done
index e3f41f3..53077f6 100644 (file)
@@ -1024,6 +1024,8 @@ rm -rf %{buildroot}/%{libsubdir}/include
 }
 
 %{!?cross:
+sed -e 's|GCC_LIBSUBDIR|%{libsubdir}|' -i %{SOURCE15}
+
 cp %{SOURCE15} %{SOURCE16} %{SOURCE18} %{buildroot}%{_prefix}/bin
 chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options
 chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options