package/lshw: don't use NONLS when BR2_SYSTEM_ENABLE_NLS is not set
PATCH 1/1 package/lshw: don't use NONLS when BR2_SYSTEM_ENABLE_NLS is not set
Since [1], NONLS is added to LSHW_CFLAGS even for glibc based toolchain. Previously it was not the case since BR2_ENABLE_LOCALE is always selected for glibc based toolchain.
With NONLS, config.h try to redefine two Intl function (textdomain and bindtextdomain) that are used by glibc internally.
This break the build with the following error:sysroot/usr/include/libintl.h:82:52: error: expected unqualified-id before 'throw'
extern char *textdomain (const char *__domainname) __THROW;
The NONLS mode is really for cases where the C library does not provide *any* gettext implementation, as would be the case with uClibc without intl stubs enabled.
But in the context of Buildroot, all C libraries provide a gettext implementation. It might be full-featured or minimal, but it always exists.
So, remove NONLS from CFLAGS to avoid the build issue with glibc toolchains.
Build tested with a uClibc toolchain without locale enabled.
Fixes:
http://autobuild.buildroot.net/results/9bf/9bf5437b4348ea8077013b80a51ce05fa328247d
[1] 3acd9f845de0489071719d52d774aab48d7f9c33
--- package/lshw/lshw.mk | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
package/lshw/lshw.mk +1 -6
@@ -9,13 +9,8 @@ LSHW_SITE = http://ezix.org/software/files LSHW_LICENSE = GPL-2.0 LSHW_LICENSE_FILES = COPYING -LSHW_CFLAGS = $(TARGET_CFLAGS) -ifeq ($(BR2_SYSTEM_ENABLE_NLS),) -LSHW_CFLAGS += -DNONLS -endif - LSHW_MAKE_OPTS = CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" AR="$(TARGET_AR)" \ - RPM_OPT_FLAGS="$(LSHW_CFLAGS)" all + RPM_OPT_FLAGS="$(TARGET_CFLAGS)" all LSHW_MAKE_ENV = \ $(TARGET_MAKE_ENV) \ LIBS=$(TARGET_NLS_LIBS)
Signature · 1 line
2.9.4
Thomas Petazzoni
AppliedPATCH 1/1 package/lshw: don't use NONLS when BR2_SYSTEM_ENABLE_NLS is not set
Hello,
Quoted 27 lines · Romain Naour
Since [1], NONLS is added to
LSHW_CFLAGSeven for glibc based toolchain. Previously it was not the case sinceBR2_ENABLE_LOCALEis always selected for glibc based toolchain.With NONLS,
config.htry to redefine two Intl function (textdomain and bindtextdomain) that are used by glibc internally.This break the build with the following error:
sysroot/usr/include/libintl.h:82:52: error: expected unqualified-id before 'throw'
extern char *textdomain (const char*__domainname)__THROW;The NONLS mode is really for cases where the C library does not provide *any* gettext implementation, as would be the case with uClibc without intl stubs enabled.
But in the context of Buildroot, all C libraries provide a gettext implementation. It might be full-featured or minimal, but it always exists.
So, remove NONLS from CFLAGS to avoid the build issue with glibc toolchains.
Build tested with a uClibc toolchain without locale enabled.
Fixes:
http://autobuild.buildroot.net/results/9bf/9bf5437b4348ea8077013b80a51ce05fa328247d
Quoted 8 lines
[1]
3acd9f845de0489071719d52d774aab48d7f9c33Signed-off-by Romain Naour <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Gustavo Zacarias <[email protected]>--- package/lshw/lshw.mk | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com