[Bug ada/20226] [4.0/4.1 Regression] Error in __gnat_install_SEH_handler breaks bootstrap

dannysmith at users dot sourceforge dot net gcc-bugzilla@gcc.gnu.org
Tue Mar 1 04:49:00 GMT 2005


------- Additional Comments From dannysmith at users dot sourceforge dot net  2005-03-01 04:49 -------
The problem appears to be that the file stage1/ada/b_gnatb.c built by the 
bootstrap gnatbind doesn't define the ponter to the exception registration 
structure (SEH).  This :

int SEH [2];

and
 __gnat_initialize ((void *)SEH);

should be generated (and is in stage2 ) by the new bindgen.adb but the old 
gnatbind doesn't have that.

I was able to get bootstap to complete by this hack to ada/init.c

*** init.c.orig	Fri Feb 25 19:57:42 2005
--- init.c	Mon Feb 28 22:18:39 2005
*************** __gnat_initialize (void *eh ATTRIBUTE_UN
*** 836,842 ****
     __gnat_plist_init();
  
     /* Install the Structured Exception handler.  */
!    if (eh)
       __gnat_install_SEH_handler (eh);
  }
  
--- 836,842 ----
     __gnat_plist_init();
  
     /* Install the Structured Exception handler.  */
!    if (eh && eh != (void*)((DWORD)-1))
       __gnat_install_SEH_handler (eh);
  }
  

(gdb said that the ER was 0xffffffff. Setting *ER caused the segfault.

Must be a better way).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20226



More information about the Gcc-bugs mailing list