From 5943db214ee3c5066921c58f2f204899a3022884 Mon Sep 17 00:00:00 2001
From: Jitesh Shah <jiteshs@marvell.com>
Date: Thu, 13 Aug 2009 15:08:40 +0200
Subject: [PATCH] * Add glibc ports for ARM * Add support for arm*-redhat-linux-gnueabi

Signed-off-by: Jitesh Shah <jiteshs@marvell.com>
---
 glibc-ports-20091110.tar.bz2 |  Bin 0 -> 604926 bytes
 glibc.spec                   |   27 ++++++++++++++++++++++++---
 2 files changed, 24 insertions(+), 3 deletions(-)
 create mode 100644 glibc-ports-20091110.tar.bz2

diff --git a/glibc-ports-20091110.tar.bz2 b/glibc-ports-20091110.tar.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..a10475ec12546d8d8d0004634cd9bd4b851f73f5
GIT binary patch
diff --git a/glibc.spec b/glibc.spec
index 8ee8834..a9bed61 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1,6 +1,7 @@
 %define glibcsrcdir glibc-2.11
 %define glibc_release_url ftp://sources.redhat.com/pub/glibc/releases/
 %define glibcversion 2.11
+%define glibcportsdate 20091110
 ### glibc.spec.in follows:
 %define run_glibc_tests 1
 %define auxarches athlon sparcv9v sparc64v alphaev6
@@ -17,6 +18,7 @@
 %else
 %define buildpower6 0
 %endif
+%define portsarches %{arm}
 %define rtkaioarches %{ix86} x86_64 ia64 ppc ppc64 s390 s390x
 %define debuginfocommonarches alpha alphaev6 sparc sparcv9 sparcv9v sparc64 sparc64v
 %define multiarcharches %{ix86} x86_64
@@ -25,7 +27,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 2
+Release: 2.fa1
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -36,6 +38,7 @@ Group: System Environment/Libraries
 URL: http://sources.redhat.com/glibc/
 Source0: %{?glibc_release_url}%{glibcsrcdir}.tar.bz2
 Source1: %{glibcsrcdir}-fedora.tar.bz2
+Source2: glibc-ports-%{glibcportsdate}.tar.bz2
 Patch0: %{name}-fedora.patch
 Patch1: %{name}-ia64-lib64.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -236,7 +239,8 @@ package or when debugging this package.
 %endif
 
 %prep
-%setup -q -n %{glibcsrcdir} -b1
+%setup -q -n %{glibcsrcdir} %{?glibc_release_unpack} -b1 -a2
+mv glibc-ports-%{glibcportsdate} ports
 %patch0 -E -p1
 %ifarch ia64
 %if "%{_lib}" == "lib64"
@@ -314,6 +318,7 @@ GCC="gcc -m64"
 GXX="g++ -m64"
 %endif
 
+%ifnarch %{arm}
 BuildFlags="$BuildFlags -fasynchronous-unwind-tables"
 # Add -DNDEBUG unless using a prerelease
 case %{version} in
@@ -322,6 +327,8 @@ case %{version} in
      BuildFlags="$BuildFlags -DNDEBUG"
      ;;
 esac
+%endif
+
 EnableKernel="--enable-kernel=%{enablekernel}"
 echo "$GCC" > Gcc
 AddOns=`echo */configure | sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\|powerpc-cpu\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d'`
@@ -329,6 +336,11 @@ AddOns=`echo */configure | sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkai
 AddOns=,rtkaio$AddOns
 %endif
 
+%ifarch %{portsarches}
+AddOns=,ports$AddOns
+%endif
+
+
 build_nptl()
 {
 builddir=build-%{nptl_target_cpu}-$1
@@ -340,8 +352,14 @@ build_CFLAGS="$BuildFlags -g -O3 $*"
 	--prefix=%{_prefix} \
 	--enable-add-ons=nptl$AddOns --without-cvs $EnableKernel \
 	--with-headers=%{_prefix}/include --enable-bind-now \
-	--with-tls --with-__thread --build %{nptl_target_cpu}-redhat-linux \
+	--with-tls --with-__thread \
+%ifnarch %{arm}
+	--build %{nptl_target_cpu}-redhat-linux \
 	--host %{nptl_target_cpu}-redhat-linux \
+%else
+        --build %{nptl_target_cpu}-redhat-linux-gnueabi \
+        --host %{nptl_target_cpu}-redhat-linux-gnueabi \
+%endif
 %ifarch %{multiarcharches}
 	--enable-multi-arch \
 %endif
@@ -1029,6 +1047,9 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Tue Nov 10 2009 Jitesh Shah <jiteshs@marvell.com> - 2.11-2.fa1
+- Add glibc ports and enable building for arm*-redhat-linux-gnueabi
+
 * Thu Nov  5 2009 Andreas Schwab <schwab@redhat.com> - 2.11-2
 - Fix readahead on powerpc32.
 - Fix R_PPC64_{JMP_IREL,IRELATIVE} handling.
-- 
1.5.5.6

