Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Galakhov <agalakhov@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/1] core: add option to force compiling C++ as C++11
Date: Mon, 7 Dec 2015 21:48:21 +0100	[thread overview]
Message-ID: <20151207214821.16c08d4d.agalakhov@gmail.com> (raw)
In-Reply-To: <5660D0FC.4000101@mind.be>

On Fri, 4 Dec 2015 00:32:12 +0100
Arnout Vandecappelle <arnout@mind.be> wrote:

> On 30-11-15 15:19, Alexey Galakhov wrote:
> > Many C++ libraries like boost and log4cplus use defines to be
> > compatible with both C++03 and C++11 standards. This causes ABI
> > incompatibilities between a library built with C++03 and an
> > application built with C++11. To avoid this, one has to built
> > libraries as C++11 as well.
> > 
> > This patch introduces the BR2_ENABLE_CPP11 configuration option
> > that forces passing --std=c++11 to the compiler while building C++
> > target libraries.
> > 
> > Signed-off-by: Alexey Galakhov <agalakhov@gmail.com>  
> 
>  Hi Alexey,
> 
>  I've been mulling about this for some time and I'm not sure if we
> really want this. First of all, as I wrote before, it should probably
> be done automatically somehow instead of being user-selectable.
> However, I'm also afraid that some packages will fail to build with
> --std=c++11. Since we will not enable this option in the
> autobuilders, we will not notice such problems.
> 
>  Do you know of other packages (other than boost) that expose this
> problem? Perhaps instead we should add an option to boost only?

Hi Arnout,

At least log4cplus suffers from the same problem. Theoretically it
should affect every package that uses move constructors and checks the
version using the __cplusplus macro.

Unfortunately, it is impossible to do this not user-selectable. The
correct setting depends upon third-party programs installed on top of
the buildroot, and we have no way to determine the correct settings for
them.

We may override this option on per-package basis in case it gives
compilation problems. Theoretically any modern compiler should work
fine even with legacy code in C++11 mode, so it should be more or less
safe to enable C++11 for everything.

Regards,
Alexey

  reply	other threads:[~2015-12-07 20:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 14:19 [Buildroot] [PATCH v2 1/1] core: add option to force compiling C++ as C++11 Alexey Galakhov
2015-12-03 23:32 ` Arnout Vandecappelle
2015-12-07 20:48   ` Alexey Galakhov [this message]
2016-04-15 20:28 ` Thomas Petazzoni

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=20151207214821.16c08d4d.agalakhov@gmail.com \
    --to=agalakhov@gmail.com \
    --cc=buildroot@busybox.net \
    /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