This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[crosstool-ng] patch for glibc-2.3.6


Hello,

I still need an old glibc-2.3.6, so i patched it for make it working for ppc 405 softfloat.
Here are the patches.


Note:
patches are in dir glibc/2.3.6 except 310-linuxthreads... which should be put in glibc/linuxthread-2.3.6


Regards,

Julien
GCC trunk now has multiple internal headers directories, one
containing the self-contained GCC-provided headers and one containing
the <limits.h> (not self-contained but including libc's <limits.h> or
a fixed version thereof) and the fixed headers; more such directories
may be added in future.

When glibc uses -nostdinc, it needs to use -isystem options for all
these internal directories.  This patch teaches it about the
include-fixed directory (and is harmless with old GCC versions without
that directory).

2007-03-18  Joseph Myers  <joseph@codesourcery.com>

	* configure.in: Also pass -isystem option for GCC's include-fixed
	directory.
	* configure: Regenerate.


--- glibc-2.3.6.ori/configure.in	2008-10-22 14:55:58.000000000 +0200
+++ glibc-2.3.6/configure.in	2008-10-22 14:56:15.000000000 +0200
@@ -804,7 +804,7 @@
 # thing on a system that doesn't need fixincludes.  (Not presently a problem.)
 if test -n "$sysheaders"; then
   ccheaders=`$CC -print-file-name=include`
-  SYSINCLUDES="-nostdinc -isystem $ccheaders \
+  SYSINCLUDES="-nostdinc -isystem $ccheaders -isystem $ccheaders-fixed \
 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
 fi
 AC_SUBST(SYSINCLUDES)
--- glibc-2.3.6.ori/configure	2008-10-22 15:11:37.000000000 +0200
+++ glibc-2.3.6/configure	2008-10-22 15:11:54.000000000 +0200
@@ -4438,7 +4438,7 @@
 # thing on a system that doesn't need fixincludes.  (Not presently a problem.)
 if test -n "$sysheaders"; then
   ccheaders=`$CC -print-file-name=include`
-  SYSINCLUDES="-nostdinc -isystem $ccheaders \
+  SYSINCLUDES="-nostdinc -isystem $ccheaders -isystem $ccheaders-fixed \
 -isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
 fi
 
Fixes "Error: symbol `__bind' is already defined" error when building for PowerPC

Patch taken from http://bugs.debian.org/343571

--- glibc-2.3.6.ori/sysdeps/powerpc/powerpc32/fpu/s_lround.S	2004-07-01 00:29:12.000000000 +0200
+++ glibc-2.3.6/sysdeps/powerpc/powerpc32/fpu/s_lround.S	2008-10-23 11:20:09.000000000 +0200
@@ -88,7 +88,6 @@
 	b	.L9
 	END (__lround)
 
-strong_alias (__lround, __lround)
 weak_alias (__lround, lround)
 
 strong_alias (__lround, __lroundf)

--- glibc-2.3.6.ori/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S	2005-12-16 01:04:21.000000000 -0600
+++ glibc-2.3.6/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S	2005-12-16 01:06:26.000000000 -0600
@@ -42,7 +42,11 @@
 #define stackblock 20
 
 #ifndef __socket
-#define __socket P(__,socket)
+# ifndef NO_WEAK_ALIAS
+#  define __socket P(__,socket)
+# else
+#  define __socket socket
+# endif
 #endif
 
 	.text
@@ -116,4 +120,6 @@
 
 PSEUDO_END (__socket)
 
+#ifndef NO_WEAK_ALIAS
 weak_alias (__socket, socket)
+#endif
--- glibc-2.3.6.ori/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S	2005-12-16 01:08:45.000000000 -0600
+++ glibc-2.3.6/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S	2005-12-16 01:09:32.000000000 -0600
@@ -41,12 +41,12 @@
 
 #define stackblock 80 /* offset to socket parm area.  */
 
-#ifndef socket
-/* If this is just socket.S leave it alone! */
-#else
 #ifndef __socket
-#define __socket P(__,socket)
-#endif
+# ifndef NO_WEAK_ALIAS
+#  define __socket P(__,socket)
+# else
+#  define __socket socket
+# endif
 #endif
 
 	.text
@@ -120,4 +120,6 @@
 	cfi_endproc
 PSEUDO_END (__socket)
 
+#ifndef NO_WEAK_ALIAS
 weak_alias (__socket, socket)
+#endif
fixes

multiple definition of `dummy'
multiple definition of `_init'
multiple definition of `_fini'

as suggested in:
http://sourceware.org/ml/crossgcc/2006-12/msg00057.html

--- glibc-2.3.6.ori/sysdeps/powerpc/powerpc32/Makefile	2003-10-22 23:30:02.000000000 +0200
+++ glibc-2.3.6/sysdeps/powerpc/powerpc32/Makefile	2008-10-22 18:35:03.000000000 +0200
@@ -21,7 +21,7 @@
 ifneq ($(elf),no)
 # The initfini generation code doesn't work in the presence of -fPIC, so
 # we use -fpic instead which is much better.
-CFLAGS-initfini.s = -g0 -fpic -O1
+CFLAGS-initfini.s = -g0 -fpic -O1 $(fno-unit-at-a-time)
 
 # There is no benefit to using sdata for these objects, and the user
 # of the library should be able to control what goes into sdata.
Fixes:

`.LANCHOR0' referenced in section `.text' of [...]/libc_pic.a(strtoul_l.os): defined in discarded section `.gnu.linkonce.r.__strtol_ul_max_tab' of [...]/libc_pic.a(strtoul_l.os)
...

Add -fno-section-anchors as suggested in:
http://sourceware.org/ml/binutils/2006-08/msg00046.html

--- glibc-2.3.6.ori/stdlib/Makefile	2005-02-16 12:23:58.000000000 +0100
+++ glibc-2.3.6/stdlib/Makefile		2008-10-23 14:22:27.000000000 +0200
@@ -138,3 +138,8 @@
 $(objpfx)tst-putenvmod.so: $(objpfx)tst-putenvmod.os
 	$(build-module)
 CFLAGS-tst-putenvmod.c = -DNOT_IN_libc=1
+
+CFLAGS-strtol_l.c=-fno-section-anchors
+CFLAGS-strtoul_l.c=-fno-section-anchors
+CFLAGS-strtoll_l.c=-fno-section-anchors
+CFLAGS-strtoull_l.c=-fno-section-anchors
--- glibc-2.3.6.ori/wcsmbs/Makefile	2004-08-05 20:52:20.000000000 +0200
+++ glibc-2.3.6/wcsmbs/Makefile		2008-10-23 14:20:55.000000000 +0200
@@ -47,7 +47,7 @@
 CFLAGS-wcwidth.c = -I../wctype
 CFLAGS-wcswidth.c = -I../wctype
 
-strtox-CFLAGS = -I../include -I../stdlib
+strtox-CFLAGS = -I../include -I../stdlib -fno-section-anchors
 CFLAGS-wcstol.c = $(strtox-CFLAGS)
 CFLAGS-wcstoul.c = $(strtox-CFLAGS)
 CFLAGS-wcstoll.c = $(strtox-CFLAGS)
fixes

multiple definition of `dummy'
multiple definition of `_init'
multiple definition of `_fini'

as suggested in:
http://sourceware.org/ml/crossgcc/2006-12/msg00057.html

--- glibc-2.3.6.ori/linuxthreads/sysdeps/powerpc/Makefile	2003-02-17 21:33:17.000000000 +0100
+++ glibc-2.3.6/linuxthreads/sysdeps/powerpc/Makefile		2008-10-23 17:57:49.000000000 +0200
@@ -1,6 +1,6 @@
 ifeq ($(subdir):$(elf),linuxthreads:yes)
 # See CFLAGS-initfini.s above; this is the same code.
-CFLAGS-pt-initfini.s = -g0 -fpic -O1
+CFLAGS-pt-initfini.s = -g0 -fpic -O1 $(fno-unit-at-a-time)
 endif
 ifeq ($(subdir),csu)
 gen-as-const-headers += tcb-offsets.sym

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]