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