From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] package/libnss: fix build failure on RHEL 7 using -DLINUX
Date: Wed, 8 Jan 2020 18:07:45 +0100 [thread overview]
Message-ID: <20200108170745.99342-2-giulio.benetti@benettiengineering.com> (raw)
In-Reply-To: <20200108170745.99342-1-giulio.benetti@benettiengineering.com>
NSS Makefile emits -DLINUX to OS_CFLAGS only if OS_TEST=Linux when
building for Target. But nsinstall.c is a host utility and it uses
NATIVE_FLAGS instead of OS_CFLAGS, this is why -DLINUX is not emitted.
This is necessary for the case one builds for Target OS Linux on a Host
OS that is not Linux.
So let's append -DLINUX to NATIVE_FLAGS after HOST_CFLAGS to make sure
<getopt.h> is include, since in nsintall.c it is included only if LINUX
macro is defined and this caused the build failure not finding getopt
functions and macros in some build environment(i.e. RHEL 7). On other
build environments getopt.h is indirectly included by unistd.h this is
why it worked on them.
Fixes:
http://autobuild.buildroot.net/results/797/797f07ff757e7972d8c96b6a9f6abe68d17e0808/
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
package/libnss/libnss.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/libnss/libnss.mk b/package/libnss/libnss.mk
index 950c9850d3..61950ade25 100644
--- a/package/libnss/libnss.mk
+++ b/package/libnss/libnss.mk
@@ -68,7 +68,7 @@ define LIBNSS_BUILD_CMDS
SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
DIST=$(@D)/$(LIBNSS_DISTDIR) \
CHECKLOC= \
- $(LIBNSS_BUILD_VARS) NATIVE_FLAGS="$(HOST_CFLAGS)"
+ $(LIBNSS_BUILD_VARS) NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX"
endef
define LIBNSS_INSTALL_STAGING_CMDS
--
2.20.1
next prev parent reply other threads:[~2020-01-08 17:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 17:07 [Buildroot] [PATCH 1/2] Revert "package/libnss: fix build failure on RHEL 7" Giulio Benetti
2020-01-08 17:07 ` Giulio Benetti [this message]
2020-01-08 22:01 ` Yann E. MORIN
2020-01-09 13:58 ` Giulio Benetti
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=20200108170745.99342-2-giulio.benetti@benettiengineering.com \
--to=giulio.benetti@benettiengineering.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