patches/glibc/2.2.5/glibc-2.2.5-cygwin.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
     1 Fixes
     2 elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
     3 ...
     4 when building glibc-2.3.2 on cygwin
     5 
     6 Idea from
     7 http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
     8 forward ported to glibc-2.3.2.
     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 diff -Naur from-cvs/Makeconfig patched/Makeconfig
    15 --- from-cvs/Makeconfig	Fri Jan 11 14:40:35 2002
    16 +++ patched/Makeconfig	Fri Jan 11 15:07:30 2002
    17 @@ -439,13 +439,13 @@
    18  # run the linked programs.
    19  link-libc = -Wl,-rpath-link=$(rpath-link) \
    20  	    $(common-objpfx)libc.so$(libc.so-version) \
    21 -	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
    22 +	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
    23  # This is how to find at build-time things that will be installed there.
    24  rpath-dirs = math elf dlfcn nss nis rt resolv crypt
    25  else
    26  ifneq (,$(findstring aix,$(config-os)))
    27  link-libc = $(common-objpfx)libc.a \
    28 -	    $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
    29 +	    $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
    30  rpath-dirs = math dlfcn nss nis rt resolv crypt
    31  endif
    32  endif
    33 @@ -649,7 +649,7 @@
    34  # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
    35  # to pass different flags for each flavor.
    36  libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
    37 -all-object-suffixes := .o .os .op .og .ob .oS
    38 +all-object-suffixes := .o .os .op .og .ob .oST
    39  object-suffixes :=
    40  CPPFLAGS-.o = $(pic-default)
    41  CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
    42 @@ -703,14 +703,14 @@
    43  
    44  ifeq (yes,$(build-shared))
    45  # Build special library that contains the static-only routines for libc.
    46 -object-suffixes-for-libc += .oS
    47 +object-suffixes-for-libc += .oST
    48  
    49  # Must build the routines as PIC, though, because they can end up in (users')
    50  # shared objects.  We don't want to use CFLAGS-os because users may, for
    51  # example, make that processor-specific.
    52 -CFLAGS-.oS = $(CFLAGS-.o) $(pic-ccflag)
    53 -CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC
    54 -libtype.oS = lib%_nonshared.a
    55 +CFLAGS-.oST = $(CFLAGS-.o) $(pic-ccflag)
    56 +CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC
    57 +libtype.oST = lib%_nonshared.a
    58  endif
    59  
    60  
    61 diff -Naur from-cvs/Makerules patched/Makerules
    62 --- from-cvs/Makerules	Fri Jan 11 14:40:42 2002
    63 +++ patched/Makerules	Fri Jan 11 15:06:00 2002
    64 @@ -361,7 +361,7 @@
    65  # Bounded pointer thunks are only built for *.ob
    66  elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
    67  
    68 -elide-routines.oS += $(filter-out $(static-only-routines),\
    69 +elide-routines.oST += $(filter-out $(static-only-routines),\
    70  				  $(routines) $(aux) $(sysdep_routines)) \
    71  		     $(elide-bp-thunks)
    72  elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
    73 @@ -842,14 +842,14 @@
    74  # of the files are taken by the linker.
    75  install: $(inst_libdir)/libc.so
    76  $(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
    77 -			$(inst_libdir)/$(patsubst %,$(libtype.oS),\
    78 +			$(inst_libdir)/$(patsubst %,$(libtype.oST),\
    79  						  $(libprefix)$(libc-name)) \
    80  			$(+force)
    81  	(echo '/* GNU ld script';\
    82  	 echo '   Use the shared library, but some functions are only in';\
    83  	 echo '   the static library, so try that secondarily.  */';\
    84  	 echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
    85 -	      '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
    86 +	      '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
    87  	      ')' \
    88  	) > $@.new
    89  	mv -f $@.new $@