Hi,

due to recent discussion on the basic asm, and the special handling of 
ASM_INPUT in ia64, I tried to build a bare-metal cross-compiler for ia64, but 
that did not work, because it seems to be impossible to build it without having 
a stdlib.h.

With the attached patch, I was finally able to build the cross compiler, by 
declaring abort in the way as it is done already in many other places at libgcc.

In case someone wants to know, working configure options are as follows:

../binutils-2.25.1/configure --prefix=../ia64-elf --target=ia64-unknown-elf

../gcc-trunk/configure --prefix=../ia64-elf --target=ia64-unknown-elf 
--enable-languages=c --with-gnu-as --disable-threads --disable-sjlj-exceptions 
--disable-libssp --disable-libquadmath


I have successfully built a bare-metal cross compiler with this patch.
Is it OK for trunk?


Thanks
Bernd.
2015-12-15  Bernd Edlinger  <bernd.edlin...@hotmail.de>

	* unwind-generic.h: Don't include stdlib.h.
	Add a prototype for abort.


Index: libgcc/unwind-generic.h
===================================================================
--- libgcc/unwind-generic.h	(Revision 231598)
+++ libgcc/unwind-generic.h	(Arbeitskopie)
@@ -221,7 +221,9 @@ _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exc
    compatible with the standard ABI for IA-64, we inline these.  */
 
 #ifdef __ia64__
-#include <stdlib.h>
+/* We add a prototype for abort here to avoid creating a dependency on
+   target headers.  */
+extern void abort (void);
 
 static inline _Unwind_Ptr
 _Unwind_GetDataRelBase (struct _Unwind_Context *_C)

Reply via email to