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 v3] package/libnss: use correct CFLAGS and LDFLAGS
Date: Thu, 1 Aug 2019 00:52:00 +0200	[thread overview]
Message-ID: <20190801005200.23317a95@windsurf.home> (raw)
In-Reply-To: <20190729142610.21331-1-giulio.benetti@micronovasrl.com>

Hello Giulio,

On Mon, 29 Jul 2019 16:26:10 +0200
Giulio Benetti <giulio.benetti@micronovasrl.com> wrote:

> Actually libnss is configure with BUILD_OPT=1 that doesn't take into
> account TARGET_CFLAGS nor TARGET_LDFLAGS resulting in pre-chosen
> optimizations and debugging symbols.
> 
> Can't pass TARGET_CFLAGS through CFLAGS or similar otherwise other
> internal libnss one will be overwritten(i.e. -fPIC), so prefer to append
> TARGET_CFLAGS at the end of Linux.mk as well as TARGET_LDFLAGS according
> to internal libnss Makefile system's names. And obviously remove
> BUILD_OPT=1 from BUILD_VARS. This reveals hidden bugs when building
> with -Os due to uninitialized variables so add patches to fix those
> bugs.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>

In fact, after inspecting more closely those uninitialized warnings
from gcc, they are bogus. The variables are properly initialized, it's
just gcc that goes nuts. So the proper fix is not to change the libnss
code, and your patches are most likely going to be rejected upstream
(with good reason).

So instead, I've dropped all of the patches, and simply passed
NSS_ENABLE_WERROR=0 for both the target and host builds. This way
-Werror is not passed, and those warnings become just warnings.

Applied with this change. Thanks!

Best regards,

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

  reply	other threads:[~2019-07-31 22:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 14:26 [Buildroot] [PATCH v3] package/libnss: use correct CFLAGS and LDFLAGS Giulio Benetti
2019-07-31 22:52 ` Thomas Petazzoni [this message]
2019-08-01  9:12   ` Giulio Benetti
2019-08-01  9:46     ` Thomas Petazzoni
2019-08-01 10:04       ` Giulio Benetti
2019-08-20 14:35 ` 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=20190801005200.23317a95@windsurf.home \
    --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