All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] lib: Enable private libgcc by default
Date: Wed, 23 Mar 2016 18:08:45 +0100	[thread overview]
Message-ID: <20160323180845.4bbc1035@lilith> (raw)
In-Reply-To: <20160323132238.GA23166@bill-the-cat>

Hello Tom,

On Wed, 23 Mar 2016 09:22:38 -0400, Tom Rini <trini@konsulko.com> wrote:
> On Wed, Mar 23, 2016 at 01:53:35PM +0100, Albert ARIBAUD wrote:
> > Hello Marek,
> > 
> > On Sun, 20 Mar 2016 17:15:34 +0100, Marek Vasut <marex@denx.de> wrote:
> > > This patch decouples U-Boot binary from the toolchain on systems where
> > > private libgcc is available. Instead of pulling in functions provided
> > > by the libgcc from the toolchain, U-Boot will use it's own set of libgcc
> > > functions. These functions are usually imported from Linux kernel, which
> > > also uses it's own libgcc functions instead of the ones provided by the
> > > toolchain.
> > > 
> > > This patch solves a rather common problem. The toolchain can usually
> > > generate code for many variants of target architecture and often even
> > > different endianness. The libgcc on the other hand is usually compiled
> > > for one particular configuration and the functions provided by it may
> > > or may not be suited for use in U-Boot. This can manifest in two ways,
> > > either the U-Boot fails to compile altogether and linker will complain
> > > or, in the much worse case, the resulting U-Boot will build, but will
> > > misbehave in very subtle and hard to debug ways.
> > 
> > I don't think using private libgcc by default is a good idea.
> > 
> > U-Boot's private libgcc is not a feature of U-Boot, but a fix for some
> > cases where a target cannot properly link with the libgcc provided by
> > the (specific release of the) GCC toolchain in use. Using private libgcc
> > to other cases than these does not fix or improve anything; those
> > other cases were working and did not require any fix in this respect. 
> 
> This isn't true, exactly.  If using clang for example everyone needs to
> enable this code.  We're also using -fno-builtin -ffreestanding which
> should limit the amount of interference from the toolchain.  And we get
> that.

You mean clang does not produce self-sustained binaries?

> > Also, libgcc is not a standalone project that can be frozen, forked or
> > improved freely; it is an internal component of the GCC toolchain. No
> > standard defines what libgcc is or should be, and we have no control
> > over the 'contract' between GCC-emitted code and libgcc. The GCC
> > project may decide to change that contract at any time, and produce a
> > new toolchain and a new libgcc. Using our private libgcc by default
> > will cause all targets to break for no good reason. We've already been
> > bitten by internal GCC changes on which we were dependent; adding more
> > such dependency is not the way to go IMO.
> > 
> > If we truly fear that GCC is *generally* unable to properly build our
> > targets due to its libgcc, then we should not only "snapshot and fix"
> > libgcc; we should "snapshot and fix" the whole GCC toolchain, to make
> > sure we keep a consistent copy of it. I don't think that would be a
> > viable move.
> > 
> > And if we don't believe that GCC is generally unable to properly build
> > U-Boot, then we should always use it as provided unless it is provably
> > buggy, in which case if a private libgcc is a fix, then by all means we
> > should use it.
> > 
> > And whenever we find that a GCC toolchain is provably buggy, we should
> > raise a bug, either to the toolchain provider if the issue is only with
> > a given binary release (e.g. mismatched or badly supported endianness),
> > or to the GCC project if the bug is inherent to GCC (e.g. generation
> > of non-supported opcodes for a given arch/cpu).
> 
> Ah, but this shows part of the problem.  We don't need "libgcc" as in
> "the thing which provides gcc'isms".  We need "libgcc" as in "the thing
> which provides AEABI functions".

Not sure I'm getting what you mean. For one thing, I don't see that
AEABI specifies any functions. Also, I don't see where it is established
that U-Boot "needs AEABI functions". Finally, I don't see that libgcc
is a standalone project aiming at providing AEABI functions.

> Today we get these from libgcc but we
> run into cases where this doesn't work quite right (toolchain fun) or
> simply aren't available (again, clang).  So I am in favour of re-syncing
> with this part of the kernel and mirroring the decision to always
> include these functions, again, like the kernel does.

If we are using libgcc for providing AEABI services then we are using it
wrong. Its role is to support GCC-generated code.

Could you give me an example of this "need for [an] AEABI function"?

> -- 
> Tom

Amicalement,
-- 
Albert.

  reply	other threads:[~2016-03-23 17:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-20 16:15 [U-Boot] [PATCH 1/5] arm: include: Import unified.h from Linux kernel Marek Vasut
2016-03-20 16:15 ` [U-Boot] [PATCH 2/5] arm: lib: Drop underscore from private libgcc filenames Marek Vasut
2016-04-09 18:34   ` Simon Glass
2016-03-20 16:15 ` [U-Boot] [PATCH 3/5] arm: lib: Sync libgcc shift operations Marek Vasut
2016-04-09 18:34   ` Simon Glass
2016-03-20 16:15 ` [U-Boot] [PATCH 4/5] arm: lib: Sync libgcc 32b division/modulo operations Marek Vasut
2016-04-09 18:34   ` Simon Glass
2016-03-20 16:15 ` [U-Boot] [PATCH 5/5] lib: Enable private libgcc by default Marek Vasut
2016-03-23 12:53   ` Albert ARIBAUD
2016-03-23 13:22     ` Tom Rini
2016-03-23 17:08       ` Albert ARIBAUD [this message]
2016-03-23 21:36         ` Tom Rini
2016-03-23 23:02           ` Sergey Kubushyn
2016-03-23 23:08             ` Tom Rini
2016-03-23 23:24               ` Sergey Kubushyn
2016-03-23 23:24               ` Marek Vasut
2016-03-23 23:47                 ` Sergey Kubushyn
2016-03-23 23:49                   ` Marek Vasut
2016-03-23 23:54                     ` Sergey Kubushyn
2016-03-24  0:10                       ` [U-Boot] [PATCH] arm: lib: Import __do_div64 from Linux Marek Vasut
2016-03-24  0:11                       ` [U-Boot] [PATCH 5/5] lib: Enable private libgcc by default Marek Vasut
2016-03-24  2:28                         ` Sergey Kubushyn
2016-03-24 18:18                         ` Sergey Kubushyn
2016-03-24 18:43                           ` Sergey Kubushyn
2016-03-24 19:04                             ` Marek Vasut
2016-03-24 19:08                               ` Sergey Kubushyn
2016-03-24 19:14                                 ` Marek Vasut
2016-03-24 22:25                                   ` Sergey Kubushyn
2016-03-24  0:13                     ` Tom Rini
2016-03-24  0:36                       ` Marek Vasut
2016-03-24  7:50           ` Albert ARIBAUD
2016-03-25  0:49             ` Tom Rini
2016-03-25  1:37               ` Sergey Kubushyn
2016-03-25  6:41                 ` Albert ARIBAUD
2016-03-25  6:37               ` Albert ARIBAUD
2016-03-25  6:43                 ` Albert ARIBAUD
2016-03-27 13:36                 ` Tom Rini
2016-03-29  9:18                   ` Albert ARIBAUD
2016-04-09 18:34 ` [U-Boot] [PATCH 1/5] arm: include: Import unified.h from Linux kernel Simon Glass
2016-04-28  0:28   ` Marek Vasut

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=20160323180845.4bbc1035@lilith \
    --to=albert.u.boot@aribaud.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.