patches/glibc/2.1.3/glibc-2.1.3-cygwin.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 28 21:34:41 2007 +0000 (2007-07-28)
changeset 301 2be7232a73ac
permissions -rw-r--r--
Bump version to 0.2.2.
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.1.3 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
backported to glibc-2.1.3.
yann@1
     9
Basically, make glibc use .oST as suffix for 'object static'
yann@1
    10
instead of .oS, since cygwin has trouble distinguishing .os from .oS
yann@1
    11
(Original patch had .on, but .oST is more mnemonic for 'object static')
yann@1
    12
yann@1
    13
yann@1
    14
--- glibc-2.1.3/Makeconfig.old 	1999-11-29 11:19:20.000000000 -0800
yann@1
    15
+++ glibc-2.1.3/Makeconfig	2004-03-14 16:38:43.218750000 -0800
yann@1
    16
@@ -406,7 +406,7 @@
yann@1
    17
 # run the linked programs.
yann@1
    18
 link-libc = -Wl,-rpath-link=$(rpath-link) \
yann@1
    19
 	    $(common-objpfx)libc.so$(libc.so-version) \
yann@1
    20
-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
yann@1
    21
+	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
yann@1
    22
 # Choose the default search path for the dynamic linker based on
yann@1
    23
 # where we will install libraries.
yann@1
    24
 ifneq ($(libdir),$(slibdir))
yann@1
    25
@@ -586,7 +586,7 @@
yann@1
    26
 # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
yann@1
    27
 # to pass different flags for each flavor.
yann@1
    28
 libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
yann@1
    29
-all-object-suffixes := .o .os .op .og .ob .oS
yann@1
    30
+all-object-suffixes := .o .os .op .og .ob .oST
yann@1
    31
 object-suffixes :=
yann@1
    32
 CPPFLAGS-.o = $(pic-default)
yann@1
    33
 CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
yann@1
    34
@@ -636,14 +636,14 @@
yann@1
    35
 
yann@1
    36
 ifeq (yes,$(build-shared))
yann@1
    37
 # Build special library that contains the static-only routines for libc.
yann@1
    38
-object-suffixes-for-libc += .oS
yann@1
    39
+object-suffixes-for-libc += .oST
yann@1
    40
 
yann@1
    41
 # Must build the routines as PIC, though, because they can end up in (users')
yann@1
    42
 # shared objects.  We don't want to use CFLAGS-os because users may, for
yann@1
    43
 # example, make that processor-specific.
yann@1
    44
-CFLAGS-.oS = $(CFLAGS-.o) $(pic-ccflag)
yann@1
    45
-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC
yann@1
    46
-libtype.oS = lib%_nonshared.a
yann@1
    47
+CFLAGS-.oST = $(CFLAGS-.o) $(pic-ccflag)
yann@1
    48
+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC
yann@1
    49
+libtype.oST = lib%_nonshared.a
yann@1
    50
 endif
yann@1
    51
 
yann@1
    52
 
yann@1
    53
--- glibc-2.1.3/Makerules.old 	1999-08-01 15:12:23.000000000 -0700
yann@1
    54
+++ glibc-2.1.3/Makerules	2004-03-14 16:39:07.906250000 -0800
yann@1
    55
@@ -386,7 +386,7 @@
yann@1
    56
 static-only-routines =
yann@1
    57
 endif
yann@1
    58
 
yann@1
    59
-elide-routines.oS += $(filter-out $(static-only-routines),\
yann@1
    60
+elide-routines.oST += $(filter-out $(static-only-routines),\
yann@1
    61
 				  $(routines) $(aux) $(sysdep_routines))
yann@1
    62
 elide-routines.os += $(static-only-routines)
yann@1
    63
 
yann@1
    64
@@ -694,14 +694,14 @@
yann@1
    65
 # of the files are taken by the linker.
yann@1
    66
 install: $(inst_libdir)/libc.so
yann@1
    67
 $(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
yann@1
    68
-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
yann@1
    69
+			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
yann@1
    70
 						  $(libprefix)$(libc-name)) \
yann@1
    71
 			$(+force)
yann@1
    72
 	(echo '/* GNU ld script';\
yann@1
    73
 	 echo '   Use the shared library, but some functions are only in';\
yann@1
    74
 	 echo '   the static library, so try that secondarily.  */';\
yann@1
    75
 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
yann@1
    76
-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
yann@1
    77
+	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
yann@1
    78
 	      ')' \
yann@1
    79
 	) > $@.new
yann@1
    80
 	mv -f $@.new $@