[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

updated cross-gcc rpm



[sorry for the dups, third try w/ fedora-devel-list subscribed]

Hi Lennert,

Referring to your post at
http://www.redhat.com/archives/fedora-devel-list/2007-October/msg00045.html

Thanks a lot for posting those rpms.  I was able to use those with
--define='cross_target ia64-linux-gnu' to build a cross-compiler that
builds xen-unstable.hg including the userland tools.  I posted that
information today to the xen-devel mailing list, see
http://lists.xensource.com/archives/html/xen-devel/2008-01/msg01105.html

I had to make some changes, first to build the gcc rpm successfully on
x86_64 targetting ia64, and second to include some files that were
missing.  The missing files were due to %ifarch tests which were
looking at the build arch instead of the target arch.  I came up with
a solution for that... though I wouldn't be surprised if you're able
to come up with something more elegant.

The patch is below.  Thanks again for your work which enabled me to
get this running.

Aron

diff -r 8c95cc711df2 SPECS/gcc41.spec
--- a/SPECS/gcc41.spec	Fri Jan 18 08:51:45 2008 -0500
+++ b/SPECS/gcc41.spec	Wed Jan 30 02:56:35 2008 +0000
@@ -1,8 +1,10 @@
 %if "%{?cross_target}" == ""
 %define gcc_target %{_target_platform}
+%define target_arch %{_arch}
 %define isnative 1
 %else
 %define gcc_target %{cross_target}
+%define target_arch %{expand:%%(echo "%{cross_target}" | sed 's/-.*//')}
 %define isnative 0
 %define cross %{gcc_target}-
 %define crosspost -%{gcc_target}
@@ -12,6 +14,8 @@
 %define __find_requires %{nil}
 %define __find_provides %{nil}
 %endif
+
+%define inlist() %{expand:%%(case '%* ' in (%{1}*' '%1' '*) echo 1 ;; (*) echo 0 ;; esac)}
 
 %define DATE 20070925
 %define gcc_version 4.1.2
@@ -1234,6 +1238,7 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/%{_lib}/
 rm -f $RPM_BUILD_ROOT%{_prefix}/%{_lib}/{libffi*,libiberty.a}
 rm -f $RPM_BUILD_ROOT%{_prefix}/%{gcc_target_platform}/%{_lib}/{libffi*,libiberty.a}
 rm -f $FULLEPATH/install-tools/{mkheaders,fixincl}
+rm -f $FULLPATH/install-tools/mkheaders.conf
 rm -f $RPM_BUILD_ROOT%{_prefix}/lib/{32,64}/libiberty.a
 rm -f $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libssp*
 rm -f $FULLPATH/libssp*
@@ -1428,8 +1433,7 @@ fi
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/syslimits.h
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/unwind.h
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/omp.h
-%if %{isnative}
-%ifarch %{ix86} x86_64
+%if %{inlist %{target_arch} %{ix86} x86_64}
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/mmintrin.h
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/xmmintrin.h
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/emmintrin.h
@@ -1439,14 +1443,13 @@ fi
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/mm_malloc.h
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/mm3dnow.h
 %endif
-%ifarch ia64
+%if %{inlist %{target_arch} ia64}
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/ia64intrin.h
 %endif
-%ifarch ppc ppc64
+%if %{inlist %{target_arch} ppc ppc64}
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/ppc-asm.h
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/altivec.h
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/spe.h
-%endif
 %endif
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/include/README
 %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/collect2
@@ -1458,8 +1461,7 @@ fi
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/libgomp.spec
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/libgomp.a
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/libgomp.so
-%if %{isnative}
-%ifarch sparc ppc
+%if %{inlist %{target_arch} sparc ppc}
 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/64
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/64/crt*.o
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/64/libgcc.a
@@ -1473,7 +1475,7 @@ fi
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/64/libmudflap.so
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/64/libmudflapth.so
 %endif
-%ifarch %{multilib_64_archs}
+%if %{inlist %{target_arch} %{multilib_64_archs}}
 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/32
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/32/crt*.o
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/32/libgcc.a
@@ -1487,12 +1489,13 @@ fi
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/32/libmudflap.so
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/32/libmudflapth.so
 %endif
-%ifarch sparc sparc64 ppc ppc64
+%if %{inlist %{target_arch} sparc sparc64 ppc ppc64}
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/libmudflap.a
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/libmudflapth.a
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/libmudflap.so
 %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_version}/libmudflapth.so
 %endif
+%if %{isnative}
 %dir %{_prefix}/libexec/getconf
 %{_prefix}/libexec/getconf/default
 %endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]