[cfe-dev] Optimized subarch library support

Meador Inge meadori at codesourcery.com
Mon Dec 9 15:26:32 PST 2013

On 12/07/2013 04:34 AM, David Chisnall wrote:

> Selecting libraries for a specific processor seems more of a load-time decision
> than a compile-time one.

Not always.

> If you're building everything tuned for a specific processor, why would you
> install libraries that are not so tuned?

You may not be installing much of anything.  Everything could be statically
linked.  This is quite common in bare-metal applications for embedded systems.
The application is built into one monolithic blob and the most optimal standard
library for the given toolchain options is chosen at application build time.

With GCC this is accomplished using multilibs.  We are looking at how to
provide similar functionality with Clang.  Note that multilib support is
actually listed as one of the goals for the Clang universal driver:
http://clang.llvm.org/UniversalDriver.html.  Not sure how up-to-date that is,
though :-)

> And isn't the current direction to use run-time linker tricks to automatically
> select the most optimal implementation from a variety of options within a single
> library, rather than use different libraries?

In general, I don't know.  I'll have to research it, but I don't this think is
always a practical solution for bare-metal type environments and in embedded
GNU/Linux GCC type environments folks still do use multilibs with separately
tuned sysroots.

Meador Inge
CodeSourcery / Mentor Embedded

More information about the cfe-dev mailing list