All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Kochan <vadim4j@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/1] git: Fix libintl linking if there is no full gettext support
Date: Sat, 25 Aug 2018 16:10:27 +0300	[thread overview]
Message-ID: <20180825131027.6048-1-vadim4j@gmail.com> (raw)

From: Vadim Kochan <vadim.kochan@petcube.com>

Git could not resolve libntl_xxx symbols if toolchain does no provide
full gettext support but the gettext package is selected.

Steps to reproduce:
    1) make menuconfig
    2) Toolchain -> Select WCHAR
    3) System -> select NLS
    4) Target packages -> Development -> select git

In case of ulibc/musl toolchain there is no full getttext support, but
they still provides libintl stub which makes git think there is full
gettext support hence -lintl is not passed to the linker.

Added workaround which checks if NLS is enabled, if yes then -lintl will
be added to EXTLIBS variable within config.mak file.

Signed-off-by: Vadim Kochan <vadim.kochan@petcube.com>
---
v2:
    - added steps to reproduce in commit message
    - use $(TARGET_NLS_LIBS) to specify -lintl

 package/git/git.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/git/git.mk b/package/git/git.mk
index ac7b8f2e8c..fb5889dec7 100644
--- a/package/git/git.mk
+++ b/package/git/git.mk
@@ -63,8 +63,16 @@ endif
 
 ifeq ($(BR2_SYSTEM_ENABLE_NLS),)
 GIT_MAKE_OPTS += NO_GETTEXT=1
+else
+GIT_EXTLIBS += $(TARGET_NLS_LIBS)
 endif
 
+define GIT_GEN_EXT_CONFIG_CMDS
+	echo "EXTLIBS = $(GIT_EXTLIBS)" >> $(@D)/config.mak
+endef
+
+GIT_POST_CONFIGURE_HOOKS += GIT_GEN_EXT_CONFIG_CMDS
+
 GIT_INSTALL_TARGET_OPTS = $(GIT_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
 
 # assume yes for these tests, configure will bail out otherwise
-- 
2.14.1

             reply	other threads:[~2018-08-25 13:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-25 13:10 Vadim Kochan [this message]
2018-08-25 17:40 ` [Buildroot] [PATCH v2 1/1] git: Fix libintl linking if there is no full gettext support Thomas Petazzoni
2018-08-25 20:15   ` Vadim Kochan
2018-08-27  5:28     ` Vadim Kochan
2018-08-29 14:53       ` Vadim Kochan

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=20180825131027.6048-1-vadim4j@gmail.com \
    --to=vadim4j@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.