diff mbox

fix mcore-elf build

Message ID 20101008015704.GK17388@nightcrawler
State New
Headers show

Commit Message

Nathan Froyd Oct. 8, 2010, 1:57 a.m. UTC
The patch below fixes build errors seen on mcore-elf.  The
INCOMING_RETURN_ADDR_RTX change is needed to keep dwarf2out.c from
asserting, and the TARGET_EXCEPT_UNWIND_INFO change fixes things like:

In file included from ../../../gcc-head/libgcc/../gcc/unwind-dw2.c:1582:0:
../../../gcc-head/libgcc/../gcc/unwind.inc: In function '_Unwind_RaiseException':
../../../gcc-head/libgcc/../gcc/unwind.inc:136:1: error: __builtin_eh_return not supported on this target
../../../gcc-head/libgcc/../gcc/unwind.inc: In function '_Unwind_ForcedUnwind':
../../../gcc-head/libgcc/../gcc/unwind.inc:212:1: error: __builtin_eh_return not supported on this target
../../../gcc-head/libgcc/../gcc/unwind.inc: In function '_Unwind_Resume':
../../../gcc-head/libgcc/../gcc/unwind.inc:237:1: error: __builtin_eh_return not supported on this target
../../../gcc-head/libgcc/../gcc/unwind.inc: In function '_Unwind_Resume_or_Rethrow':
../../../gcc-head/libgcc/../gcc/unwind.inc:262:1: error: __builtin_eh_return not supported on this target

seen while building libgcc.

Tested with cross to mcore-elf.  OK to commit?

-Nathan

	* config/mcore/mcore.h (INCOMING_RETURN_ADDR_RTX): Define.
	* config/mcore/mcore.c (TARGET_EXCEPT_UNWIND_INFO): Define.

Comments

Nick Clifton Oct. 8, 2010, 10:01 a.m. UTC | #1
Hi Nathan,

> 	* config/mcore/mcore.h (INCOMING_RETURN_ADDR_RTX): Define.
> 	* config/mcore/mcore.c (TARGET_EXCEPT_UNWIND_INFO): Define.

Approved - please apply.

Cheers
   Nick
diff mbox

Patch

Index: config/mcore/mcore.c
===================================================================
--- config/mcore/mcore.c	(revision 165145)
+++ config/mcore/mcore.c	(working copy)
@@ -227,6 +227,9 @@  static const struct attribute_spec mcore
 #undef TARGET_OPTION_OPTIMIZATION
 #define TARGET_OPTION_OPTIMIZATION mcore_option_optimization
 
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Adjust the stack and return the number of bytes taken to do it.  */
Index: config/mcore/mcore.h
===================================================================
--- config/mcore/mcore.h	(revision 165145)
+++ config/mcore/mcore.h	(working copy)
@@ -776,6 +776,8 @@  extern const enum reg_class reg_class_fr
 #undef  TARGET_ASM_NAMED_SECTION
 #define TARGET_ASM_NAMED_SECTION  mcore_asm_named_section
 
+#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, LK_REG)
+
 /* This is how to output an insn to push a register on the stack.
    It need not be very fast code.  */
 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \