patches/glibc/2.3.2/glibc-2.3.2-override.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.
yann@1
     1
The error
yann@1
     2
yann@1
     3
make[2]: *** [.../gcc-3.3.3-glibc-2.1.3/i686-unknown-linux-gnu/share/zoneinfo/Africa/Algiers] Segmentation fault
yann@1
     4
make[2]: Leaving directory `.../gcc-3.3.3-glibc-2.1.3/glibc-2.1.3/timezone'
yann@1
     5
make[1]: *** [timezone/subdir_install] Error 2
yann@1
     6
yann@1
     7
is caused by glibc trying to run something it just compiled.
yann@1
     8
A crude workaround for this was posted at
yann@1
     9
http://lists.scratchbox.org/pipermail/scratchbox-users/2004-February/000018.html
yann@1
    10
but the following patch lets you optionally override these programs at
yann@1
    11
make time by setting Make variables 
yann@1
    12
  localedef_FOR_BUILD rpcgen_FOR_BUILD zic_FOR_BUILD
yann@1
    13
and maybe a few others to point to versions of those programs
yann@1
    14
that can run on the build machine.
yann@1
    15
Thanks to http://groups.google.com/groups?selm=9012160052.AA23106%40kaos.ksr.com
yann@1
    16
for pointing out the idiom for inline $(ifdef ...) in GNU Make.
yann@1
    17
yann@1
    18
Dan Kegel 2004-05-17
yann@1
    19
[rediffed for glibc-2.3.2]
yann@1
    20
[typos corrected - those are make variables, not environment variables,
yann@1
    21
 and it's $(built-program-override-name), not $(build-program-override-name)]
yann@1
    22
yann@1
    23
--- glibc-2.3.2/Makeconfig.old	2004-05-17 13:53:46.000000000 -0700
yann@1
    24
+++ glibc-2.3.2/Makeconfig	2004-05-17 14:09:59.000000000 -0700
yann@1
    25
@@ -534,9 +534,12 @@
yann@1
    26
 run-program-prefix =
yann@1
    27
 endif
yann@1
    28
 # Never use $(run-program-prefix) for the statically-linked %-bp test programs
yann@1
    29
-built-program-cmd = $(patsubst %,$(run-program-prefix),\
yann@1
    30
+built-program-real = $(patsubst %,$(run-program-prefix),\
yann@1
    31
 			$(filter-out %-bp,$(built-program-file))) \
yann@1
    32
 		    $(built-program-file)
yann@1
    33
+# If user set foo_FOR_BUILD, use that instead of actually running the program we just linked.
yann@1
    34
+built-program-override-name = $(notdir $(word 2,$^))_FOR_BUILD
yann@1
    35
+built-program-cmd = $(if $(findstring undefined,$(origin $(built-program-override-name))),$(built-program-real),$($(built-program-override-name)))
yann@1
    36
 
yann@1
    37
 ifndef LD
yann@1
    38
 LD := ld -X