From 3db2e874cd87a4b0fa1c2a4addb9123b8dbba549 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-20090813.tar.bz2 |  Bin 0 -> 5113178 bytes
 glibc.spec                   |   27 ++++++++++++++++++++++++---
 2 files changed, 24 insertions(+), 3 deletions(-)
 create mode 100644 glibc-ports-20090813.tar.bz2

diff --git a/glibc-ports-20090813.tar.bz2 b/glibc-ports-20090813.tar.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..b56402cfabc58f0d35866c354d4b11291e589335
GIT binary patch
diff --git a/glibc.spec b/glibc.spec
index b2b2f35..e069729 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1,5 +1,6 @@
 %define glibcsrcdir glibc-2.10-221-ge73e694
 %define glibcversion 2.10.90
+%define glibcportsdate 20090813
 ### glibc.spec.in follows:
 %define run_glibc_tests 1
 %define auxarches athlon sparcv9v sparc64v alphaev6
@@ -16,6 +17,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
@@ -24,7 +26,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 10
+Release: 10.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
@@ -41,6 +43,7 @@ Source1: %{glibc_release_url}%{glibc_libidn_srcdir}.tar.bz2
 %define glibc_release_setup mv %{glibc_libidn_srcdir} libidn
 %endif
 Source2: %{glibcsrcdir}-fedora.tar.bz2
+Source3: glibc-ports-%{glibcportsdate}.tar.bz2
 Patch0: %{name}-fedora.patch
 Patch1: %{name}-ia64-lib64.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -238,7 +241,8 @@ package or when debugging this package.
 %endif
 
 %prep
-%setup -q -n %{glibcsrcdir} %{?glibc_release_unpack} -b2
+%setup -q -n %{glibcsrcdir} %{?glibc_release_unpack} -b2 -a3
+mv glibc-ports-%{glibcportsdate} ports
 %{?glibc_release_setup}
 %patch0 -E -p1
 %ifarch ia64
@@ -317,6 +321,7 @@ GCC="gcc -m64"
 GXX="g++ -m64"
 %endif
 
+%ifnarch %{arm}
 BuildFlags="$BuildFlags -fasynchronous-unwind-tables"
 # Add -DNDEBUG unless using a prerelease
 case %{version} in
@@ -325,6 +330,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'`
@@ -332,6 +339,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
@@ -343,8 +355,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
@@ -1037,6 +1055,9 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Thu Aug 13 2009 Jitesh Shah <jiteshs@marvell.com> - 2.10.90-10
+- Add glibc ports and enable building for arm*-redhat-linux-gnueabi
+
 * Tue Jul 28 2009 Andreas Schwab <schwab@redhat.com> - 2.10.90-10
 - Update from master.
   * fix memory ordering in pthread_mutex_unlock (BZ#10418)
-- 
1.5.5.6

