linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Bart Van Assche <bart.vanassche@gmail.com>
Cc: "Leisner, Martin" <Martin.Leisner@xerox.com>,
	Bernd Petrovitsch <bernd@firmix.at>,
	Alexander Neundorf <neundorf@eit.uni-kl.de>,
	linux-embedded@vger.kernel.org
Subject: Re: prevalence of C++ in embedded linux?
Date: Wed, 30 Jul 2008 11:25:23 +0100	[thread overview]
Message-ID: <20080730102523.GB8992@shareable.org> (raw)
In-Reply-To: <e2e108260807292146n581b655an3119be9e33af871c@mail.gmail.com>

Bart Van Assche wrote:
> On Tue, Jul 29, 2008 at 10:08 PM, Leisner, Martin
> <Martin.Leisner@xerox.com> wrote:
> > If you're embedded device has a window system, than a language like C++
> > is fine...But...
> 
> C++ is suited for much more than just windowing systems. A good
> example is the GOLD project, a linker for ELF files. GOLD is a rewrite
> of the GNU linker (ld). See also
> http://google-opensource.blogspot.com/2008/04/gold-google-releases-new-and-improved.html.

Is C++ intrinsic to GOLD's linking superiority over ld?  Or was it
chosen because the author fancied using it?  (I don't know).

There's been a resistance to using C++ in GNU programming tools
generally for a long time - see GCC which only recently switched to
ANSI C.  That's because they want the tools to run on lots of
platforms, and C++ templates in particular haven't been standardly
implemented until the last few years, and probably still aren't on
some platforms that they'd like to run GNU tools on.

So using C++ in GOLD was a bit of a bold decision :-)

What I can't help noticing is that GOLD, while superior for linking
straight GNU/Linux applications due to better algorithms, and
extremely knowledgable author etc. - it explicitly does not support
anything but ELF.  It doesn't support the zillions of linker
capabilities of GNU binutils ld, and the author says he doesn't intend
it to.

So it won't ever be suitable for linking some embedded targets -
you'll still need to use Binutils ld/objdump or another tool, at least
for the last step :-)

Binutils' undoing is probably the complexity in its approach to
generically supporting every kind of linkable object anywhere.  That
complexity is the reason we have the ugly 'elf2flt' instead of simply
a backend which emits uClinux executable formats.  The authors of
uClinux tools found it easier to postprocess the output than to write
another format backend.

I don't think C++ would help a lot with that complexity if you wanted
to still support lots of different formats - although another language
with versatile metaprogramming might.  (There's a lot to choose from).
I could be wrong of course.

-- Jamie

  reply	other threads:[~2008-07-30 10:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-28 15:43 prevalence of C++ in embedded linux? Robert P. J. Day
2008-07-28 15:54 ` Chris
2008-07-28 15:55 ` Jamie Lokier
2008-07-28 16:15 ` Domenico Andreoli
2008-07-28 17:30 ` Matthias Kaehlcke
2008-07-28 21:47 ` Ben Nizette
2008-07-29  5:42   ` Roberto A. Foglietta
2008-08-02  4:14   ` Ben Nizette
2008-07-29  7:40 ` Marco Stornelli
2008-07-29  7:51   ` Alexander Neundorf
2008-07-29  8:20     ` Bernd Petrovitsch
2008-07-29  8:35       ` Marco Stornelli
2008-07-29  8:58       ` Alexander Neundorf
2008-07-29  9:47         ` Bernd Petrovitsch
2008-07-29 20:08           ` Leisner, Martin
2008-07-30  4:46             ` Bart Van Assche
2008-07-30 10:25               ` Jamie Lokier [this message]
2008-07-30 11:04                 ` Bart Van Assche
2008-07-30 11:58                   ` Haavard Skinnemoen
2008-07-30 12:38                     ` Jamie Lokier
2008-07-30 13:01                       ` Haavard Skinnemoen
2008-07-30 12:48                   ` Bernd Petrovitsch
2008-07-30 13:07                     ` Jamie Lokier
2008-07-30 13:58                       ` Bernd Petrovitsch
2008-07-30 10:16             ` Jamie Lokier
2008-07-29  8:50   ` Bart Van Assche
2008-07-29 11:39     ` Richard Danter

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=20080730102523.GB8992@shareable.org \
    --to=jamie@shareable.org \
    --cc=Martin.Leisner@xerox.com \
    --cc=bart.vanassche@gmail.com \
    --cc=bernd@firmix.at \
    --cc=linux-embedded@vger.kernel.org \
    --cc=neundorf@eit.uni-kl.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;
as well as URLs for NNTP newsgroup(s).