Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/lshw: fix the build with glibc without NLS
Date: Fri, 14 Jul 2017 21:40:32 +0200	[thread overview]
Message-ID: <20170714214032.793cf297@windsurf> (raw)
In-Reply-To: <18d648a6-f276-da68-d99a-62cf2e54d33a@gmail.com>

Hello,

On Fri, 14 Jul 2017 00:10:39 +0200, Romain Naour wrote:

> > ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
> > LSHW_CFLAGS += -DNONLS
> > endif  
> 
> Indeed, that's the first thing I removed during investigation.
> 
> I find misleading that BR2_SYSTEM_ENABLE_NLS not set does not mean NONLS for lshw.

I think that's OK. For lshw, NONLS really means "there is absolutely no
gettext functions provided by the C library", which is never the case
in the context of Buildroot.

Can you send an updated patch that simply removes the -DNONLS ?

> I'm wondering if lshw build fine with a toolchain with wchar but without locale
> (ok it's a corner case).
> 
> See src/lshw.cc:#ifndef NONLS
> 
> #ifndef NONLS
> #include <locale.h>
> #endif
> 
> ...
> 
> #ifndef NONLS
>   setlocale (LC_ALL, "");

Not a problem I believe. From libc/misc/locale/Makefile.in in uClibc-ng:

# multi source locale.c
CSRC-y := setlocale.c localeconv.c _locale_init.c nl_langinfo.c
CSRC-$(UCLIBC_HAS_LOCALE) += newlocale.c __locale_mbrtowc_l.c
CSRC-$(UCLIBC_HAS_XLOCALE) += nl_langinfo_l.c duplocale.c freelocale.c \
        uselocale.c __curlocale.c

Hence, it seems like a uClibc-ng built with UCLIBC_HAS_LOCALE disabled
will still have a setlocale() function.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

      reply	other threads:[~2017-07-14 19:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 21:04 [Buildroot] [PATCH] package/lshw: fix the build with glibc without NLS Romain Naour
2017-07-13 21:28 ` Thomas Petazzoni
2017-07-13 22:10   ` Romain Naour
2017-07-14 19:40     ` Thomas Petazzoni [this message]

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=20170714214032.793cf297@windsurf \
    --to=thomas.petazzoni@free-electrons.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