mirror of
https://github.com/PartialVolume/shredos.x86_64.git
synced 2026-02-25 20:12:12 +00:00
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. After discussing upstream [*], it turned out that our current patch, introduced with commitfe4b47a121(package/libnss: fix build failure on RHEL 7) to fix the bug, is wrong. The best way to fix it is to append -DLINUX to NATIVE_FLAGS in libnss.mk. [*] https://bugzilla.mozilla.org/show_bug.cgi?id=1603398 So let's append -DLINUX to NATIVE_FLAGS after HOST_CFLAGS to make sure <getopt.h> is included, 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. This reverts commitfe4b47a121. Fixes: http://autobuild.buildroot.net/results/797/797f07ff757e7972d8c96b6a9f6abe68d17e0808/ Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com> [yann.morin.1998@free.fr: - meld the two commits into one - update and rearrange the commit log accordingly ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>