diff mbox

[ARM,libgcc] Gate crtfastmath.c contents on __ARM_32BIT_STATE

Message ID 55BA38A1.3050008@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov July 30, 2015, 2:45 p.m. UTC
Hi all,

I tried bootstrapping on Thumb1 recently and hit an error while building libgcc and in particular config/arm/crtfastmath.c.
This file generates vmrs instructions which are not allowed in Thumb1, causing an assembler error.

The fix for that is to gate the file not only on !__SOFTFP__ but also no __ARM_32BIT_STATE.
This allows Thumb1 bootstrap to proceed past that point (it fails later on for an unrelated reason).

Bootstrapped on ARM state and Thumb2 as well.
Ok for trunk?

Thanks,
Kyrill

2015-07-30  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/arm/crtfastmath.c: Gate contents on __ARM_32BIT_STATE.

Comments

Richard Earnshaw July 30, 2015, 3:09 p.m. UTC | #1
On 30/07/15 15:45, Kyrill Tkachov wrote:
> Hi all,
> 
> I tried bootstrapping on Thumb1 recently and hit an error while building libgcc and in particular config/arm/crtfastmath.c.
> This file generates vmrs instructions which are not allowed in Thumb1, causing an assembler error.
> 
> The fix for that is to gate the file not only on !__SOFTFP__ but also no __ARM_32BIT_STATE.
> This allows Thumb1 bootstrap to proceed past that point (it fails later on for an unrelated reason).
> 
> Bootstrapped on ARM state and Thumb2 as well.
> Ok for trunk?
> 

Wouldn't it be better to force this function to be compiled in ARM state
when we don't have Thumb2?  That way we can keep this behaviour if the
image is a hybrid ARM/Thumb1 executable.

R.

> Thanks,
> Kyrill
> 
> 2015-07-30  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>      * config/arm/crtfastmath.c: Gate contents on __ARM_32BIT_STATE.
> 
> 
> arm-libgcc-crtfastmath.patch
> 
> 
> commit c3bad17af21b040c4ff0507ffca8d5fbe35b3136
> Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
> Date:   Wed Jul 29 17:56:46 2015 +0100
> 
>     [ARM][libgcc] Gate crtfastmath.c contents on __ARM_32BIT_STATE
> 
> diff --git a/libgcc/config/arm/crtfastmath.c b/libgcc/config/arm/crtfastmath.c
> index 9573514..11b6208 100644
> --- a/libgcc/config/arm/crtfastmath.c
> +++ b/libgcc/config/arm/crtfastmath.c
> @@ -22,7 +22,8 @@
>   */
>  
>  /* Enable flush-to-zero support for -ffast-math on VFP targets.  */
> -#ifndef __SOFTFP__
> +
> +#if defined (__ARM_32BIT_STATE) && !defined ( __SOFTFP__)
>  
>  #define FPSCR_FZ		(1 << 24)
>  
>
diff mbox

Patch

commit c3bad17af21b040c4ff0507ffca8d5fbe35b3136
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Wed Jul 29 17:56:46 2015 +0100

    [ARM][libgcc] Gate crtfastmath.c contents on __ARM_32BIT_STATE

diff --git a/libgcc/config/arm/crtfastmath.c b/libgcc/config/arm/crtfastmath.c
index 9573514..11b6208 100644
--- a/libgcc/config/arm/crtfastmath.c
+++ b/libgcc/config/arm/crtfastmath.c
@@ -22,7 +22,8 @@ 
  */
 
 /* Enable flush-to-zero support for -ffast-math on VFP targets.  */
-#ifndef __SOFTFP__
+
+#if defined (__ARM_32BIT_STATE) && !defined ( __SOFTFP__)
 
 #define FPSCR_FZ		(1 << 24)