public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Doug Evans <dje@sebabeach.org>
Cc: gcc-bugs@gcc.gnu.org, binutils@sources.redhat.com
Subject: Re: arm-elf snafu?  can't mix default-soft-float, explicit -msoft-float
Date: Wed, 23 Jul 2003 18:35:00 -0000	[thread overview]
Message-ID: <m31xwh14dy.fsf@redhat.com> (raw)
In-Reply-To: <20030722171600.A3F84B53E@mail.sebabeach.org> (Doug Evans's message of "Tue, 22 Jul 2003 10:16:00 -0700 (PDT)")

Hi Doug,

> Simple testcase:
>
> bash$ rm foo1.c foo2.c ; touch foo1.c foo2.c
> bash$ arm-elf-gcc -c foo1.c
> bash$ arm-elf-objdump -p foo1.o
> foo1.o:     file format elf32-littlearm
> private flags = 0: [APCS-32] [FPA float format]
> bash$ arm-elf-gcc -c foo2.c -msoft-float
> foo1.o:     file format elf32-littlearm
> private flags = 200: [APCS-32] [FPA float format] [software FP]
> bash$ arm-elf-gcc -nostdlib foo1.o foo2.o
> [links successfully]
> bash$ arm-elf-gcc -nostdlib foo2.o foo1.o
> /samantha/gnu-pure/rel/lib/gcc-lib/arm-elf/3.4/../../../../arm-elf/bin/ld: ERROR: foo1.o uses hardware FP, whereas a.out uses software FP

> This line in gcc/config/arm/elf.h
> 
> #ifndef SUBTARGET_ASM_FLOAT_SPEC
> #define SUBTARGET_ASM_FLOAT_SPEC "\
> %{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
> #endif


I think that this is the problem.  If you apply the patch below for
example, then arm-elf targets will always pass -mfpu=softfpa to GAS,
unless -mhard-float is specfied, whereas the arm-linux toolchain will
always pass an explicit -mfpu=fpa unless -msoft-float is specified.

What do you think ?

Cheers
        Nick

gcc/ChangeLog                
2003-07-23  Nick Clifton  <nickc@redhat.com>

	* config/arm/elf.h (SUBTARGET_ASM_FLOAT_SPEC): Pass
	-mfpu=softfpa to GAS by default.
	* config/arm/linux-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Define.
        Pass -mfpu=fpa to GAS by default.

Index: gcc/config/arm/elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/elf.h,v
retrieving revision 1.44
diff -c -3 -p -r1.44 elf.h
*** gcc/config/arm/elf.h	19 Jun 2003 21:47:06 -0000	1.44
--- gcc/config/arm/elf.h	23 Jul 2003 18:32:24 -0000
***************
*** 46,52 ****
  
  #ifndef SUBTARGET_ASM_FLOAT_SPEC
  #define SUBTARGET_ASM_FLOAT_SPEC "\
! %{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
  #endif
  
  #ifndef ASM_SPEC
--- 46,52 ----
  
  #ifndef SUBTARGET_ASM_FLOAT_SPEC
  #define SUBTARGET_ASM_FLOAT_SPEC "\
! %{mapcs-float:-mfloat} %{!mhard-float:-mfpu=softfpa} %{mhard-float:-mfpu=fpa}"
  #endif
  
  #ifndef ASM_SPEC
  
Index: gcc/config/arm/linux-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/linux-elf.h,v
retrieving revision 1.40
diff -c -3 -p -r1.40 linux-elf.h
*** gcc/config/arm/linux-elf.h	14 Jun 2003 17:11:57 -0000	1.40
--- gcc/config/arm/linux-elf.h	23 Jul 2003 18:32:24 -0000
***************
*** 40,45 ****
--- 40,49 ----
  #define MULTILIB_DEFAULTS \
  	{ "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
  
+ #undef  SUBTARGET_ASM_FLOAT_SPEC
+ #define SUBTARGET_ASM_FLOAT_SPEC "\
+   %{mapcs-float:-mfloat} %{!msoft-float:-mfpu=fpa} %{msoft-float:-mfpu=softfpa}"
+ 
  #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
  
  /* The GNU C++ standard library requires that these macros be defined.  */
        


      reply	other threads:[~2003-07-23 18:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-22 17:11 Doug Evans
2003-07-23 18:35 ` Nick Clifton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m31xwh14dy.fsf@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sources.redhat.com \
    --cc=dje@sebabeach.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).