patches/glibc/2.3.4/glibc-2.3.4-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.4 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.4 also requires a patch, see 
yann@1
    13
../glibc-linuxthreads-2.3.4/glibc-linuxthreads-2.3.4-cygwin.patch
yann@1
    14
yann@1
    15
[ Ported to glibc-2.3.4 by steve@digidescorp.com ]
yann@1
    16
yann@1
    17
--- glibc-2.3.4/Makeconfig.orig	2004-12-15 12:51:47.000000000 -0600
yann@1
    18
+++ glibc-2.3.4/Makeconfig	2005-06-29 00:31:27.000000000 -0500
yann@1
    19
@@ -449,7 +449,7 @@
yann@1
    20
 # run the linked programs.
yann@1
    21
 link-libc = -Wl,-rpath-link=$(rpath-link) \
yann@1
    22
 	    $(common-objpfx)libc.so$(libc.so-version) \
yann@1
    23
-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
yann@1
    24
+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
yann@1
    25
 # This is how to find at build-time things that will be installed there.
yann@1
    26
 rpath-dirs = math elf dlfcn nss nis rt resolv crypt
yann@1
    27
 endif
yann@1
    28
@@ -667,7 +667,7 @@
yann@1
    29
 # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
yann@1
    30
 # to pass different flags for each flavor.
yann@1
    31
 libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
yann@1
    32
-all-object-suffixes := .o .os .op .og .ob .oS
yann@1
    33
+all-object-suffixes := .o .os .op .og .ob .oST
yann@1
    34
 object-suffixes :=
yann@1
    35
 CPPFLAGS-.o = $(pic-default)
yann@1
    36
 CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
yann@1
    37
@@ -723,14 +723,14 @@
yann@1
    38
 
yann@1
    39
 ifeq (yes,$(build-shared))
yann@1
    40
 # Build special library that contains the static-only routines for libc.
yann@1
    41
-object-suffixes-for-libc += .oS
yann@1
    42
+object-suffixes-for-libc += .oST
yann@1
    43
 
yann@1
    44
 # Must build the routines as PIC, though, because they can end up in (users')
yann@1
    45
 # shared objects.  We don't want to use CFLAGS-os because users may, for
yann@1
    46
 # example, make that processor-specific.
yann@1
    47
-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
yann@1
    48
-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
yann@1
    49
-libtype.oS = lib%_nonshared.a
yann@1
    50
+CFLAGS-.oST = $(CFLAGS-.o) $(pic-ccflag)
yann@1
    51
+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
yann@1
    52
+libtype.oST = lib%_nonshared.a
yann@1
    53
 endif
yann@1
    54
 
yann@1
    55
 # The assembler can generate debug information too.
yann@1
    56
--- glibc-2.3.4/Makerules.orig	2005-06-28 20:57:52.562500000 -0500
yann@1
    57
+++ glibc-2.3.4/Makerules	2005-06-29 00:27:21.328125000 -0500
yann@1
    58
@@ -416,7 +416,7 @@
yann@1
    59
 # Bounded pointer thunks are only built for *.ob
yann@1
    60
 elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
yann@1
    61
 
yann@1
    62
-elide-routines.oS += $(filter-out $(static-only-routines),\
yann@1
    63
+elide-routines.oST += $(filter-out $(static-only-routines),\
yann@1
    64
 				  $(routines) $(aux) $(sysdep_routines)) \
yann@1
    65
 		     $(elide-bp-thunks)
yann@1
    66
 elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
yann@1
    67
@@ -968,7 +968,7 @@
yann@1
    68
 install: $(inst_libdir)/libc.so
yann@1
    69
 $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
yann@1
    70
 			$(common-objpfx)libc.so$(libc.so-version) \
yann@1
    71
-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
yann@1
    72
+			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
yann@1
    73
 						  $(libprefix)$(libc-name)) \
yann@1
    74
 			$(+force)
yann@1
    75
 	(echo '/* GNU ld script';\
yann@1
    76
@@ -976,7 +976,7 @@
yann@1
    77
 	 echo '   the static library, so try that secondarily.  */';\
yann@1
    78
 	 cat $<; \
yann@1
    79
 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
yann@1
    80
-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
yann@1
    81
+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
yann@1
    82
 	      ')' \
yann@1
    83
 	) > $@.new
yann@1
    84
 	mv -f $@.new $@
yann@1
    85
diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
yann@1
    86
--- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
yann@1
    87
+++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
yann@1
    88
@@ -13,7 +13,7 @@
yann@1
    89
 
yann@1
    90
 ifneq (,$($(lib)-static-only-routines))
yann@1
    91
 ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
yann@1
    92
-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
yann@1
    93
+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
yann@1
    94
 endif
yann@1
    95
 endif
yann@1
    96
 
yann@1
    97
@@ -29,7 +29,7 @@
yann@1
    98
 
yann@1
    99
 # Add each flavor of library to the lists of things to build and install.
yann@1
   100
 install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
yann@1
   101
-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
yann@1
   102
+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
yann@1
   103
 			$(patsubst %,%$o,$(filter-out \
yann@1
   104
 					   $($(lib)-shared-only-routines),\
yann@1
   105
 					   $(all-$(lib)-routines))))
yann@1
   106
@@ -57,7 +57,7 @@
yann@1
   107
 
yann@1
   108
 
yann@1
   109
 # Use o-iterator.mk to generate a rule for each flavor of library.
yann@1
   110
-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
yann@1
   111
+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
yann@1
   112
 define o-iterator-doit
yann@1
   113
 $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
yann@1
   114
   $(patsubst %,$(objpfx)%$o,\
yann@1
   115
@@ -65,7 +65,7 @@
yann@1
   116
 			  $(all-$(lib)-routines))); \
yann@1
   117
 	$$(build-extra-lib)
yann@1
   118
 endef
yann@1
   119
-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
yann@1
   120
+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
yann@1
   121
 include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
yann@1
   122
 endif
yann@1
   123
 
yann@1
   124
@@ -77,9 +77,9 @@
yann@1
   125
 	$(build-extra-lib)
yann@1
   126
 endif
yann@1
   127
 
yann@1
   128
-ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
yann@1
   129
-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
yann@1
   130
-  $(patsubst %,$(objpfx)%.oS,\
yann@1
   131
+ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
yann@1
   132
+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
yann@1
   133
+  $(patsubst %,$(objpfx)%.oST,\
yann@1
   134
 	     $(filter $($(lib)-static-only-routines),\
yann@1
   135
 		      $(all-$(lib)-routines)))
yann@1
   136
 	$(build-extra-lib)
yann@1
   137
diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
yann@1
   138
--- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
yann@1
   139
+++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
yann@1
   140
@@ -360,7 +360,7 @@
yann@1
   141
 
yann@1
   142
 $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
yann@1
   143
 			      $(objpfx)libpthread.so$(libpthread.so-version) \
yann@1
   144
-			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
yann@1
   145
+			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
yann@1
   146
 							$(libprefix)pthread) \
yann@1
   147
 			      $(+force)
yann@1
   148
 	(echo '/* GNU ld script';\
yann@1
   149
@@ -368,7 +368,7 @@
yann@1
   150
 	 echo '   the static library, so try that secondarily.  */';\
yann@1
   151
 	 cat $<; \
yann@1
   152
 	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
yann@1
   153
-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
yann@1
   154
+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
yann@1
   155
 	      ')' \
yann@1
   156
 	) > $@.new
yann@1
   157
 	mv -f $@.new $@
yann@1
   158
diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
yann@1
   159
--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
yann@1
   160
+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
yann@1
   161
@@ -10,4 +10,4 @@
yann@1
   162
 ASFLAGS-.op += -Wa,-Av9a
yann@1
   163
 ASFLAGS-.og += -Wa,-Av9a
yann@1
   164
 ASFLAGS-.ob += -Wa,-Av9a
yann@1
   165
-ASFLAGS-.oS += -Wa,-Av9a
yann@1
   166
+ASFLAGS-.oST += -Wa,-Av9a