From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Broggini Date: Wed, 12 Oct 2005 10:46:18 +0200 Subject: [U-Boot-Users] Re: Problem building U-Boot for ARM target In-Reply-To: <89A528FE6DB0FA44877BB2F05B8467180331C12C@ZIPPY.Emea.Arm.com> References: <89A528FE6DB0FA44877BB2F05B8467180331C12C@ZIPPY.Emea.Arm.com> Message-ID: <434CCD5A.3090409@softool.ch> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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