rpms/arm-gp2x-linux-glibc/FC-6 README.fedora, NONE, 1.1 arm-ctl_bus_isa.patch, NONE, 1.1 arm-gp2x-linux-glibc.spec, NONE, 1.1 glibc-2.3.5-allow-gcc-4.0-wordexp.patch, NONE, 1.1 glibc-2.3.5-allow-gcc4-wcstol_l.patch, NONE, 1.1 glibc-2.3.6-allow-gcc-4.0-arm.patch, NONE, 1.1 glibc-2.3.6-allow-gcc-4.0-elf.patch, NONE, 1.1 glibc-2.3.6-fix-pr631.patch, NONE, 1.1 glibc-fp-byteorder.patch, NONE, 1.1 glibc-linuxthreads-2.3.6-raise.patch, NONE, 1.1 make-install-lib-all.patch, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Sun Aug 5 19:46:50 UTC 2007


Author: jwrdegoede

Update of /cvs/extras/rpms/arm-gp2x-linux-glibc/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14940

Modified Files:
	.cvsignore sources 
Added Files:
	README.fedora arm-ctl_bus_isa.patch arm-gp2x-linux-glibc.spec 
	glibc-2.3.5-allow-gcc-4.0-wordexp.patch 
	glibc-2.3.5-allow-gcc4-wcstol_l.patch 
	glibc-2.3.6-allow-gcc-4.0-arm.patch 
	glibc-2.3.6-allow-gcc-4.0-elf.patch 
	glibc-2.3.6-fix-pr631.patch glibc-fp-byteorder.patch 
	glibc-linuxthreads-2.3.6-raise.patch 
	make-install-lib-all.patch 
Log Message:
* Sun Aug  5 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 2.3.6-4
- Do NOT provide and require native glibc symbols <sigh>



--- NEW FILE README.fedora ---
This package does not include the gnu texinfo documentation because this would
conflict with the native glibc. If you've installed the native glibc,
you can find the info documentation there, notice that this is for a different
(newer) version though!

arm-ctl_bus_isa.patch:

--- NEW FILE arm-ctl_bus_isa.patch ---
Applies to both glibc-2.2.5 and glibc-2.3.2, and probably glibc cvs as of Aug 2004.
Needed to build glibc with linux kernels 2.4.23 or higher on ARM, 
Fixes following error:

../sysdeps/unix/sysv/linux/arm/ioperm.c: In function `init_iosys':
../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: `BUS_ISA' undeclared (first use in this function)
../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (Each undeclared identifier is reported only once
../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: for each function it appears in.)
../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: initializer element is not constant
../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (near initialization for `iobase_name[1]')
../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: initializer element is not constant
../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: (near initialization for `ioshift_name[1]')
make[2]: *** [/home/dank/crosstool-0.28/build/arm-softfloat-linux-gnu/gcc-3.3.4-glibc-2.2.5/build-glibc/misc/ioperm.o] Error 1

cf. "[SYSCTL] BUS_ISA -> CTL_BUS_ISA",  http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html

--- glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c.old	2003-02-20 14:22:24.000000000 -0800
+++ glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c	2004-01-31 16:01:50.000000000 -0800
@@ -47,6 +47,12 @@
 #include <asm/page.h>
 #include <sys/sysctl.h>
 
+/* see http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html */
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
+#define CTL_BUS_ISA BUS_ISA	/* and hope it's not the one from linux/input.h */
+#endif
+
 #define PATH_ARM_SYSTYPE	"/etc/arm_systype"
 #define PATH_CPUINFO		"/proc/cpuinfo"
 
@@ -80,7 +86,7 @@
  * Initialize I/O system.  There are several ways to get the information
  * we need.  Each is tried in turn until one succeeds.
  *
- * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*).  This is the preferred method
+ * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*).  This is the preferred method
  *    but not all kernels support it.
  *
  * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
@@ -100,8 +106,8 @@
 {
   char systype[256];
   int i, n;
-  static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
-  static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
+  static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };
+  static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT };
   size_t len = sizeof(io.base);
 
   if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)

Signed-off-by: Robert P. J. Day <rpjday at mindspring.com>


--- NEW FILE arm-gp2x-linux-glibc.spec ---
%define target arm-gp2x-linux

Name:           %{target}-glibc
Version:        2.3.6
Release:        4%{?dist}
Summary:        Cross Compiled GNU C Library targeted at %{target}
Group:          Development/Languages
License:        LGPLv2+
URL:            http://www.gnu.org/software/libc/
Source0:        ftp://ftp.gnu.org/gnu/glibc/glibc-%{version}.tar.bz2
Source1:        ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-%{version}.tar.bz2
Source2:        README.fedora
Patch1:         http://kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/arm-ctl_bus_isa.patch
Patch2:         http://kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/glibc-2.3.5-allow-gcc-4.0-wordexp.patch
Patch3:         http://kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/glibc-2.3.5-allow-gcc4-wcstol_l.patch
Patch4:         http://kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/glibc-2.3.6-allow-gcc-4.0-arm.patch
Patch5:         http://kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/glibc-2.3.6-allow-gcc-4.0-elf.patch
Patch6:         http://kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/glibc-2.3.6-fix-pr631.patch
Patch7:         http://kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/glibc-fp-byteorder.patch
Patch8:         http://kegel.com/crosstool/crosstool-0.43/patches/glibc-2.3.6/make-install-lib-all.patch
# from: http://open2x.svn.sourceforge.net/viewvc/open2x/trunk/toolchain-new/patches/glibc-linuxthreads-2.3.6/glibc-linuxthreads-2.3.6-raise.patch?revision=223
Patch9:         glibc-linuxthreads-2.3.6-raise.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
BuildRequires:  %{target}-gcc %{target}-kernel-headers
BuildArch:      noarch
Requires:       %{target}-kernel-headers

%description
This is a Cross Compiled version of the GNU C Library, which can be used to
compile and link binaries for the %{target} platform, instead of for the
native %{_arch} platform.


%prep
%setup -q -c -a 2
pushd glibc-%{version}
tar -xf %{SOURCE1} 
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
popd
cp -a %{SOURCE2} .


%build
mkdir -p build-%{target}-glibc
pushd build-%{target}-glibc
# CFLAGS not used, maybe we should ?
../glibc-%{version}/configure --prefix=%{_prefix}/%{target} \
  --build=`uname -m` --host=%{target} --enable-add-ons=linuxthreads \
  --without-fp --disable-profile --without-selinux
make %{?_smp_mflags}

# generate stubs.h
for i in io math misc posix stdlib streams; do
  make -C ../glibc-%{version}/$i objdir=`pwd` stubs
  cat $i/stubs >> subdir-stubs.h
done

sed '/^@/d' < ../glibc-%{version}/include/stubs-prologue.h > stubs.h
sort subdir-stubs.h >> stubs.h

popd


%install
rm -rf $RPM_BUILD_ROOT
pushd build-%{target}-glibc
make install-lib-all install_root=$RPM_BUILD_ROOT
make install-headers install_root=$RPM_BUILD_ROOT
install -m 644 bits/stdio_lim.h $RPM_BUILD_ROOT%{_prefix}/%{target}/include/bits
install -m 644 stubs.h $RPM_BUILD_ROOT%{_prefix}/%{target}/include/gnu
popd

# despite us being noarch redhat-rpm-config insists on stripping our files
# and on running find-debuginfo.sh on our files
%define __debug_install_post %{nil}
%define __os_install_post /usr/lib/rpm/redhat/brp-compress

# stop rpm from claiming we provide and need native glibc symbols <sigh>
%define _use_internal_dependency_generator 0
%define __find_requires %{nil}
%define __find_provides %{nil}


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc glibc-%{version}/BUGS glibc-%{version}/C* glibc-%{version}/FAQ
%doc glibc-%{version}/LICENSES glibc-%{version}/README
%doc glibc-%{version}/README.libm README.fedora
%{_prefix}/%{target}/include/*
%{_prefix}/%{target}/lib


%changelog
* Sun Aug  5 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 2.3.6-4
- Do NOT provide and require native glibc symbols <sigh>

* Fri Aug  3 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 2.3.6-3
- Change License tag to: LGPLv2+
- Don't own %%{_prefix}/%%{target} and %%{_prefix}/%%{target}/include dirs, as
  these are already owned by the required arm-gp2x-linux-kernel-headers rpm

* Thu May 31 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 2.3.6-2
- Merge in latest avr-libc changes (make noarch, don't strip files)

* Thu Apr 25 2007 Koos Termeulen koostermeulen at gmail.com 2.3.6-1
- Initial release

glibc-2.3.5-allow-gcc-4.0-wordexp.patch:

--- NEW FILE glibc-2.3.5-allow-gcc-4.0-wordexp.patch ---
../sysdeps/generic/wordexp.c: In function 'exec_comm':
../sysdeps/generic/wordexp.c:815: sorry, unimplemented: inlining failed in call to 'exec_comm_child': function body not available
../sysdeps/generic/wordexp.c:900: sorry, unimplemented: called from here
make[2]: *** [/home/dank/queue/jobdir.fast2/crosstool-dev/build/i686-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3-20050307/build-glibc/posix/wordexp.o] Error

I had to add the keyword 'inline' to get it to compile:

--- glibc-2.3-20050307/sysdeps/generic/wordexp.c.old	2005-03-12 08:54:15.709253928 -0800
+++ glibc-2.3-20050307/sysdeps/generic/wordexp.c	2005-03-12 08:54:51.242852000 -0800
@@ -809,7 +809,7 @@
 }

 /* Function called by child process in exec_comm() */
-static void
+static inline void
 internal_function __attribute__ ((always_inline))
 exec_comm_child (char *comm, int *fildes, int showerr, int noexec)
 {


Signed-off-by: Robert P. J. Day <rpjday at mindspring.com>

glibc-2.3.5-allow-gcc4-wcstol_l.patch:

--- NEW FILE glibc-2.3.5-allow-gcc4-wcstol_l.patch ---
Fixes
../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal'
../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l'
../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l'
make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1

https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html
%changelog
+* Fri Mar 25 2005 Jakub Jelinek <jakub redhat com> 2.3.4-18
+- fix build on 64-bit arches with new GCC

Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub
Branch: fedora-branch
CVS Tags: fedora-glibc-2_3_4-18
Changes since 1.4: +2 -0 lines
Diff to previous 1.4 (colored)

	* sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED.
	* sysdeps/wordsize-64/wcstol_l.c: Likewise.


http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc

===================================================================
RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- libc/sysdeps/wordsize-64/strtol_l.c	2003/03/03 09:45:12	1.4
+++ libc/sysdeps/wordsize-64/strtol_l.c	2005/03/25 11:59:01	1.4.2.1
@@ -8,7 +8,9 @@
 #undef ____strtoll_l_internal
 #undef __strtoll_l
 #undef strtoll_l
+#if !UNSIGNED
 strong_alias (____strtol_l_internal, ____strtoll_l_internal)
 libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal)
 weak_alias (__strtol_l, __strtoll_l)
 weak_alias (__strtol_l, strtoll_l)
+#endif
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- libc/sysdeps/wordsize-64/wcstol_l.c	2002/08/08 11:44:51	1.4
+++ libc/sysdeps/wordsize-64/wcstol_l.c	2005/03/25 11:59:01	1.4.2.1
@@ -8,6 +8,8 @@
 #undef ____wcstoll_l_internal
 #undef __wcstoll_l
 #undef wcstoll_l
+#if !UNSIGNED
 strong_alias (____wcstol_l_internal, ____wcstoll_l_internal)
 weak_alias (__wcstol_l, __wcstoll_l)
 weak_alias (__wcstol_l, wcstoll_l)
+#endif

Signed-off-by: Robert P. J. Day <rpjday at mindspring.com>

glibc-2.3.6-allow-gcc-4.0-arm.patch:

--- NEW FILE glibc-2.3.6-allow-gcc-4.0-arm.patch ---
Fixes
In file included from dynamic-link.h:22,
                 from dl-reloc.c:265:
../sysdeps/arm/dl-machine.h: In function '_dl_relocate_object':
../sysdeps/arm/dl-machine.h:371: error: invalid storage class for function 'fix_bad_pc24'
make[2]: Leaving directory `/home/dank/queue/jobdir.k8/crosstool-dev/build/arm-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.6/glibc-2.3.6/elf'

when building glibc-2.3.6 with gcc-4.0

Like
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/arm/dl-machine.h.diff?r1=1.51&r2=1.52&cvsroot=glibc
but fixes fix_bad_pc24.


--- glibc-2.3.6-orig/sysdeps/arm/dl-machine.h	Sun Mar 20 17:54:37 2005
+++ glibc-2.3.6/sysdeps/arm/dl-machine.h	Sun Mar 20 17:57:32 2005
@@ -357,7 +357,14 @@
 #ifdef RESOLVE
 
 /* Deal with an out-of-range PC24 reloc.  */
-static Elf32_Addr
+#if __GNUC__ >= 4
+  auto inline Elf32_Addr
+#else
+  static inline Elf32_Addr
+#endif
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+  __attribute ((always_inline))
+#endif
 fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value)
 {
   static void *fix_page;

Signed-off-by: Robert P. J. Day <rpjday at mindspring.com>
with a little editing by dank at kegel.com

glibc-2.3.6-allow-gcc-4.0-elf.patch:

--- NEW FILE glibc-2.3.6-allow-gcc-4.0-elf.patch ---
>From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html
Fixes
  rtld.c: In function '_dl_start':
  dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined
  dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined
when compiling glibc-2.3.4 with gcc-4.0

But see also
http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html
and
http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html
which seem to propose less radical fixes?

Aha.  See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721

--- glibc-2.3.6.orig/elf/dynamic-link.h	2005-03-12 18:12:37.000000000 -0800
+++ glibc-2.3.6/elf/dynamic-link.h	2005-03-12 18:12:59.777820848 -0800
@@ -19,47 +19,6 @@
 
 #include <elf.h>
 #include <assert.h>
-
-#ifdef RESOLVE
-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to
-   ElfW(Addr), because not all architectures can assume that the
-   relocated address is properly aligned, whereas the compiler is
-   entitled to assume that a pointer to a type is properly aligned for
-   the type.  Even if we cast the pointer back to some other type with
-   less strict alignment requirements, the compiler might still
-   remember that the pointer was originally more aligned, thereby
-   optimizing away alignment tests or using word instructions for
-   copying memory, breaking the very code written to handle the
-   unaligned cases.  */
-# if ! ELF_MACHINE_NO_REL
-auto inline void __attribute__((always_inline))
-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
-		 const ElfW(Sym) *sym, const struct r_found_version *version,
-		 void *const reloc_addr);
-auto inline void __attribute__((always_inline))
-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
-			  void *const reloc_addr);
-# endif
-# if ! ELF_MACHINE_NO_RELA
-auto inline void __attribute__((always_inline))
-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
-		  const ElfW(Sym) *sym, const struct r_found_version *version,
-		  void *const reloc_addr);
-auto inline void __attribute__((always_inline))
-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
-			   void *const reloc_addr);
-# endif
-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
-auto inline void __attribute__((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
-		      ElfW(Addr) l_addr, const ElfW(Rel) *reloc);
-# else
-auto inline void __attribute__((always_inline))
-elf_machine_lazy_rel (struct link_map *map,
-		      ElfW(Addr) l_addr, const ElfW(Rela) *reloc);
-# endif
-#endif
-
 #include <dl-machine.h>
 
 #ifndef VERSYMIDX

Signed-off-by: Robert P. J. Day <rpjday at mindspring.com>

glibc-2.3.6-fix-pr631.patch:

--- NEW FILE glibc-2.3.6-fix-pr631.patch ---
>From dank at kegel.com
Wed Jun 15 09:12:43 PDT 2005

Fixes

build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r'
build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent'
... 53 lines deleted ...
build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r'
collect2: ld returned 1 exit status
make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1

when building glibc with --enable-static-nss.

See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631

--- glibc-2.3.5/Makeconfig.old	Wed Jun 15 08:13:12 2005
+++ glibc-2.3.5/Makeconfig	Wed Jun 15 08:13:14 2005
@@ -487,7 +487,7 @@
 
 # The static libraries.
 ifeq (yes,$(build-static))
-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a
+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a
 else
 ifeq (yes,$(build-shared))
 # We can try to link the programs with lib*_pic.a...
--- glibc-2.3.5/elf/Makefile.old	Wed Jun 15 07:46:49 2005
+++ glibc-2.3.5/elf/Makefile	Wed Jun 15 08:14:00 2005
@@ -115,6 +115,13 @@
 install-bin-script = ldd
 endif
 
+ifeq (yes,$(build-static-nss))
+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
+	     $(resolvobjdir)/libresolv.a
+endif
+
 others		= sprof sln
 install-bin	= sprof
 others-static   = sln

Signed-off-by: Robert P. J. Day <rpjday at mindspring.com>

glibc-fp-byteorder.patch:

--- NEW FILE glibc-fp-byteorder.patch ---
Taken from http://sources.redhat.com/ml/crossgcc/2004-02/msg00104.html
Author: addsub at eyou.com
Target: ARM

Fixes http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/920501-8.c
and makes printf("%f", 1.0) work.

Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00115.html :
 It ... fixes the 'printf("%f\n", 0.5); prints 0.000000' and general 'floating point
 is broken' on my big-endian hardfloat FPA ARM platform. ...
 It's definitely needed for hardfloat.  So I'd think it's needed for
 big-endian systems in any case, and for VFP on little-endian systems
 too.  Someone would have to verify that though.

Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00123.html
 I just had a look at glibc-20040830, and [this patch] is still needed and useful
 for this version.  glibc-20040830 out-of-the-box still contains the
 following wrong assumptions:
 - sysdeps/arm/bits/endian.h: float word order is big endian (which it is
   not on vfp systems)
 - sysdeps/arm/gmp-mparam.h: IEEE doubles are mixed endian (which they
   are not on big endian systems, neither on vfp systems)
 - sysdeps/arm/ieee754.h: IEEE doubles are in little endian byte order
   (which they are not on big endian systems)
 [This patch] seems the right solution for all of these issues.

Dimitry Andric wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00132.html :
 It's even needed for glibc CVS, AFAICS.
 The patch hunk which modifies glibc.new/sysdeps/arm/bits/endian.h
 (currently at version 1.4) is only needed for proper VFP operation.
 But the hunk which modifies sysdeps/arm/gmp-mparam.h, and the hunk
 that deletes sysdeps/arm/ieee754.h (yes, this IS correct), are needed
 for proper operation of *any* FP model on big endian ARM.

See also discussion in followups to
http://sources.redhat.com/ml/crossgcc/2004-05/msg00245.html)

Message-ID: <276985760.37584 at eyou.com>
Received: from unknown (HELO eyou.com) (172.16.2.2)
 by 0.0.0.0 with SMTP; Tue, 17 Feb 2004 10:42:40 +0800
Received: (qmail 8238 invoked by uid 65534); 17 Feb 2004 10:42:38 +0800
Date: 17 Feb 2004 10:42:38 +0800
Message-ID: <20040217104238.8237.qmail at eyou.com>
From: "add" <addsub at eyou.com>
To: dank at kegel.com
Reply-To: "add" <addsub at eyou.com>
Subject: Re:   problem while building arm vfp softfloat gcc `

Hi, Dan, This is a patch I applied to my glibc-2.3.2, then my softfloat
toolchain can printf("%f\n",1.0). So you may have a try of this


diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h
--- glibc.old/sysdeps/arm/bits/endian.h	1999-04-12 11:59:13.000000000 -0400
+++ glibc.new/sysdeps/arm/bits/endian.h	2004-02-12 09:15:13.000000000 -0500
@@ -9,4 +9,9 @@
 #else
 #define __BYTE_ORDER __LITTLE_ENDIAN
 #endif
+
+#ifdef __VFP_FP__
+#define __FLOAT_WORD_ORDER __BYTE_ORDER
+#else
 #define __FLOAT_WORD_ORDER __BIG_ENDIAN
+#endif
diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h
--- glibc.old/sysdeps/arm/gmp-mparam.h	2001-07-07 15:21:19.000000000 -0400
+++ glibc.new/sysdeps/arm/gmp-mparam.h	2004-02-12 09:15:13.000000000 -0500
@@ -26,5 +26,13 @@ MA 02111-1307, USA. */
 #define BITS_PER_SHORTINT 16
 #define BITS_PER_CHAR 8
 
-#define IEEE_DOUBLE_BIG_ENDIAN 0
-#define IEEE_DOUBLE_MIXED_ENDIAN 1
+#if defined(__ARMEB__)
+# define IEEE_DOUBLE_MIXED_ENDIAN 0
+# define IEEE_DOUBLE_BIG_ENDIAN 1
+#elif defined(__VFP_FP__)
+# define IEEE_DOUBLE_MIXED_ENDIAN 0
+# define IEEE_DOUBLE_BIG_ENDIAN 0
+#else
+# define IEEE_DOUBLE_BIG_ENDIAN 0
+# define IEEE_DOUBLE_MIXED_ENDIAN 1
+#endif
diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h
--- glibc.old/sysdeps/arm/ieee754.h	2001-07-07 15:21:19.000000000 -0400
+++ glibc.new/sysdeps/arm/ieee754.h	1969-12-31 19:00:00.000000000 -0500
@@ -1,115 +0,0 @@
-/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#ifndef _IEEE754_H
-
-#define _IEEE754_H 1
-#include <features.h>
-
-#include <endian.h>
-
-__BEGIN_DECLS
-
-union ieee754_float
-  {
-    float f;
-
-    /* This is the IEEE 754 single-precision format.  */
-    struct
-      {
-	unsigned int mantissa:23;
-	unsigned int exponent:8;
-	unsigned int negative:1;
-      } ieee;
-
-    /* This format makes it easier to see if a NaN is a signalling NaN.  */
-    struct
-      {
-	unsigned int mantissa:22;
-	unsigned int quiet_nan:1;
-	unsigned int exponent:8;
-	unsigned int negative:1;
-      } ieee_nan;
-  };
-
-#define IEEE754_FLOAT_BIAS	0x7f /* Added to exponent.  */
-
-
-union ieee754_double
-  {
-    double d;
-
-    /* This is the IEEE 754 double-precision format.  */
-    struct
-      {
-	unsigned int mantissa0:20;
-	unsigned int exponent:11;
-	unsigned int negative:1;
-	unsigned int mantissa1:32;
-      } ieee;
-
-    /* This format makes it easier to see if a NaN is a signalling NaN.  */
-    struct
-      {
-	unsigned int mantissa0:19;
-	unsigned int quiet_nan:1;
-	unsigned int exponent:11;
-	unsigned int negative:1;
-	unsigned int mantissa1:32;
-      } ieee_nan;
-  };
-
-#define IEEE754_DOUBLE_BIAS	0x3ff /* Added to exponent.  */
-
-
-/* The following two structures are correct for `new' floating point systems but
-   wrong for the old FPPC.  The only solution seems to be to avoid their use on
-   old hardware.  */
-
-union ieee854_long_double
-  {
-    long double d;
-
-    /* This is the IEEE 854 double-extended-precision format.  */
-    struct
-      {
-	unsigned int exponent:15;
-	unsigned int empty:16;
-	unsigned int negative:1;
-	unsigned int mantissa1:32;
-	unsigned int mantissa0:32;
-      } ieee;
-
-    /* This is for NaNs in the IEEE 854 double-extended-precision format.  */
-    struct
-      {
-	unsigned int exponent:15;
-	unsigned int empty:16;
-	unsigned int negative:1;
-	unsigned int mantissa1:32;
-	unsigned int mantissa0:30;
-	unsigned int quiet_nan:1;
-	unsigned int one:1;
-      } ieee_nan;
-  };
-
-#define IEEE854_LONG_DOUBLE_BIAS 0x3fff
-
-__END_DECLS
-
-#endif /* ieee754.h */

Signed-off-by: Robert P. J. Day <rpjday at mindspring.com>

glibc-linuxthreads-2.3.6-raise.patch:

--- NEW FILE glibc-linuxthreads-2.3.6-raise.patch ---
Index: glibc/linuxthreads/sysdeps/unix/sysv/linux/raise.c
===================================================================
--- glibc.orig/linuxthreads/sysdeps/unix/sysv/linux/raise.c	2003-01-02 19:38:38.000000000 -0500
+++ glibc/linuxthreads/sysdeps/unix/sysv/linux/raise.c	2005-10-31 14:19:58.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 2002, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,10 +18,13 @@
 
 #include <signal.h>
 #include <unistd.h>
-#include <bits/libc-lock.h>
 
-#ifndef SHARED
+#ifndef IS_IN_rtld
+# include <bits/libc-lock.h>
+
+# ifndef SHARED
 weak_extern (__pthread_raise)
+# endif
 #endif
 
 /* Raise the signal SIG.  */
@@ -29,8 +32,12 @@ int
 raise (sig)
      int sig;
 {
+#ifdef IS_IN_rtld
+  return __kill (__getpid (), sig);
+#else
   return __libc_maybe_call2 (pthread_raise, (sig),
 			     __kill (__getpid (), sig));
+#endif
 }
 libc_hidden_def (raise)
 weak_alias (raise, gsignal)

make-install-lib-all.patch:

--- NEW FILE make-install-lib-all.patch ---
>From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch
Rule to install all needed libraries, not just the ones installed by install-lib,
yet not install programs.  
Needed because we can't use the main install target, as we can't build programs before
we have the final gcc installed; linking fails because libeh.a is not present,
and glibc insists on linking programs with that library.

diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules
--- glibc-2.3.4.orig/Makerules	2004-12-15 20:52:39.000000000 +0200
+++ glibc-2.3.4/Makerules	2005-02-19 15:16:31.415125176 +0200
@@ -844,6 +844,13 @@
 installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
 			     $(inst_libdir)/$(patsubst %,$(libtype$o),\
 						     $(libprefix)$(libc-name)))
+
+install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
+		$(inst_slibdir)/libc-$(version).so \
+		$(inst_libdir)/libc.so \
+		$(inst_libdir)/libc.a \
+		install-lib
+
 install: $(installed-libcs)
 $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
 	$(make-target-directory)

Signed-off-by: Robert P. J. Day <rpjday at mindspring.com>


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/arm-gp2x-linux-glibc/FC-6/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	3 Aug 2007 16:51:04 -0000	1.1
+++ .cvsignore	5 Aug 2007 19:46:18 -0000	1.2
@@ -0,0 +1,2 @@
+glibc-2.3.6.tar.bz2
+glibc-linuxthreads-2.3.6.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/arm-gp2x-linux-glibc/FC-6/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	3 Aug 2007 16:51:04 -0000	1.1
+++ sources	5 Aug 2007 19:46:18 -0000	1.2
@@ -0,0 +1,2 @@
+bfdce99f82d6dbcb64b7f11c05d6bc96  glibc-2.3.6.tar.bz2
+d4eeda37472666a15cc1f407e9c987a9  glibc-linuxthreads-2.3.6.tar.bz2




More information about the fedora-extras-commits mailing list