All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/dhcpdump: fix build at -O2
Date: Fri, 28 Dec 2018 11:52:04 +0100	[thread overview]
Message-ID: <20181228115204.0159da51@windsurf> (raw)
In-Reply-To: <20181227151012.22996-1-thomas.petazzoni@bootlin.com>

Hello,

On Thu, 27 Dec 2018 16:10:11 +0100, Thomas Petazzoni wrote:
> Since commit aa556e2035c023d4328185a46e15df532e566067
> ("utils/genrandconfig: test with BR2_OPTIMIZE_2=y"), we are doing
> builds at -O2 instead of -Os. This has unveiled an issue in the
> strsep.c file:
> 
> strsep.c:65:23: error: register name not specified for 'delim'
>   register const char *delim;
> 
> This strsep.c compatibility code is compiled in if HAVE_STRSEP is not
> defined, but dhcpdump does not use any kind of configure script to
> detect the availability of strsep(). Therefore by default, it gets
> compiled in, and the "register" specifier used for some variable
> declarations in strsep.c cause build issues at -O2.
> 
> A previous commit in Buildroot from
> c2a7f0d6051f71f3bb9d83b574d70814339e4b95 ("dhcpdump: Fix strsep()
> feature test"), attempted to fix this problem by changing the test on
> HAVE_STRSEP by a test on _BSD_SOURCE.
> 
> Unfortunately, _BSD_SOURCE is not meant to be tested: it's a feature
> macro that is meant to be *defined* by some code to tell the C library
> headers to expose (or not) some given functionality.
> 
> So instead, we basically revert commit
> c2a7f0d6051f71f3bb9d83b574d70814339e4b95 by dropping the patch, and
> pass -DHAVE_STRSEP in the CFLAGS when building dhcpdump.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/7231170d3d3e3637f02382c1a0a96009b0527618/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  .../0002-fix-strsep-feature-test.patch        | 27 -------------------
>  package/dhcpdump/dhcpdump.mk                  |  5 +++-
>  2 files changed, 4 insertions(+), 28 deletions(-)
>  delete mode 100644 package/dhcpdump/0002-fix-strsep-feature-test.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-12-28 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-27 15:10 [Buildroot] [PATCH] package/dhcpdump: fix build at -O2 Thomas Petazzoni
2018-12-28 10:52 ` Thomas Petazzoni [this message]
2019-01-18 13:13 ` Peter Korsgaard

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=20181228115204.0159da51@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.