This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Don't define USE_PT_GNU_EH_FRAME when using uClibc


When building a cross compiler with --with-sysroot option,
inhibit_libc is not defined. GCC checks if PT_GNU_EH_FRAME can be used
by looking at __GLIBC__ and __GLIBC_MINOR__. If glibc version > 2.2,
or glibc version == 2.2 and DT_CONFIG is defined, USE_PT_GNU_EH_FRAME
will be defined. Unfortunately, uClibc pretends to be glibc 2.2 and
has DT_CONFIG defined in its link.h, but does not use PT_GNU_EH_FRAME.
This causes many exception handling test cases fail in gcc testsuite
for bfin port. This patch should fix it.

Is it OK?

Thanks,
Jie
	* crtstuff.c (USE_PT_GNU_EH_FRAME): Not define for if __UCLIBC__
	is defined.

Index: crtstuff.c
===================================================================
RCS file: /cvsroot/gcc3/gcc-4.1/gcc/crtstuff.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 crtstuff.c
--- crtstuff.c	11 Mar 2006 14:04:37 -0000	1.1.1.1
+++ crtstuff.c	15 Jun 2006 04:08:41 -0000
@@ -90,8 +90,11 @@
     && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
     && defined(__GLIBC__) && __GLIBC__ >= 2
 #include <link.h>
-# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-     || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+/* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+   But it doesn't use PT_GNU_EH_FRAME ELF segment currently.  */
+# if !defined(__UCLIBC__) \
+     && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+	 || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
 #  define USE_PT_GNU_EH_FRAME
 # endif
 #endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]