Commit 26272ba2 by Paul Brook Committed by Paul Brook

arm.c (arm_override_options): Set arm_abi earlier.

2008-09-01  Paul Brook  <paul@codesourcery.com>

	gcc/
	* config/arm/arm.c (arm_override_options): Set arm_abi earlier.
	Allow Interworking on ARMv4 EABI based targets.
	* config/arm/bpabi.h (TARGET_FIX_V4BX_SPEC): Define.
	(SUBTARGET_EXTRA_ASM_SPEC, LINK_SPEC): Add TARGET_FIX_V4BX_SPEC.

From-SVN: r139874
parent 48c23a6c
2008-09-01 Paul Brook <paul@codesourcery.com> 2008-09-01 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_override_options): Set arm_abi earlier.
Allow Interworking on ARMv4 EABI based targets.
* config/arm/bpabi.h (TARGET_FIX_V4BX_SPEC): Define.
(SUBTARGET_EXTRA_ASM_SPEC, LINK_SPEC): Add TARGET_FIX_V4BX_SPEC.
2008-09-01 Paul Brook <paul@codesourcery.com>
* config/arm/thumb2.md (thumb2_negscc): Match the correct operand for * config/arm/thumb2.md (thumb2_negscc): Match the correct operand for
optimized LT0 test. Remove optimization for GT. optimized LT0 test. Remove optimization for GT.
......
...@@ -1186,12 +1186,30 @@ arm_override_options (void) ...@@ -1186,12 +1186,30 @@ arm_override_options (void)
tune_flags = all_cores[(int)arm_tune].flags; tune_flags = all_cores[(int)arm_tune].flags;
if (target_abi_name)
{
for (i = 0; i < ARRAY_SIZE (arm_all_abis); i++)
{
if (streq (arm_all_abis[i].name, target_abi_name))
{
arm_abi = arm_all_abis[i].abi_type;
break;
}
}
if (i == ARRAY_SIZE (arm_all_abis))
error ("invalid ABI option: -mabi=%s", target_abi_name);
}
else
arm_abi = ARM_DEFAULT_ABI;
/* Make sure that the processor choice does not conflict with any of the /* Make sure that the processor choice does not conflict with any of the
other command line choices. */ other command line choices. */
if (TARGET_ARM && !(insn_flags & FL_NOTM)) if (TARGET_ARM && !(insn_flags & FL_NOTM))
error ("target CPU does not support ARM mode"); error ("target CPU does not support ARM mode");
if (TARGET_INTERWORK && !(insn_flags & FL_THUMB)) /* BPABI targets use linker tricks to allow interworking on cores
without thumb support. */
if (TARGET_INTERWORK && !((insn_flags & FL_THUMB) || TARGET_BPABI))
{ {
warning (0, "target CPU does not support interworking" ); warning (0, "target CPU does not support interworking" );
target_flags &= ~MASK_INTERWORK; target_flags &= ~MASK_INTERWORK;
...@@ -1304,22 +1322,6 @@ arm_override_options (void) ...@@ -1304,22 +1322,6 @@ arm_override_options (void)
if (arm_arch5) if (arm_arch5)
target_flags &= ~MASK_INTERWORK; target_flags &= ~MASK_INTERWORK;
if (target_abi_name)
{
for (i = 0; i < ARRAY_SIZE (arm_all_abis); i++)
{
if (streq (arm_all_abis[i].name, target_abi_name))
{
arm_abi = arm_all_abis[i].abi_type;
break;
}
}
if (i == ARRAY_SIZE (arm_all_abis))
error ("invalid ABI option: -mabi=%s", target_abi_name);
}
else
arm_abi = ARM_DEFAULT_ABI;
if (TARGET_IWMMXT && !ARM_DOUBLEWORD_ALIGN) if (TARGET_IWMMXT && !ARM_DOUBLEWORD_ALIGN)
error ("iwmmxt requires an AAPCS compatible ABI for proper operation"); error ("iwmmxt requires an AAPCS compatible ABI for proper operation");
......
...@@ -51,9 +51,11 @@ ...@@ -51,9 +51,11 @@
/* The BPABI integer comparison routines return { -1, 0, 1 }. */ /* The BPABI integer comparison routines return { -1, 0, 1 }. */
#define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI #define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI
#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4:--fix-v4bx}"
/* Tell the assembler to build BPABI binaries. */ /* Tell the assembler to build BPABI binaries. */
#undef SUBTARGET_EXTRA_ASM_SPEC #undef SUBTARGET_EXTRA_ASM_SPEC
#define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4}" #define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4}" TARGET_FIX_V4BX_SPEC
#ifndef SUBTARGET_EXTRA_LINK_SPEC #ifndef SUBTARGET_EXTRA_LINK_SPEC
#define SUBTARGET_EXTRA_LINK_SPEC "" #define SUBTARGET_EXTRA_LINK_SPEC ""
...@@ -63,7 +65,7 @@ ...@@ -63,7 +65,7 @@
#define BPABI_LINK_SPEC \ #define BPABI_LINK_SPEC \
"%{mbig-endian:-EB} %{mlittle-endian:-EL} " \ "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \ "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
"-X" SUBTARGET_EXTRA_LINK_SPEC "-X" SUBTARGET_EXTRA_LINK_SPEC TARGET_FIX_V4BX_SPEC
#undef LINK_SPEC #undef LINK_SPEC
#define LINK_SPEC BPABI_LINK_SPEC #define LINK_SPEC BPABI_LINK_SPEC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment