This is the mail archive of the mailing list for the glibc 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] 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
so small...

Please apply.

Tested on i386, ia64 and hppa, without regressions.


2004-02-19  Carlos O'Donell  <>

	* 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)
 	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 @@
@@ -1287,4 +1286,3 @@
 #include ""
 #endif /* _LIBC */

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