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