Gedare-Csphd

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 21 August 2011

multilib

Posted on 09:17 by Unknown
Back when Eugen and I were porting SPARC-V9 to RTEMS, we had to consider the compiler tools for cross-compiling RTEMS to the target architecture. One of the issues was that RTEMS uses the multilib feature of GCC for building architectural variants, so we should consider the multilib options for SPARC-V9 and submit patches to add support for the desired multilibs to the rtems-sparc64-gcc.

What are multilibs?
The GCC manual doesn't say anything other than to identify the flags that use multilib. Google isn't terribly helpful here either. The automake manual has this to say:

18.3 Support for Multilibs

Automake has support for an obscure feature called multilibs. A multilib is a library that is built for multiple different ABIs at a single time; each time the library is built with a different target flag combination. This is only useful when the library is intended to be cross-compiled, and it is almost exclusively used for compiler support libraries.

The multilib support is still experimental. Only use it if you are familiar with multilibs and can debug problems you might encounter.
Hardly helpful.

So we ignored multilibs and moved on. That was fine, although to this day the sparc64-rtems-gcc does not support multilibs. If a tighter integration of the sparc64-rtems-gcc and BSPs becomes important then this issue might be worth re-visiting. But I still had little knowledge about multilibs.

multilibs are...
It turns out that multilib is common, although most end users won't notice them. multilib is the process by which a library is built multiple times, each with a different set of compiler flags. That means a library can be linked to applications built with similar flags, which may be necessary in case the compiler flags change the ABI (application binary interface). An example is compiling legacy 32-bit applications on 64-bit machines: current Linux distros ship GCC with a 32-bit multilib, so the GCC libraries are available for compiling 32-bit applications. On a 64-bit computer without a 32-bit multilib gcc cannot compile 32-bit programs.

RTEMS adds multilib flags to its rtems-flavored gcc compilers to allow RTEMS to link to GCC libraries that best support the target hardware. For users of existing board support packages (BSPs), the multilib is invisible: the BSP specifies compiler flags (in make/custom/somebsp.cfg), and rtems-gcc links the right library. However, BSP developers should ensure that critical flags specified by the BSP match an available rtems-gcc mulitlib or else a new multilib should be contributed. The gcc flags will pull in a multilib if there is a match in gcc-print-multi-lib

On the RTEMS multilib page there is also an explanation of how RTEMS can build its own multilib library, the librtemscpu.a. Building a multilib RTEMS is mostly useful to save a little time and space when compiling many variants of the same processor family, for example multiple BSPs from the same CPU. Perhaps I'll follow up sometime to discuss RTEMS' librtemscpu.a
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in hacking, RTEMS | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Generating interrupts with a gem5 device
    Today I extended my work of adding a device to gem5 by causing the device to generate an interrupt. Interrupts seem to be architecture-spec...
  • RTEMS Modular Task Scheduler
    As I mentioned in my last post , this past summer I participated in the Google Summer of Code by working on the RTEMS project. I have hopef...
  • Extensible Data Structures in C
    A lot of systems programming code is done in C, primarily because of the exposure of explicit memory addresses, but for other reasons too. ...
  • On brevity
    Concise and compact diction is an art that I appreciate more each day. A taste of brevity comes in savoring a phrase that captures an idea w...
  • Spacecraft Flight Software Workshop
    MMS: a NASA mission that will fly RTEMS Last week I attended the Workshop on Spacecraft Flight Software (FSW 2011) at the Johns Hopkins Uni...
  • Post 0
    I've been thinking about starting a blog for awhile, but unlike some of my compulsions, I actually followed through this time.  Although...
  • OT: Apple Pie
    The holidays really give me a hankering for pie.  I made some apple pies awhile back after going apple picking, and I took a couple photos. ...
  • Software product country of origin (COO)
    Late last year, US Customs ( CBP ) issued an advisory ruling regarding how to determine the COO for software products when software is deve...
  • Critical Bugs and Quality Assurance
    Sebastian Huber recently posted a nasty RTEMS bug and fix. While simple, the bug manifested in their application as an increase in one task...
  • Understanding Energy and Power
    Lately I've been looking at power as an evaluation metric for my research. Power consumption has always been an important design concer...

Categories

  • cerification
  • computer architecture
  • computer security
  • COO
  • cooking
  • gem5
  • git
  • government
  • GSoC
  • hacking
  • LaTeX
  • life
  • linux
  • lolcat
  • Lua
  • mentorsummit
  • OOP
  • open source software
  • rant
  • research
  • RTEMS
  • science
  • sisu
  • space
  • thesis
  • VC
  • visualization
  • work

Blog Archive

  • ►  2013 (12)
    • ►  October (1)
    • ►  May (3)
    • ►  April (1)
    • ►  February (4)
    • ►  January (3)
  • ►  2012 (12)
    • ►  November (1)
    • ►  October (6)
    • ►  August (1)
    • ►  May (2)
    • ►  April (2)
  • ▼  2011 (29)
    • ►  December (5)
    • ►  November (3)
    • ►  October (2)
    • ►  September (2)
    • ▼  August (2)
      • multilib
      • Red Black Trees: Bottom-Up or Top-Down?
    • ►  July (5)
    • ►  June (2)
    • ►  May (2)
    • ►  April (2)
    • ►  March (2)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (19)
    • ►  December (2)
    • ►  November (2)
    • ►  July (3)
    • ►  June (2)
    • ►  May (3)
    • ►  April (2)
    • ►  March (5)
Powered by Blogger.

About Me

Unknown
View my complete profile