#
# MUST SEE:
-# GCC ARM Improvement Project - http://www.inf.u-szeged.hu/gcc-arm/
+# - GCC ARM Improvement Project - http://www.inf.u-szeged.hu/gcc-arm/
+# - Developing StrongARM shellocde - http://phrack.org/show.php?p=58&a=10
+#
+# Conditional build:
+%bcond_with eabi # build with Embedded ABI support
#
Summary: Cross ARM GNU binary utility development utilities - gcc
Summary(es): Utilitarios para desarrollo de binarios de la GNU - ARM gcc
Summary(pl): Skro¶ne narzêdzia programistyczne GNU dla ARM - gcc
Summary(pt_BR): Utilitários para desenvolvimento de binários da GNU - ARM gcc
Summary(tr): GNU geliþtirme araçlarý - ARM gcc
-Name: crossarm-gcc
-Version: 3.4.3
-Release: 1.1
+Version: 4.0.1
+%define _snap 20050507
+Release: 0.%{_snap}.1
Epoch: 1
License: GPL
Group: Development/Languages
-Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
-# Source0-md5: e744b30c834360fccac41eb7269a3011
-%define _llh_ver 2.6.9.1
+#Source0: ftp://gcc.gnu.org/pub/gcc/releases/gcc-%{version}/gcc-%{version}.tar.bz2
+Source0: ftp://gcc.gnu.org/pub/gcc/snapshots/4.0-%{_snap}/gcc-4.0-%{_snap}.tar.bz2
+# Source0-md5: 701f385de867d117f3648165174b254a
+%define _llh_ver 2.6.11.2
Source1: http://ep09.pld-linux.org/~mmazur/linux-libc-headers/linux-libc-headers-%{_llh_ver}.tar.bz2
-# Source1-md5: d3507b2c0203a0760a677022badcf455
-Source2: glibc-20041030.tar.bz2
-# Source2-md5: 4e14871efd881fbbf523a0ba16175bc7
-Patch0: %{name}-pr15068.patch
-BuildRequires: crossarm-binutils
-BuildRequires: flex
-BuildRequires: bison
+# Source1-md5: 2d21d8e7ff641da74272b114c786464e
+%define _uclibc_ver 0.9.27
+Source2: http://uclibc.org/downloads/uClibc-%{_uclibc_ver}.tar.bz2
+# Source2-md5: 6250bd6524283bd8e7bc976d43a46ec0
+Source3: crossarm-embedded-uclibc.config
+URL: http://gcc.gnu.org/
BuildRequires: autoconf
-BuildRequires: /bin/bash
-Requires: crossarm-binutils
+BuildRequires: automake
+BuildRequires: bison
+BuildRequires: crossarm-binutils%{?with_eabi:(eabi)}
+BuildRequires: flex
+BuildRequires: kernel-module-build
+Requires: crossarm-binutils%{?with_eabi:(eabi)}
Requires: gcc-dirs
ExcludeArch: arm
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define target arm-pld-linux
+%define target arm-linux%{?with_eabi:-eabi}
%define arch %{_prefix}/%{target}
%define gccarch %{_libdir}/gcc/%{target}
%define gcclib %{gccarch}/%{version}
-%define _noautostrip .*%{gcclib}.*/libgc.*\\.a
+%define _noautostrip .*/libgc.*\\.a
%description
This package contains a cross-gcc which allows the creation of
arm-linux).
%package c++
-Summary: C++ support for crossppc-arm
-Summary(pl): Obs³uga C++ dla crossppc-arm
+Summary: C++ support for crossarm-gcc
+Summary(pl): Obs³uga C++ dla crossarm-gcc
Group: Development/Languages
Requires: %{name} = %{epoch}:%{version}-%{release}
Ten pakiet dodaje obs³ugê C++ do kompilatora gcc dla ARM.
%prep
-%setup -q -n gcc-%{version} -a1 -a2
-%patch0 -p1
+#setup -q -n gcc-%{version} -a1 -a2
+%setup -q -n gcc-4.0-%{_snap} -a1 -a2
%build
FAKE_ROOT=$PWD/fake-root
+rm -rf $FAKE_ROOT
-rm -rf $FAKE_ROOT && install -d $FAKE_ROOT/usr/include
-cp -r linux-libc-headers-%{_llh_ver}/include/{asm-arm,linux} $FAKE_ROOT/usr/include
-ln -s asm-arm $FAKE_ROOT/usr/include/asm
-
-cd libc
-rm -rf builddir && install -d builddir && cd builddir
-../configure \
- --prefix=$FAKE_ROOT/usr \
- --build=%{_target_platform} \
- --host=%{target} \
- --disable-nls \
- --with-headers=$FAKE_ROOT/usr/include \
- --disable-sanity-checks \
- --enable-hacker-mode
-
-%{__make} sysdeps/gnu/errlist.c
-%{__make} install-headers
-
-install bits/stdio_lim.h $FAKE_ROOT/usr/include/bits
-touch $FAKE_ROOT/usr/include/gnu/stubs.h
-cd ../..
+install -d $FAKE_ROOT%{_prefix}
+cp -r uClibc-%{_uclibc_ver}/* $FAKE_ROOT%{_prefix}
+cd $FAKE_ROOT%{_prefix}
+install %{SOURCE3} .config
+%{__make} headers
+cd -
+cp -f /usr/share/automake/config.* .
rm -rf obj-%{target}
install -d obj-%{target}
cd obj-%{target}
CFLAGS="%{rpmcflags}" \
-CXXFLAGS="%{rpmcflags}" \
+CXXFLAGS="%{rpmcxxflags}" \
TEXCONFIG=false \
../configure \
--prefix=%{_prefix} \
- --with-sysroot=$FAKE_ROOT \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
--bindir=%{_bindir} \
--disable-threads \
--enable-languages="c,c++" \
--enable-c99 \
+ --enable-long-long \
+ --disable-nls \
--with-gnu-as \
--with-gnu-ld \
+ --with-demangler-in-ld \
--with-system-zlib \
- --with-multilib \
+ --enable-multilib \
--with-sysroot=$FAKE_ROOT \
--without-x \
--target=%{target} \
%{__make} -C obj-%{target} install-gcc \
DESTDIR=$RPM_BUILD_ROOT
+install obj-%{target}/gcc/specs $RPM_BUILD_ROOT%{gcclib}
+
# don't want this here
rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a
+# include/ contains install-tools/include/* and headers that were fixed up
+# by fixincludes, we don't want former
+gccdir=$(echo $RPM_BUILD_ROOT%{_libdir}/gcc/*/*/)
+mkdir $gccdir/tmp
+# we have to save these however
+#{?with_java:mv -f $gccdir/include/{gcj,libffi/ffitarget.h} $gccdir/tmp}
+mv -f $gccdir/include/syslimits.h $gccdir/tmp
+rm -rf $gccdir/include
+mv -f $gccdir/tmp $gccdir/include
+cp -f $gccdir/install-tools/include/*.h $gccdir/include
+# but we don't want anything more from install-tools
+rm -rf $gccdir/install-tools
+
%if 0%{!?debug:1}
%{target}-strip -g $RPM_BUILD_ROOT%{gcclib}/libgcc.a
%{target}-strip -g $RPM_BUILD_ROOT%{gcclib}/libgcov.a
%attr(755,root,root) %{_bindir}/%{target}-gcc
%dir %{gccarch}
%dir %{gcclib}
+%{?with_eabi:%dir %{gcclib}/thumb}
%attr(755,root,root) %{gcclib}/cc1
%attr(755,root,root) %{gcclib}/collect2
%{gcclib}/crt*.o
%{gcclib}/libgcc.a
+%if %{with eabi}
+%{gcclib}/thumb/crt*.o
+%{gcclib}/thumb/libgcc.a
+%endif
%{gcclib}/specs*
%dir %{gcclib}/include
%{gcclib}/include/*.h