patches/glibc/2.3.4/glibc-2.3.4-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... :-(
     1 Fixes
     2 elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
     3 ...
     4 when building glibc-2.3.4 on cygwin
     5 
     6 Idea from
     7 http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
     8 Basically, make glibc use .oST as suffix for 'object static'
     9 instead of .oS, since cygwin has trouble distinguishing .os from .oS
    10 (Original patch had .on, but .oST is more mnemonic for 'object static')
    11 
    12 glibc-linuxthreads-2.3.4 also requires a patch, see 
    13 ../glibc-linuxthreads-2.3.4/glibc-linuxthreads-2.3.4-cygwin.patch
    14 
    15 [ Ported to glibc-2.3.4 by steve@digidescorp.com ]
    16 
    17 --- glibc-2.3.4/Makeconfig.orig	2004-12-15 12:51:47.000000000 -0600
    18 +++ glibc-2.3.4/Makeconfig	2005-06-29 00:31:27.000000000 -0500
    19 @@ -449,7 +449,7 @@
    20  # run the linked programs.
    21  link-libc = -Wl,-rpath-link=$(rpath-link) \
    22  	    $(common-objpfx)libc.so$(libc.so-version) \
    23 -	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
    24 +	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
    25  # This is how to find at build-time things that will be installed there.
    26  rpath-dirs = math elf dlfcn nss nis rt resolv crypt
    27  endif
    28 @@ -667,7 +667,7 @@
    29  # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
    30  # to pass different flags for each flavor.
    31  libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
    32 -all-object-suffixes := .o .os .op .og .ob .oS
    33 +all-object-suffixes := .o .os .op .og .ob .oST
    34  object-suffixes :=
    35  CPPFLAGS-.o = $(pic-default)
    36  CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
    37 @@ -723,14 +723,14 @@
    38  
    39  ifeq (yes,$(build-shared))
    40  # Build special library that contains the static-only routines for libc.
    41 -object-suffixes-for-libc += .oS
    42 +object-suffixes-for-libc += .oST
    43  
    44  # Must build the routines as PIC, though, because they can end up in (users')
    45  # shared objects.  We don't want to use CFLAGS-os because users may, for
    46  # example, make that processor-specific.
    47 -CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
    48 -CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
    49 -libtype.oS = lib%_nonshared.a
    50 +CFLAGS-.oST = $(CFLAGS-.o) $(pic-ccflag)
    51 +CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
    52 +libtype.oST = lib%_nonshared.a
    53  endif
    54  
    55  # The assembler can generate debug information too.
    56 --- glibc-2.3.4/Makerules.orig	2005-06-28 20:57:52.562500000 -0500
    57 +++ glibc-2.3.4/Makerules	2005-06-29 00:27:21.328125000 -0500
    58 @@ -416,7 +416,7 @@
    59  # Bounded pointer thunks are only built for *.ob
    60  elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
    61  
    62 -elide-routines.oS += $(filter-out $(static-only-routines),\
    63 +elide-routines.oST += $(filter-out $(static-only-routines),\
    64  				  $(routines) $(aux) $(sysdep_routines)) \
    65  		     $(elide-bp-thunks)
    66  elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
    67 @@ -968,7 +968,7 @@
    68  install: $(inst_libdir)/libc.so
    69  $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
    70  			$(common-objpfx)libc.so$(libc.so-version) \
    71 -			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
    72 +			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
    73  						  $(libprefix)$(libc-name)) \
    74  			$(+force)
    75  	(echo '/* GNU ld script';\
    76 @@ -976,7 +976,7 @@
    77  	 echo '   the static library, so try that secondarily.  */';\
    78  	 cat $<; \
    79  	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
    80 -	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
    81 +	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
    82  	      ')' \
    83  	) > $@.new
    84  	mv -f $@.new $@
    85 diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk
    86 --- glibc-2.3.5/extra-lib.mk	2004-12-02 23:54:47.000000000 +0100
    87 +++ glibc-2.3.5-cygwin/extra-lib.mk	2005-05-11 08:27:28.156250000 +0200
    88 @@ -13,7 +13,7 @@
    89  
    90  ifneq (,$($(lib)-static-only-routines))
    91  ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version)))
    92 -object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS)
    93 +object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST)
    94  endif
    95  endif
    96  
    97 @@ -29,7 +29,7 @@
    98  
    99  # Add each flavor of library to the lists of things to build and install.
   100  install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
   101 -extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\
   102 +extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\
   103  			$(patsubst %,%$o,$(filter-out \
   104  					   $($(lib)-shared-only-routines),\
   105  					   $(all-$(lib)-routines))))
   106 @@ -57,7 +57,7 @@
   107  
   108  
   109  # Use o-iterator.mk to generate a rule for each flavor of library.
   110 -ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib))))
   111 +ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib))))
   112  define o-iterator-doit
   113  $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \
   114    $(patsubst %,$(objpfx)%$o,\
   115 @@ -65,7 +65,7 @@
   116  			  $(all-$(lib)-routines))); \
   117  	$$(build-extra-lib)
   118  endef
   119 -object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib)))
   120 +object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib)))
   121  include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
   122  endif
   123  
   124 @@ -77,9 +77,9 @@
   125  	$(build-extra-lib)
   126  endif
   127  
   128 -ifneq (,$(filter .oS,$(object-suffixes-$(lib))))
   129 -$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \
   130 -  $(patsubst %,$(objpfx)%.oS,\
   131 +ifneq (,$(filter .oST,$(object-suffixes-$(lib))))
   132 +$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \
   133 +  $(patsubst %,$(objpfx)%.oST,\
   134  	     $(filter $($(lib)-static-only-routines),\
   135  		      $(all-$(lib)-routines)))
   136  	$(build-extra-lib)
   137 diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile
   138 --- glibc-2.3.5/nptl/Makefile	2005-02-16 09:45:56.000000000 +0100
   139 +++ glibc-2.3.5-cygwin/nptl/Makefile	2005-05-11 08:26:01.812500000 +0200
   140 @@ -360,7 +360,7 @@
   141  
   142  $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \
   143  			      $(objpfx)libpthread.so$(libpthread.so-version) \
   144 -			      $(inst_libdir)/$(patsubst %,$(libtype.oS),\
   145 +			      $(inst_libdir)/$(patsubst %,$(libtype.oST),\
   146  							$(libprefix)pthread) \
   147  			      $(+force)
   148  	(echo '/* GNU ld script';\
   149 @@ -368,7 +368,7 @@
   150  	 echo '   the static library, so try that secondarily.  */';\
   151  	 cat $<; \
   152  	 echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \
   153 -	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\
   154 +	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\
   155  	      ')' \
   156  	) > $@.new
   157  	mv -f $@.new $@
   158 diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
   159 --- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile	2004-08-16 08:46:14.000000000 +0200
   160 +++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile	2005-05-11 08:26:25.937500000 +0200
   161 @@ -10,4 +10,4 @@
   162  ASFLAGS-.op += -Wa,-Av9a
   163  ASFLAGS-.og += -Wa,-Av9a
   164  ASFLAGS-.ob += -Wa,-Av9a
   165 -ASFLAGS-.oS += -Wa,-Av9a
   166 +ASFLAGS-.oST += -Wa,-Av9a