patches/glibc/2.1.3/glibc-2.1.3-allow-gcc-3.4-fixup.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 dl-runtime.c:56: error: conflicting types for 'fixup'
     3 ../sysdeps/i386/dl-machine.h:158: error: previous declaration of 'fixup' was here
     4 when building with gcc-3.4.0
     5 
     6 First hunk:
     7 Define ARCH_FIXUP_ATTRIBUTE and use it in the fixup function declarations.
     8 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/dl-machine.h.diff?r1=1.124&r2=1.125&cvsroot=glibc
     9 [rediffed against glibc-2.1.3]
    10 
    11 Second hunk:
    12 If ARCH_FIXUP_ATTRIBUTE is not defined, provide dummy definition.
    13 Use macro in fixup function definitions.
    14 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/dl-runtime.c.diff?r1=1.64&r2=1.65&cvsroot=glibc
    15 [rediffed against glibc-2.3.2]
    16 
    17 ===================================================================
    18 --- glibc-2.1.3/sysdeps/i386/dl-machine.h.old	Sun Apr 11 18:58:45 2004
    19 +++ glibc-2.1.3/sysdeps/i386/dl-machine.h	Sun Apr 11 18:59:51 2004
    20 @@ -70,11 +70,14 @@
    21  
    22     We cannot use this scheme for profiling because the _mcount call
    23     destroys the passed register information.  */
    24 +
    25 +#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), unused))
    26 +
    27  static ElfW(Addr) fixup (struct link_map *l, ElfW(Word) reloc_offset)
    28 -     __attribute__ ((regparm (2), unused));
    29 +     ARCH_FIXUP_ATTRIBUTE;
    30  static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
    31  				 ElfW(Addr) retaddr)
    32 -     __attribute__ ((regparm (3), unused));
    33 +     ARCH_FIXUP_ATTRIBUTE;
    34  #endif
    35  
    36  /* Set up the loaded object described by L so its unrelocated PLT
    37 ===================================================================
    38 --- glibc-2.1.3/elf/dl-runtime.c~	Thu Jul 15 11:32:41 1999
    39 +++ glibc-2.1.3/elf/dl-runtime.c	Sun Apr 11 19:02:01 2004
    40 @@ -31,6 +31,12 @@
    41  # define VERSYMIDX(sym)	(DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (sym))
    42  #endif
    43  
    44 +/* The fixup functions might have need special attributes.  If none
    45 +   are provided define the macro as empty.  */
    46 +#ifndef ARCH_FIXUP_ATTRIBUTE
    47 +# define ARCH_FIXUP_ATTRIBUTE
    48 +#endif
    49 +
    50  
    51  /* This function is called through a special trampoline from the PLT the
    52     first time each PLT entry is called.  We must perform the relocation
    53 @@ -40,7 +46,7 @@
    54     function.  */
    55  
    56  #ifndef ELF_MACHINE_NO_PLT
    57 -static ElfW(Addr) __attribute__ ((unused))
    58 +static ElfW(Addr) __attribute__ ((unused)) ARCH_FIXUP_ATTRIBUTE
    59  fixup (
    60  # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
    61          ELF_MACHINE_RUNTIME_FIXUP_ARGS,
    62 @@ -105,7 +111,7 @@
    63  
    64  #if !defined PROF && !defined ELF_MACHINE_NO_PLT
    65  
    66 -static ElfW(Addr) __attribute__ ((unused))
    67 +static ElfW(Addr) __attribute__ ((unused)) ARCH_FIXUP_ATTRIBUTE
    68  profile_fixup (
    69  #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
    70         ELF_MACHINE_RUNTIME_FIXUP_ARGS,