* [U-Boot-Users] Re: Problem building U-Boot for ARM target
2005-10-11 9:16 [U-Boot-Users] " Paolo Broggini
@ 2005-10-11 10:38 ` Catalin Marinas
2005-10-11 12:14 ` Paolo Broggini
0 siblings, 1 reply; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ 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; 10+ 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] 10+ messages in thread
* [U-Boot-Users] Re: Problem building U-Boot for ARM target
[not found] <89A528FE6DB0FA44877BB2F05B8467180331C12C@ZIPPY.Emea.Arm.com>
@ 2005-10-12 8:46 ` Paolo Broggini
0 siblings, 0 replies; 10+ messages in thread
From: Paolo Broggini @ 2005-10-12 8:46 UTC (permalink / raw)
To: u-boot
Peter Pearse ha scritto:
>
> No question is stupid - just giving you the info.
I mean, it is quite obvious that it works by you (... and probably by
a lot of other people to)
>
> Depends how much time you have available to sort the bug....
> Sometimes it's worth it in the long run.
Definitely! but I'm far to be a "guru" in the make stuff.
>>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?
Sorry forget about this I was making a mistake :-(
The script suggested by Catalin works perfectly either in a bash or a sh shell.
On the other hand, the U-Boot build process fails in both shell.
So I have investigated a little bit the macro cc-option:
cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
I tried to drop the CFLAGS variable from the macro:
cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
and the build process worked fine i.e. the check for -mapcs-32 was OK.
Next step, in order to see the content of CFLAGS, I modified the macro as:
cc-option = $(shell echo "$(CFLAGS)" > ./flags.txt; if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
and this revealed that among a lot of other otions it contains the failing option -mabi=apcs-gnu !!!
But this option is not set by anybody else just by:
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
So it is obvious why cc-option returns the wrong option!
Now the questions are:
1) Why the CFLAGS is in the macro since cc-option should check the compiler support for a particular
option? Indeed the cc-option contained in config.mk is exactly the same as theone contained in
linux kernel 2.6.x makefile.
2) How is it possible that CFLAGS contains the failing option since
$(call cc-option,-mapcs-32,-mabi=apcs-gnu) is not yet processed and not set by anybody else?
3) Why if I replace -mapcs-32 with -g everything works fine? I wish I never tried that!!
Please Peter or Catalin since your compiler support both -mapcs-32 and -mabi=apcs-gnu options could
you try the following?
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mfoo)
Thanks for your patience!
-P.Broggini
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot-Users] Re: Problem building U-Boot for ARM target
[not found] <89A528FE6DB0FA44877BB2F05B8467180331C407@ZIPPY.Emea.Arm.com>
@ 2005-10-12 12:26 ` Paolo Broggini
0 siblings, 0 replies; 10+ messages in thread
From: Paolo Broggini @ 2005-10-12 12:26 UTC (permalink / raw)
To: u-boot
Peter Pearse ha scritto:
> Paolo Broggini wrote:
>
>>Now the questions are:
>>1) Why the CFLAGS is in the macro since cc-option should check the
>> compiler support for a particular option? Indeed the cc-option
>> contained in config.mk is exactly the same as theone contained in
>>linux kernel 2.6.x makefile.
>
> Because I cut and pasted it without thinking, and it worked for me
> - $(CFLAGS) should be dropped.
> I've added it to my todo list, you're welcome to submit a patch.
I'll do it.
Thanks again.
-P.Broggini
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-10-12 12:26 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <89A528FE6DB0FA44877BB2F05B8467180331C12C@ZIPPY.Emea.Arm.com>
2005-10-12 8:46 ` [U-Boot-Users] Re: Problem building U-Boot for ARM target Paolo Broggini
[not found] <89A528FE6DB0FA44877BB2F05B8467180331C407@ZIPPY.Emea.Arm.com>
2005-10-12 12:26 ` Paolo Broggini
2005-10-11 9:16 [U-Boot-Users] " 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