patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-2.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-2.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,53 @@
     1.4 +Fixes
     1.5 +
     1.6 +In file included from dynamic-link.h:310,
     1.7 +                 from dl-reloc.c:265:
     1.8 +do-rel.h:56: error: invalid storage class for function 'elf_dynamic_do_rela'
     1.9 +In file included from dl-reloc.c:265:
    1.10 +dynamic-link.h: In function '_dl_relocate_object':
    1.11 +dynamic-link.h:33: error: invalid storage class for function 'elf_get_dynamic_info'
    1.12 +
    1.13 +when building glibc-2.3.3 with gcc-4.0
    1.14 +2nd hunk is like http://sourceware.org/cgi-bin/cvsweb.cgi/libc/elf/dynamic-link.h.diff?r1=1.50&r2=1.51&cvsroot=glibc
    1.15 +but works with older compilers, too
    1.16 +
    1.17 +--- glibc-2.3.3/elf/do-rel.h.old	2005-03-16 13:09:37.000000000 -0800
    1.18 ++++ glibc-2.3.3/elf/do-rel.h	2005-03-16 13:10:50.000000000 -0800
    1.19 +@@ -49,7 +49,14 @@
    1.20 +    relocations; they should be set up to call _dl_runtime_resolve, rather
    1.21 +    than fully resolved now.  */
    1.22 + 
    1.23 +-static inline void __attribute__ ((always_inline))
    1.24 ++#if __GNUC__ >= 4
    1.25 ++  auto inline void
    1.26 ++#else
    1.27 ++  static inline void
    1.28 ++#endif
    1.29 ++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
    1.30 ++  __attribute ((always_inline))
    1.31 ++#endif
    1.32 + elf_dynamic_do_rel (struct link_map *map,
    1.33 + 		    ElfW(Addr) reladdr, ElfW(Addr) relsize,
    1.34 + 		    int lazy)
    1.35 +--- glibc-2.3.3/elf/dynamic-link.h.old	2005-03-16 13:22:35.000000000 -0800
    1.36 ++++ glibc-2.3.3/elf/dynamic-link.h	2005-03-16 13:26:23.000000000 -0800
    1.37 +@@ -27,8 +27,17 @@
    1.38 + 
    1.39 + 
    1.40 + /* Read the dynamic section at DYN and fill in INFO with indices DT_*.  */
    1.41 +-
    1.42 +-static inline void __attribute__ ((unused, always_inline))
    1.43 ++#if !defined(RESOLVE) || __GNUC__ < 4
    1.44 ++static
    1.45 ++#else
    1.46 ++auto
    1.47 ++#endif
    1.48 ++inline void 
    1.49 ++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
    1.50 ++  __attribute__ ((unused, always_inline))
    1.51 ++#else
    1.52 ++  __attribute__ ((unused))
    1.53 ++#endif
    1.54 + elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
    1.55 + {
    1.56 +   ElfW(Dyn) *dyn = l->l_ld;