Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/5] package/gdb: rework dependency for C++11
Date: Wed, 7 Feb 2018 13:36:01 +0100	[thread overview]
Message-ID: <20180207133602.36f7646a@windsurf> (raw)
In-Reply-To: <20180207095828.GA2464@scaer>

Hello,

On Wed, 7 Feb 2018 10:58:28 +0100, Yann E. MORIN wrote:

> >  - In Config.in, we handle gdb more like a regular target package,
> >    with a Config.in comment when its dependencies are not met. A
> >    hidden boolean BR2_PACKAGE_GDB_NEEDS_CXX11 indicates when the
> >    currently selected version requires C++11. Based on that, we show
> >    the Config.in comment, and add the proper dependencies to
> >    BR2_PACKAGE_GDB. It is worth mentioning that
> >    BR2_PACKAGE_GDB_NEEDS_CXX11 is intentionally created to be !7.10 &&
> >    !7.11 && !7.12 instead of 8.0, because we will gradually add more
> >    C++11-requiring versions, and remove non-C++11-requiring versions.  
> 
> Nice refactoring. :-)

Thanks!


> > +config BR2_PACKAGE_GDB_NEEDS_CXX11
> > +	bool
> > +	default y
> > +	depends on !BR2_GDB_VERSION_7_10
> > +	depends on !BR2_GDB_VERSION_7_11
> > +	depends on !BR2_GDB_VERSION_7_12  
> 
> I would have expected that the various versions would select this,
> i.e. something like:
> 
>     config BR2_PACKAGE_GDB_NEEDS_CXX11
>         bool
> 
> 
>     config BR2_GDB_VERSION_7_10
>         bool "7.10"
> 
>     config BR2_GDB_VERSION_8_0
>         bool "8.0"
>         select BR2_PACKAGE_GDB_NEEDS_CXX11

But this doesn't work; The BR2_GDB_VERSION_8_0 symbol is only enabled
if we build a host variant of gdb. If we build just the target
variant, then no version is selected at all, and therefore this symbol
would not be selected.

So in fact, even my code is slightly wrong: it becomes correct once the
default version of gdb is 8.0, but it is wrong when the default version
is still 7.12 (which is the case at the time my patch is introduced).

Indeed, when my patch is introduced, 7.12 is the default gdb version,
used if you build only the target gdb. When you build just the target
gdb version, BR2_GDB_VERSION_7_12 is not enabled, and therefore
BR2_PACKAGE_GDB_NEEDS_CXX11=y even if it's not true.

So I should adjust that. I could use the BR2_GDB_VERSION string
option, which exists regardless of whether host gdb is enabled or not.
Or I could rely on BR2_PACKAGE_HOST_GDB somehow.

Meh. This is crappy :)

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com

  reply	other threads:[~2018-02-07 12:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-05 21:10 [Buildroot] [PATCH v2 0/5] Add gdb 8.1 support, switch to 8.0 as default, drop old versions Thomas Petazzoni
2018-02-05 21:10 ` [Buildroot] [PATCH v2 1/5] package/gdb: rework dependency for C++11 Thomas Petazzoni
2018-02-07  9:58   ` Yann E. MORIN
2018-02-07 12:36     ` Thomas Petazzoni [this message]
2018-02-07 17:34       ` Yann E. MORIN
2018-02-08  0:22         ` Arnout Vandecappelle
2018-02-08  8:05           ` Thomas Petazzoni
2018-02-05 21:10 ` [Buildroot] [PATCH v2 2/5] package/gdb: bump to version 8.1 Thomas Petazzoni
2018-02-07 10:02   ` Yann E. MORIN
2018-02-07 12:36     ` Thomas Petazzoni
2018-02-05 21:10 ` [Buildroot] [PATCH v2 3/5] package/gdb: switch to 8.0 as the default version Thomas Petazzoni
2018-02-07 10:10   ` Yann E. MORIN
2018-02-05 21:10 ` [Buildroot] [PATCH v2 4/5] package/gdb: remove 7.10 Thomas Petazzoni
2018-02-07 10:12   ` Yann E. MORIN
2018-02-05 21:10 ` [Buildroot] [PATCH v2 5/5] package/gdb: remove 7.11 Thomas Petazzoni
2018-02-07 10:13   ` Yann E. MORIN

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=20180207133602.36f7646a@windsurf \
    --to=thomas.petazzoni@bootlin.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