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] libintl static linking issues - yet another spin
Date: Mon, 3 Apr 2017 15:02:17 +0200	[thread overview]
Message-ID: <20170403150217.788f6130@free-electrons.com> (raw)
In-Reply-To: <c5d92f69-e151-293b-3b77-3b2b061d0e50@mind.be>

Hello,

On Mon, 3 Apr 2017 14:45:12 +0200, Arnout Vandecappelle wrote:

>  And I guess musl also has it in a single libc? Yeah, I don't see a libintl
> there so I guess it's bundled.
> 
>  If we do enable the stubs in uClibc, and a packages links with -lintl, then in
> fact the full gettext will be used and the stubs are not even linked in
> (statically or dynamically), correct? In that case, we could indeed enable the
> stubs in uClibc. As a result, in static linking, any package that links with
> gettext but forgets an explicit -lintl will use the stubs instead of the full
> implementation. So the package still works, but without translations.

Does this actually work? Won't the linker complain about conflicting
symbols between libintl and libc? Are weak symbols in libc also working
in static linking scenarios?

>  As a side note, pretty much independent of this issue: I wonder if our
> BR2_NEEDS_GETTEXT_IF_LOCALE approach really is the right thing to do. It
> basically says: if a package is able to use translations, we force translations
> (by enabling gettext). Wouldn't it be much more appropriate to remove all those
> selects from Config.in, and instead just add to _DEPENDENCIES:
> $(if $(BR2_PACKAGE_GETTEXT),gettext) ? That allows the user to choose whether or
> not they want translations.

No, that's not what BR2_NEEDS_GETTEXT_IF_LOCALE says. What
BR2_NEEDS_GETTEXT_IF_LOCALE is really what it means: the package really
absolutely NEEDS gettext to be available if locale support is available
in the toolchain. I.e, with locale support enabled, the package would
*NOT* build if gettext is not available.

Of course, there might be incorrect uses of BR2_NEEDS_GETTEXT_IF_LOCALE
that don't follow this rule, and they should be fixed as you suggest,
but BR2_NEEDS_GETTEXT_IF_LOCALE remains needed for the case I explained
above. See the documentation:

"""
Packages that need gettext only when locale support is enabled should:

    use select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE in
    the Config.in file; 
"""

Best regards,

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

  reply	other threads:[~2017-04-03 13:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-26 21:53 [Buildroot] Patchwork cleanup, 10 patches to look at Thomas Petazzoni
2017-03-27 12:35 ` Arnout Vandecappelle
2017-03-27 13:43   ` Andrey Smirnov
2017-03-28 20:25   ` Thomas Petazzoni
2017-04-03 10:42     ` [Buildroot] libintl static linking issues - yet another spin Arnout Vandecappelle
2017-04-03 11:01       ` Thomas Petazzoni
2017-04-03 11:25         ` Arnout Vandecappelle
2017-04-03 12:11           ` Thomas Petazzoni
2017-04-03 12:30             ` Waldemar Brodkorb
2017-04-03 12:45             ` Arnout Vandecappelle
2017-04-03 13:02               ` Thomas Petazzoni [this message]
2017-04-03 14:12                 ` Arnout Vandecappelle
2017-04-01 16:52 ` [Buildroot] Patchwork cleanup, 10 patches to look at Thomas Petazzoni
2017-04-02  3:04   ` Carlos Santos

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=20170403150217.788f6130@free-electrons.com \
    --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