From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: compiler options cleanup - improve tool chain support
Date: Fri, 21 Aug 2009 23:12:45 +0200 [thread overview]
Message-ID: <20090821211245.50EC3833DBD2@gemini.denx.de> (raw)
In-Reply-To: <1250507849-31660-1-git-send-email-wd@denx.de>
In message <1250507849-31660-1-git-send-email-wd@denx.de> I wrote:
> For some time there have been repeated reports about build problems
> with some ARM (cross) tool chains. Especially issues about
> (in)compatibility with the tool chain provided runtime support
> library libgcc.a caused to add and support a private implementation
> of such runtime support code in U-Boot. A closer look at the code
> indicated that some of these issues are actually home-made. This
> patch attempts to clean up some of the most obvious problems and make
> building of U-Boot with different tool chains easier:
>
> - Even though all ARM systems basicy used the same compiler options
> to select a specific ABI from the tool chain, the code for this was
> distributed over all cpu/*/config.mk files. We move this one level
> up into lib_arm/config.mk instead.
>
> - So far, we only checked if "-mapcs-32" was supported by the tool
> chain; if yes, this was used, if not, "-mabi=apcs-gnu" was
> selected, no matter if the tool chain actually understood this
> option. There was no support for EABI conformant tool chains.
> This patch implements the following logic:
>
> 1) If the tool chain supports
> "-mabi=aapcs-linux -mno-thumb-interwork"
> we use these options (EABI conformant tool chain).
> 2) Otherwise, we check first if
> "-mapcs-32"
> is supported, and then check for
> "-mabi=apcs-gnu"
> If one test succeeds, we use the first found option.
> 3) In case 2), we also test if "-mno-thumb-interwork", and use
> this if the test succeeds. [For "-mabi=aapcs-linux" we set
> "-mno-thumb-interwork" mandatorily.]
>
> This way we use a similar logic for the compile options as the
> Linux kenrel does.
>
> - Some EABI conformant tool chains cause external references to
> utility functions like raise(); such functions are provided in the
> new file lib_arm/eabi_compat.c
>
> Note that lib_arm/config.mk gets parsed several times, so we must
> make sure to add eabi_compat.o only once to the linker list.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Cc: Dirk Behme <dirk.behme@googlemail.com>
> Cc: Magnus Lilja <lilja.magnus@gmail.com>
> Cc: Tom Rix <Tom.Rix@windriver.com>
> Cc: Prafulla Wadaskar <prafulla@marvell.com>
> ---
>
> I have run a full "MAKEALL arm" for ELDK releases 3.1 (gcc 3.3.3),
> 3.1.1 (gcc 3.3.3), 4.1 (gcc 4.0.0) and 4.2 (gcc 4.2.2, both as "arm"
> [softfloat] and "armVFP" [VFP hardfloat]), and all of these both with
> USE_PRIVATE_LIBGCC=yes (i. e. using U-Boot internal libgcc
> replacement code) and without (i. e. using the tool chain provided
> standard libgcc instead).
>
> The ELDK fails to build the big-endian IXP boards, but this is a
> restriction of the ELDK, not a new issue introcued by this patch.
> Except of this, all build were succesful.
>
> Note 1: Please note that older tool chains (based on binutils versions
> older than 2.16) will have problems with the SORT_BY_ALIGNMENT()
> and SORT_BY_NAME() functions introduced to the linker scripts with
> commit f62fb99941c6. I'll soon submit a patch to fix this issue. Final
> tests are running right now.
>
> Note 2: Even though this is a bigger change, I consider it a bug fix
> and therefor tend to have it included into the upcoming release. Of
> course this requires sufficient test coverage and feedback. Please
> help!!
>
> Note 3: Most ARM systems also define this:
> PLATFORM_RELFLAGS +=$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
> I guess this can be unified and moved to lib_arm/config.mk, too, but I
> would like to handle this in a separate, later patch. This makes
> testing (and bisecting) easier, and it is a non-critical problem.
>
> config.mk | 2 +-
> cpu/arm1136/config.mk | 2 --
> cpu/arm1176/config.mk | 2 --
> cpu/arm1176/s3c64xx/config.mk | 1 -
> cpu/arm720t/config.mk | 2 --
> cpu/arm920t/config.mk | 2 --
> cpu/arm925t/config.mk | 2 --
> cpu/arm926ejs/config.mk | 2 --
> cpu/arm926ejs/davinci/config.mk | 2 --
> cpu/arm946es/config.mk | 2 --
> cpu/arm_cortexa8/config.mk | 1 -
> cpu/arm_cortexa8/omap3/board.c | 7 -------
> cpu/arm_intcm/config.mk | 2 --
> cpu/ixp/config.mk | 1 -
> cpu/lh7a40x/config.mk | 2 --
> cpu/pxa/config.mk | 2 --
> cpu/s3c44b0/config.mk | 2 --
> cpu/sa1100/config.mk | 2 --
> lib_arm/Makefile | 15 ++++++++++++---
> lib_arm/config.mk | 28 ++++++++++++++++++++++++++++
> lib_arm/eabi_compat.c | 18 ++++++++++++++++++
> 21 files changed, 59 insertions(+), 40 deletions(-)
> create mode 100644 lib_arm/eabi_compat.c
Applied.
Thanks to everybody who helped testing.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Though a program be but three lines long,
someday it will have to be maintained."
- The Tao of Programming
next prev parent reply other threads:[~2009-08-21 21:12 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-17 11:17 [U-Boot] [PATCH] ARM: compiler options cleanup - improve tool chain support Wolfgang Denk
2009-08-17 13:00 ` Tom
2009-08-17 13:25 ` Wolfgang Denk
2009-08-17 15:26 ` Dirk Behme
2009-08-17 19:43 ` ksi at koi8.net
2009-08-17 20:17 ` Magnus Lilja
2009-08-17 20:27 ` Wolfgang Denk
2009-08-18 17:08 ` Magnus Lilja
2009-08-18 21:18 ` Wolfgang Denk
2009-08-18 11:06 ` Gaye Abdoulaye Walsimou
2009-08-18 11:22 ` Wolfgang Denk
2009-08-20 15:27 ` Andrzej Wolski
2009-08-18 11:45 ` Gaye Abdoulaye Walsimou
2009-08-18 18:50 ` Tom
2009-08-18 21:19 ` Wolfgang Denk
2009-08-21 21:12 ` Wolfgang Denk [this message]
2009-08-24 8:59 ` Simon Kagstrom
2009-08-24 10:01 ` Wolfgang Denk
2009-08-24 11:28 ` Prafulla Wadaskar
2009-08-24 11:56 ` Wolfgang Denk
2009-08-24 12:41 ` Prafulla Wadaskar
2009-08-24 12:59 ` Simon Kagstrom
2009-08-24 13:05 ` Wolfgang Denk
2009-08-24 11:38 ` Simon Kagstrom
2009-08-24 12:01 ` Wolfgang Denk
2009-08-24 12:49 ` Simon Kagstrom
2009-08-25 7:12 ` Simon Kagstrom
2009-09-04 20:05 ` Wolfgang Denk
2009-09-07 6:23 ` Simon Kagstrom
2009-09-07 8:59 ` Prafulla Wadaskar
2009-09-07 9:15 ` Simon Kagstrom
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=20090821211245.50EC3833DBD2@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/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