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]

[PATCH] Add inhibit_libc check to unwind-dw2.c include of MD_UNWIND_SUPPORT


The include of MD_UNWIND_SUPPORT (linux-unwind.h) will cause a build failure
due to missing header files in the situation where inhibit_libc is set. Currently i386
and mips work around that by using ifndef inhib_libc to exclude the entire contents
of linux-unwind.h, but several other targets such as alpha fail to build that configuration.
Move the check to a more central location. If/when the unwind structures are copied
into gcc this can be removed. If this is acceptable, I'll follow up with patches to
remove the i386/mips specific hacks that have been there forever.


diff -uprN gcc-4.2.1-stock/gcc/unwind-dw2.c gcc-4.2.1/gcc/unwind-dw2.c
--- gcc-4.2.1-stock/gcc/unwind-dw2.c    2007-01-25 01:13:44.000000000 -0600
+++ gcc-4.2.1/gcc/unwind-dw2.c  2007-08-28 10:49:39.000000000 -0500
@@ -335,8 +335,11 @@ _Unwind_GetTextRelBase (struct _Unwind_C
#endif

#ifdef MD_UNWIND_SUPPORT
+/* This will not work without libc support */
+#ifndef inhibit_libc
#include MD_UNWIND_SUPPORT
#endif
+#endif
^L
/* Extract any interesting information from the CIE for the translation
  unit F belongs to.  Return a pointer to the byte after the augmentation,

Patch also attached if this review copy is mangled
diff -uprN gcc-4.2.1-stock/gcc/unwind-dw2.c gcc-4.2.1/gcc/unwind-dw2.c
--- gcc-4.2.1-stock/gcc/unwind-dw2.c	2007-01-25 01:13:44.000000000 -0600
+++ gcc-4.2.1/gcc/unwind-dw2.c	2007-08-28 10:49:39.000000000 -0500
@@ -335,8 +335,11 @@ _Unwind_GetTextRelBase (struct _Unwind_C
 #endif
 
 #ifdef MD_UNWIND_SUPPORT
+/* This will not work without libc support */
+#ifndef inhibit_libc
 #include MD_UNWIND_SUPPORT
 #endif
+#endif
 
 /* Extract any interesting information from the CIE for the translation
    unit F belongs to.  Return a pointer to the byte after the augmentation,

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