patches/glibc/2.3.2/glibc-2.3.2-cygwin.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
yann@1
     1
Fixes
yann@1
     2
elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
yann@1
     3
...
yann@1
     4
when building glibc-2.3.2 on cygwin
yann@1
     5
yann@1
     6
Idea from
yann@1
     7
http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
yann@1
     8
Basically, make glibc use .oST as suffix for 'object static'
yann@1
     9
instead of .oS, since cygwin has trouble distinguishing .os from .oS
yann@1
    10
(Original patch had .on, but .oST is more mnemonic for 'object static')
yann@1
    11
yann@1
    12
glibc-linuxthreads-2.3.2 also requires a patch, see 
yann@1
    13
../glibc-linuxthreads-2.3.2/glibc-linuxthreads-2.3.2-cygwin.patch
yann@1
    14
yann@1
    15
yann@1
    16
--- glibc-2.3.2/Makeconfig.orig	2003-01-05 21:31:36.000000000 -0800
yann@1
    17
+++ glibc-2.3.2/Makeconfig	2004-03-13 23:42:03.781250000 -0800
yann@1
    18
@@ -433,13 +433,13 @@
yann@1
    19
 # run the linked programs.
yann@1
    20
 link-libc = -Wl,-rpath-link=$(rpath-link) \
yann@1
    21
 	    $(common-objpfx)libc.so$(libc.so-version) \
yann@1
    22
-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
yann@1
    23
+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
yann@1
    24
 # This is how to find at build-time things that will be installed there.
yann@1
    25
 rpath-dirs = math elf dlfcn nss nis rt resolv crypt
yann@1
    26
 else
yann@1
    27
 ifneq (,$(filter aix aix%,$(config-os)))
yann@1
    28
 link-libc = $(common-objpfx)libc.a \
yann@1
    29
-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
yann@1
    30
+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
yann@1
    31
 rpath-dirs = math dlfcn nss nis rt resolv crypt
yann@1
    32
 endif
yann@1
    33
 endif
yann@1
    34
@@ -652,7 +652,7 @@
yann@1
    35
 # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
yann@1
    36
 # to pass different flags for each flavor.
yann@1
    37
 libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
yann@1
    38
-all-object-suffixes := .o .os .op .og .ob .oS
yann@1
    39
+all-object-suffixes := .o .os .op .og .ob .oST
yann@1
    40
 object-suffixes :=
yann@1
    41
 CPPFLAGS-.o = $(pic-default)
yann@1
    42
 CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
yann@1
    43
@@ -706,14 +706,14 @@
yann@1
    44
 
yann@1
    45
 ifeq (yes,$(build-shared))
yann@1
    46
 # Build special library that contains the static-only routines for libc.
yann@1
    47
-object-suffixes-for-libc += .oS
yann@1
    48
+object-suffixes-for-libc += .oST
yann@1
    49
 
yann@1
    50
 # Must build the routines as PIC, though, because they can end up in (users')
yann@1
    51
 # shared objects.  We don't want to use CFLAGS-os because users may, for
yann@1
    52
 # example, make that processor-specific.
yann@1
    53
-CFLAGS-.oS = $(CFLAGS-.o) $(pic-ccflag)
yann@1
    54
-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
yann@1
    55
-libtype.oS = lib%_nonshared.a
yann@1
    56
+CFLAGS-.oST = $(CFLAGS-.o) $(pic-ccflag)
yann@1
    57
+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
yann@1
    58
+libtype.oST = lib%_nonshared.a
yann@1
    59
 endif
yann@1
    60
 
yann@1
    61
 
yann@1
    62
--- glibc-2.3.2/Makerules.orig	2003-02-22 15:23:31.000000000 -0800
yann@1
    63
+++ glibc-2.3.2/Makerules	2004-03-13 23:43:40.984375000 -0800
yann@1
    64
@@ -446,7 +446,7 @@
yann@1
    65
 # Bounded pointer thunks are only built for *.ob
yann@1
    66
 elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
yann@1
    67
 
yann@1
    68
-elide-routines.oS += $(filter-out $(static-only-routines),\
yann@1
    69
+elide-routines.oST += $(filter-out $(static-only-routines),\
yann@1
    70
 				  $(routines) $(aux) $(sysdep_routines)) \
yann@1
    71
 		     $(elide-bp-thunks)
yann@1
    72
 elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
yann@1
    73
@@ -958,7 +958,7 @@
yann@1
    74
 install: $(inst_libdir)/libc.so
yann@1
    75
 $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
yann@1
    76
 			$(common-objpfx)libc.so$(libc.so-version) \
yann@1
    77
-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
yann@1
    78
+			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
yann@1
    79
 						  $(libprefix)$(libc-name)) \
yann@1
    80
 			$(+force)
yann@1
    81
 	(echo '/* GNU ld script';\
yann@1
    82
@@ -966,7 +966,7 @@
yann@1
    83
 	 echo '   the static library, so try that secondarily.  */';\
yann@1
    84
 	 cat $<; \
yann@1
    85
 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
yann@1
    86
-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
yann@1
    87
+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
yann@1
    88
 	      ')' \
yann@1
    89
 	) > $@.new
yann@1
    90
 	mv -f $@.new $@