patches/glibc/2.3.2/glibc-2.3.2-cygwin.patch
changeset 301 2be7232a73ac
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.2/glibc-2.3.2-cygwin.patch	Sat Jul 28 21:34:41 2007 +0000
     1.3 @@ -0,0 +1,90 @@
     1.4 +Fixes
     1.5 +elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
     1.6 +...
     1.7 +when building glibc-2.3.2 on cygwin
     1.8 +
     1.9 +Idea from
    1.10 +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
    1.11 +Basically, make glibc use .oST as suffix for 'object static'
    1.12 +instead of .oS, since cygwin has trouble distinguishing .os from .oS
    1.13 +(Original patch had .on, but .oST is more mnemonic for 'object static')
    1.14 +
    1.15 +glibc-linuxthreads-2.3.2 also requires a patch, see 
    1.16 +../glibc-linuxthreads-2.3.2/glibc-linuxthreads-2.3.2-cygwin.patch
    1.17 +
    1.18 +
    1.19 +--- glibc-2.3.2/Makeconfig.orig	2003-01-05 21:31:36.000000000 -0800
    1.20 ++++ glibc-2.3.2/Makeconfig	2004-03-13 23:42:03.781250000 -0800
    1.21 +@@ -433,13 +433,13 @@
    1.22 + # run the linked programs.
    1.23 + link-libc = -Wl,-rpath-link=$(rpath-link) \
    1.24 + 	    $(common-objpfx)libc.so$(libc.so-version) \
    1.25 +-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
    1.26 ++	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
    1.27 + # This is how to find at build-time things that will be installed there.
    1.28 + rpath-dirs = math elf dlfcn nss nis rt resolv crypt
    1.29 + else
    1.30 + ifneq (,$(filter aix aix%,$(config-os)))
    1.31 + link-libc = $(common-objpfx)libc.a \
    1.32 +-	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
    1.33 ++	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
    1.34 + rpath-dirs = math dlfcn nss nis rt resolv crypt
    1.35 + endif
    1.36 + endif
    1.37 +@@ -652,7 +652,7 @@
    1.38 + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
    1.39 + # to pass different flags for each flavor.
    1.40 + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
    1.41 +-all-object-suffixes := .o .os .op .og .ob .oS
    1.42 ++all-object-suffixes := .o .os .op .og .ob .oST
    1.43 + object-suffixes :=
    1.44 + CPPFLAGS-.o = $(pic-default)
    1.45 + CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
    1.46 +@@ -706,14 +706,14 @@
    1.47 + 
    1.48 + ifeq (yes,$(build-shared))
    1.49 + # Build special library that contains the static-only routines for libc.
    1.50 +-object-suffixes-for-libc += .oS
    1.51 ++object-suffixes-for-libc += .oST
    1.52 + 
    1.53 + # Must build the routines as PIC, though, because they can end up in (users')
    1.54 + # shared objects.  We don't want to use CFLAGS-os because users may, for
    1.55 + # example, make that processor-specific.
    1.56 +-CFLAGS-.oS = $(CFLAGS-.o) $(pic-ccflag)
    1.57 +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
    1.58 +-libtype.oS = lib%_nonshared.a
    1.59 ++CFLAGS-.oST = $(CFLAGS-.o) $(pic-ccflag)
    1.60 ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
    1.61 ++libtype.oST = lib%_nonshared.a
    1.62 + endif
    1.63 + 
    1.64 + 
    1.65 +--- glibc-2.3.2/Makerules.orig	2003-02-22 15:23:31.000000000 -0800
    1.66 ++++ glibc-2.3.2/Makerules	2004-03-13 23:43:40.984375000 -0800
    1.67 +@@ -446,7 +446,7 @@
    1.68 + # Bounded pointer thunks are only built for *.ob
    1.69 + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
    1.70 + 
    1.71 +-elide-routines.oS += $(filter-out $(static-only-routines),\
    1.72 ++elide-routines.oST += $(filter-out $(static-only-routines),\
    1.73 + 				  $(routines) $(aux) $(sysdep_routines)) \
    1.74 + 		     $(elide-bp-thunks)
    1.75 + elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
    1.76 +@@ -958,7 +958,7 @@
    1.77 + install: $(inst_libdir)/libc.so
    1.78 + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
    1.79 + 			$(common-objpfx)libc.so$(libc.so-version) \
    1.80 +-			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
    1.81 ++			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
    1.82 + 						  $(libprefix)$(libc-name)) \
    1.83 + 			$(+force)
    1.84 + 	(echo '/* GNU ld script';\
    1.85 +@@ -966,7 +966,7 @@
    1.86 + 	 echo '   the static library, so try that secondarily.  */';\
    1.87 + 	 cat $<; \
    1.88 + 	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
    1.89 +-	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
    1.90 ++	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
    1.91 + 	      ')' \
    1.92 + 	) > $@.new
    1.93 + 	mv -f $@.new $@