[PATCH] Fix building glibc for arches using sjlj exceptions.
Carlos O'Donell
carlos@baldric.uwo.ca
Fri Feb 20 04:42:00 GMT 2004
libc-alpha,
There was some contention over these patches in the past. I will attempt
to set that to rest with some clear reasoning.
If the compiler is built with dwarf2 support, it cannot be built with
sjlj, and __USING_SJLJ_EXCEPTIONS__ is always undefined.
The first patch changes the fallback of "frame_state_for" to abort when
the compiler does not support dwarf2 exception handling.
The second patch removes a spurious '#ifndef __USING_SJLJ_EXCEPTIONS__'
wrapper. It is spurious because we are building compat dwarf2 code, and
we only use compat dwarf2 code with a dwarf2 supporting compiler, thus
__USING_SJLJ_EXCEPTIONS__ is always undefined. However, by removing that
wrapper, arches that use sjlj can still *build* the compat code, but
will never actually use it.
Two small changes that allow arches using sjlj to compile glibc.
Last time you said "go fix your compiler," we have dwarf2, some people
still choose to compile with sjlj until all the C++ stuff is sorted.
I'm a person who likes supporting users, especially when the changes are
so small...
Please apply.
Tested on i386, ia64 and hppa, without regressions.
Cheers,
c.
2004-02-19 Carlos O'Donell <carlos@baldric.uwo.ca>
* sysdeps/generic/framestate.c
(__frame_state_for)[__USING_SJLJ_EXCEPTIONS__]: Set
frame_State_for to abort if the compiler is using sjlj.
* sysdeps/generic/unwind-dw2.c: Allow sjlj enabled compilers to
build the code by removing __USING_SJLJ_EXCEPTIONS__ wrapper.
--- libc-orig/sysdeps/generic/framestate.c 2003-01-08 01:46:06.000000000 -0500
+++ libc/sysdeps/generic/framestate.c 2003-12-08 21:25:00.000000000 -0500
@@ -41,7 +41,11 @@
if (handle == NULL
|| (frame_state_for
= (framesf) __libc_dlsym (handle, "__frame_state_for")) == NULL)
+#ifndef __USING_SJLJ_EXCEPTIONS__
frame_state_for = fallback_frame_state_for;
+#else
+ frame_state_for = abort;
+#endif
}
return frame_state_for (pc, frame_state);
--- libc-orig/sysdeps/generic/unwind-dw2.c 2003-07-22 19:55:55.000000000 -0400
+++ libc/sysdeps/generic/unwind-dw2.c 2003-12-08 21:25:00.000000000 -0500
@@ -39,7 +39,6 @@
#endif
-#ifndef __USING_SJLJ_EXCEPTIONS__
#ifndef STACK_GROWS_DOWNWARD
#define STACK_GROWS_DOWNWARD 0
@@ -1287,4 +1286,3 @@
#include "unwind.inc"
#endif /* _LIBC */
-#endif /* !USING_SJLJ_EXCEPTIONS */
More information about the Libc-alpha
mailing list