patches/glibc/2.1.3/glibc-2.1.3-override.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 The error
     2 
     3 make[2]: *** [.../gcc-3.3.3-glibc-2.1.3/i686-unknown-linux-gnu/share/zoneinfo/Africa/Algiers] Segmentation fault
     4 make[2]: Leaving directory `.../gcc-3.3.3-glibc-2.1.3/glibc-2.1.3/timezone'
     5 make[1]: *** [timezone/subdir_install] Error 2
     6 
     7 is caused by glibc trying to run something it just compiled.
     8 A crude workaround for this was posted at
     9 http://lists.scratchbox.org/pipermail/scratchbox-users/2004-February/000018.html
    10 but the following patch lets you optionally override these programs at
    11 make time by setting environment variables 
    12   localedef_FOR_BUILD rpcgen_FOR_BUILD zic_FOR_BUILD
    13 and maybe a few others to point to versions of those programs
    14 that can run on the build machine.
    15 Thanks to http://groups.google.com/groups?selm=9012160052.AA23106%40kaos.ksr.com
    16 for pointing out the idiom for inline $(ifdef ...) in GNU Make.
    17 
    18 Dan Kegel 2004-05-17
    19 
    20 --- glibc-2.1.3/Makeconfig.old	1999-11-29 11:19:20.000000000 -0800
    21 +++ glibc-2.1.3/Makeconfig	2004-05-17 15:57:53.000000000 -0700
    22 @@ -470,20 +470,24 @@
    23  # The program binary is assumed to be $(word 2,$^).
    24  built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
    25  ifneq (yes,$(build-shared))
    26 -built-program-cmd = $(built-program-file)
    27 +built-program-real = $(built-program-file)
    28  else
    29  comma = ,
    30  sysdep-library-path = \
    31  $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
    32  				       $(filter -Wl$(comma)-rpath-link=%,\
    33  						$(sysdep-LDFLAGS)))))
    34 -define built-program-cmd
    35 +define built-program-real
    36  $(elf-objpfx)$(rtld-installed-name) \
    37  	--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
    38  	$(built-program-file)
    39  endef
    40  endif
    41  
    42 +# If user set foo_FOR_BUILD, use that instead of actually running the program we just linked.
    43 +built-program-override-name = $(notdir $(word 2,$^))_FOR_BUILD
    44 +built-program-cmd = $(if $(findstring undefined,$(origin $(built-program-override-name))),$(built-program-real),$($(built-program-override-name)))
    45 +
    46  ifndef LD
    47  LD := ld -X
    48  endif