gcc: port missing patches from 4.6 to 4.8
[openwrt/svn-archive/archive.git] / toolchain / gcc / patches / 4.8.0 / 860-uclibc_use_eh_frame.patch
1 --- a/libgcc/crtstuff.c
2 +++ b/libgcc/crtstuff.c
3 @@ -100,15 +100,20 @@ call_ ## FUNC (void) \
4 #if defined(OBJECT_FORMAT_ELF) \
5 && !defined(OBJECT_FORMAT_FLAT) \
6 && defined(HAVE_LD_EH_FRAME_HDR) \
7 - && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
8 - && defined(__GLIBC__) && __GLIBC__ >= 2
9 + && !defined(inhibit_libc) && !defined(CRTSTUFFT_O)
10 #include <link.h>
11 /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
12 But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
13 -# if !defined(__UCLIBC__) \
14 - && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
15 - || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
16 -# define USE_PT_GNU_EH_FRAME
17 +# if defined(__UCLIBC__)
18 +# if (__UCLIBC_MAJOR__ > 0 || __UCLIBC_MINOR__ > 9 || \
19 + (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ >= 33))
20 +# define USE_PT_GNU_EH_FRAME
21 +# endif
22 +# elif defined(__GLIBC__)
23 +# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
24 + || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
25 +# define USE_PT_GNU_EH_FRAME
26 +# endif
27 # endif
28 #endif
29