package/libnss: use correct CFLAGS and LDFLAGS
authorGiulio Benetti <giulio.benetti@micronovasrl.com>
Mon, 29 Jul 2019 14:26:10 +0000 (16:26 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 31 Jul 2019 22:48:26 +0000 (00:48 +0200)
commit5e787b001422b4bee24c8ffb7450da38fcc531a6
tree17b89ba77bb4fc788b224889ab8b2edc7fc9feed
parentccacb5516f5c4ca0fbb289ec4047ae3dec817406
package/libnss: use correct CFLAGS and LDFLAGS

Currently libnss is configured with BUILD_OPT=1 and due to that that
it doesn't take into account Buildroot TARGET_CFLAGS nor
TARGET_LDFLAGS resulting in pre-chosen optimizations and debugging
symbols being used.

We can't pass TARGET_CFLAGS through CFLAGS or similar otherwise other
internal libnss one will be overwritten (i.e. -fPIC), so we 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 bogus
uninitialized warnings from gcc turned into errors because of -Werror,
so we explicitly pass NSS_ENABLE_WERROR=0 to avoid the use of -Werror.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
[Thomas: drop the libnss patches, and pass NSS_ENABLE_WERROR instead]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/libnss/libnss.mk