public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Problem building U-Boot for ARM target
@ 2005-10-11  9:16 Paolo Broggini
  2005-10-11 10:38 ` [U-Boot-Users] " Catalin Marinas
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Broggini @ 2005-10-11  9:16 UTC (permalink / raw)
  To: u-boot

Dear all,

I'm using the GCC 3.2 toolchain for building U-Boot (current head of git) for an ARM target.
I get the following error:
   cc1: invalid option 'abi=apcs-gnu'

This option (correct me if I'm wrong) was introduced with a recent patch by Peter Pearse.
Digging a bit in gcc.gnu.org it appears that this option comes only with GCC 4.0!

Is this a known behaviour?

BTW: removing this option from 'cpu/armxxx/config.mk' U-Boot builds fine!

Best regards

-P.Broggini

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] Re: Problem building U-Boot for ARM target
  2005-10-11  9:16 [U-Boot-Users] Problem building U-Boot for ARM target Paolo Broggini
@ 2005-10-11 10:38 ` Catalin Marinas
  2005-10-11 12:14   ` Paolo Broggini
  0 siblings, 1 reply; 9+ messages in thread
From: Catalin Marinas @ 2005-10-11 10:38 UTC (permalink / raw)
  To: u-boot

Paolo Broggini <pbroggini@softool.ch> wrote:
> I'm using the GCC 3.2 toolchain for building U-Boot (current head of git) for an ARM target.
> I get the following error:
>    cc1: invalid option 'abi=apcs-gnu'
>
> This option (correct me if I'm wrong) was introduced with a recent
> patch by Peter Pearse.  Digging a bit in gcc.gnu.org it appears that
> this option comes only with GCC 4.0!

That's true but the cc-option checker should use -mapcs-32 if it is
available, otherwise it will fall back to -mabi=apcs-gnu. It looks
like your compiler doesn't support the first option either. In this
case, I'm not sure it worked before Peter's patch. What CPU is it?

You could try the following in your config.mk but you should
investigate why -mapcs-32 doesn't work:

PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=apcs-gnu,))

-- 
Catalin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] Re: Problem building U-Boot for ARM target
  2005-10-11 10:38 ` [U-Boot-Users] " Catalin Marinas
@ 2005-10-11 12:14   ` Paolo Broggini
  2005-10-11 12:48     ` Catalin Marinas
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Broggini @ 2005-10-11 12:14 UTC (permalink / raw)
  To: u-boot

Catalin Marinas ha scritto:
> Paolo Broggini <pbroggini@softool.ch> wrote:
> 
>>I'm using the GCC 3.2 toolchain for building U-Boot (current head of git) for an ARM target.
>>I get the following error:
>>   cc1: invalid option 'abi=apcs-gnu'
>>
>>This option (correct me if I'm wrong) was introduced with a recent
>>patch by Peter Pearse.  Digging a bit in gcc.gnu.org it appears that
>>this option comes only with GCC 4.0!
> 
> 
> That's true but the cc-option checker should use -mapcs-32 if it is
> available, otherwise it will fall back to -mabi=apcs-gnu. It looks
> like your compiler doesn't support the first option either. In this
> case, I'm not sure it worked before Peter's patch.
Yes it did, I build U-Boot for quite a long time.

> What CPU is it?
Freescale MC9328MX1

> 
> You could try the following in your config.mk but you should
> investigate why -mapcs-32 doesn't work:
Yes it do work!

> 
> PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=apcs-gnu,))
Great, with this it builds fine :-) but the statement contained in the head of git
'config.mk' is:
  PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)

It also builds fine if I replace the above statement with:
  PLATFORM_CPPFLAGS += -march=armv4, -mapcs-32
like it was before Peters's patch.

Thanks

-P.Broggini

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] Re: Problem building U-Boot for ARM target
  2005-10-11 12:14   ` Paolo Broggini
@ 2005-10-11 12:48     ` Catalin Marinas
  2005-10-11 13:22       ` Paolo Broggini
  0 siblings, 1 reply; 9+ messages in thread
From: Catalin Marinas @ 2005-10-11 12:48 UTC (permalink / raw)
  To: u-boot

Paolo Broggini <pbroggini@softool.ch> wrote:
> Catalin Marinas ha scritto:
>> PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call
>> cc-option,-mabi=apcs-gnu,))
>
> Great, with this it builds fine :-) but the statement contained in
> the head of git 'config.mk' is:
>
>   PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)

My proposals tries both -mapcs-32 and -mabi=apcs-gnu and if neither
works it doesn't add anything.

In your config.mk file, can you change -mapcs-32 with -g (this one
would never fail) just to make sure there isn't any problem with the
option checker?

Thanks.

-- 
Catalin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] Re: Problem building U-Boot for ARM target
  2005-10-11 12:48     ` Catalin Marinas
@ 2005-10-11 13:22       ` Paolo Broggini
  2005-10-11 13:44         ` Catalin Marinas
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Broggini @ 2005-10-11 13:22 UTC (permalink / raw)
  To: u-boot

Catalin Marinas ha scritto:
> Paolo Broggini <pbroggini@softool.ch> wrote:
> 
>>Catalin Marinas ha scritto:
>>
>>>PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call
>>>cc-option,-mabi=apcs-gnu,))
>>
>>Great, with this it builds fine :-) but the statement contained in
>>the head of git 'config.mk' is:
>>
>>  PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
> 
> 
> My proposals tries both -mapcs-32 and -mabi=apcs-gnu and if neither
> works it doesn't add anything.
-mapcs-32 do work, -mabi=apcs-gnu doesn't!

> In your config.mk file, can you change -mapcs-32 with -g (this one
> would never fail) just to make sure there isn't any problem with the
> option checker?
Ok, see below:
  1) PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
     -> gcc complains about '-mabi=apcs-gnu' (see my original mail)

  2) PLATFORM_CPPFLAGS +=$(call cc-option,-g,-mabi=apcs-gnu)
     -> everything compiles fine, the option used is '-g'

  3) PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-g)
     -> everything compiles fine, the option used is '-mapcs-32'

Thanks

-P.Broggini

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] Re: Problem building U-Boot for ARM target
  2005-10-11 13:22       ` Paolo Broggini
@ 2005-10-11 13:44         ` Catalin Marinas
  2005-10-11 14:07           ` Paolo Broggini
  0 siblings, 1 reply; 9+ messages in thread
From: Catalin Marinas @ 2005-10-11 13:44 UTC (permalink / raw)
  To: u-boot

Paolo Broggini <pbroggini@softool.ch> wrote:
>   1) PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
>      -> gcc complains about '-mabi=apcs-gnu' (see my original mail)
>
>   2) PLATFORM_CPPFLAGS +=$(call cc-option,-g,-mabi=apcs-gnu)
>      -> everything compiles fine, the option used is '-g'
>
>   3) PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-g)
>      -> everything compiles fine, the option used is '-mapcs-32'

Very weird. A 'make' bug maybe? I don't see why 1 and 3 checks return
different options. If you write a shorter version in 1 like -mapbi=a,
would it make any difference?

-- 
Catalin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] Re: Problem building U-Boot for ARM target
  2005-10-11 13:44         ` Catalin Marinas
@ 2005-10-11 14:07           ` Paolo Broggini
  2005-10-11 14:32             ` Catalin Marinas
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Broggini @ 2005-10-11 14:07 UTC (permalink / raw)
  To: u-boot

Catalin Marinas ha scritto:
> Paolo Broggini <pbroggini@softool.ch> wrote:
> 
>>  1) PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
>>     -> gcc complains about '-mabi=apcs-gnu' (see my original mail)
>>
>>  2) PLATFORM_CPPFLAGS +=$(call cc-option,-g,-mabi=apcs-gnu)
>>     -> everything compiles fine, the option used is '-g'
>>
>>  3) PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-g)
>>     -> everything compiles fine, the option used is '-mapcs-32'
> 
> 
>I don't see why 1 and 3 checks return
> different options.
Indeed!

Well may be it starts to become out-of-topics here in U-Boot list, but
just one more thing:
I tried the macro cc-option "by hand" (so without $CFLAGS) in a bash shell and I got
the same results as above, i.e. the check for option -mapcs-32 fails but the compiler
support it and indeed the compilation works fine! May be a bug?

Thanks

-P.Broggini

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] Re: Problem building U-Boot for ARM target
  2005-10-11 14:07           ` Paolo Broggini
@ 2005-10-11 14:32             ` Catalin Marinas
  2005-10-11 15:33               ` Paolo Broggini
  0 siblings, 1 reply; 9+ messages in thread
From: Catalin Marinas @ 2005-10-11 14:32 UTC (permalink / raw)
  To: u-boot

Paolo Broggini <pbroggini@softool.ch> wrote:
> Well may be it starts to become out-of-topics here in U-Boot list,
> but just one more thing:

I don't think it is OT as long as the config.mk files are part of
U-Boot and they don't work as expected (unless the bug is definitely
in a different tool).

> I tried the macro cc-option "by hand" (so without $CFLAGS) in a bash
> shell and I got the same results as above, i.e. the check for option
> -mapcs-32 fails but the compiler support it and indeed the
> compilation works fine! May be a bug?

I tried the below file (with CC set to your compiler) and it works as
expected for me (called with the two options as arguments), choosing
-mapcs-32 (but it's a 3.4.0 compiler):

  #!/bin/sh

  CC=arm-linux-gcc

  if $CC $1 -S -o /dev/null -xc /dev/null \
        > /dev/null 2>&1; then echo "$1"; else echo "$2"; fi;

You could look for bug in the shell as well

-- 
Catalin

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot-Users] Re: Problem building U-Boot for ARM target
  2005-10-11 14:32             ` Catalin Marinas
@ 2005-10-11 15:33               ` Paolo Broggini
  0 siblings, 0 replies; 9+ messages in thread
From: Paolo Broggini @ 2005-10-11 15:33 UTC (permalink / raw)
  To: u-boot

Catalin Marinas ha scritto:
> Paolo Broggini <pbroggini@softool.ch> wrote:
> 
> 
> I don't think it is OT as long as the config.mk files are part of
> U-Boot and they don't work as expected (unless the bug is definitely
> in a different tool).
Ok
> 
> 
> 
> I tried the below file (with CC set to your compiler) and it works as
> expected for me (called with the two options as arguments), choosing
> -mapcs-32 (but it's a 3.4.0 compiler):
> 
>   #!/bin/sh
> 
>   CC=arm-linux-gcc
> 
>   if $CC $1 -S -o /dev/null -xc /dev/null \
>         > /dev/null 2>&1; then echo "$1"; else echo "$2"; fi;
> 
> You could look for bug in the shell as well
> 
I start to be a litle bit confused.
I tried what you suggested above and it works as expected here to i.e. it chooses
-mapcs-32!!!!!!!! But if I build U-Boot it still fails, it takes the wrong option!

What about if you tried to buid U-Boot ?

Best regards
-P.Broggini

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-10-11 15:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-11  9:16 [U-Boot-Users] Problem building U-Boot for ARM target Paolo Broggini
2005-10-11 10:38 ` [U-Boot-Users] " Catalin Marinas
2005-10-11 12:14   ` Paolo Broggini
2005-10-11 12:48     ` Catalin Marinas
2005-10-11 13:22       ` Paolo Broggini
2005-10-11 13:44         ` Catalin Marinas
2005-10-11 14:07           ` Paolo Broggini
2005-10-11 14:32             ` Catalin Marinas
2005-10-11 15:33               ` Paolo Broggini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox