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