This is the mail archive of the
mailing list for the glibc project.
[PATCH] Fix building glibc for arches using sjlj exceptions.
- From: Carlos O'Donell <carlos at baldric dot uwo dot ca>
- To: libc-alpha <libc-alpha at sources dot redhat dot com>
- Date: Thu, 19 Feb 2004 23:41:55 -0500
- Subject: [PATCH] Fix building glibc for arches using sjlj exceptions.
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
Tested on i386, ia64 and hppa, without regressions.
2004-02-19 Carlos O'Donell <email@example.com>
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
= (framesf) __libc_dlsym (handle, "__frame_state_for")) == NULL)
frame_state_for = fallback_frame_state_for;
+ frame_state_for = abort;
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 @@
#define STACK_GROWS_DOWNWARD 0
@@ -1287,4 +1286,3 @@
#endif /* _LIBC */
-#endif /* !USING_SJLJ_EXCEPTIONS */