From patchwork Tue Apr 16 22:51:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1086723 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CS0rxlQV"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44kL2p6k58z9s9T for ; Wed, 17 Apr 2019 08:41:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A4DC58798B; Tue, 16 Apr 2019 22:41:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xIUAu8O2UmKY; Tue, 16 Apr 2019 22:41:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id F22B287B0F; Tue, 16 Apr 2019 22:41:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 8F8AC1BF9A0 for ; Tue, 16 Apr 2019 22:41:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8C4538798B for ; Tue, 16 Apr 2019 22:41:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 66F9zin8vA-H for ; Tue, 16 Apr 2019 22:41:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by hemlock.osuosl.org (Postfix) with ESMTPS id 2E51487B0F for ; Tue, 16 Apr 2019 22:41:46 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id k8so20615241lja.8 for ; Tue, 16 Apr 2019 15:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=uomadEqFMnPHlGUnVwrcP0JBGMczkNgJilbfXZtF9B4=; b=CS0rxlQVKlPVD0axO2lLQIsSDOMM6tWPy0n35YVPsCrb4+lQ34piYPH1gOAIuMjEKT Mu7vIVX5lxajnj2KoP0WzTI52TTMQ+Msy8feTr2T+ZU8JIqJlbzL0ptQDoHZLQ6ToHKk Qti2tymqAeYIGlCD8vcWUubOOClK1a005rGfQxi6xybJMLZG0zdQxHNvYkqMmWLHCg5W A2kU9LOT+l2IVzI+dPSSsCpaoCoWVudxGSyVx2s70Op8b9AUQMFg69NGx+iNK+RNn5DQ Tyw41e0x9ennNx9Lm6AWh7JXJPHRezeyIk1Ib47wfYWHRswdVKtl2ZvZFJvs2diyyxP5 nmYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uomadEqFMnPHlGUnVwrcP0JBGMczkNgJilbfXZtF9B4=; b=kHcmheOshJ3BmyKx0p7UIwqYyMZWaE7Oxs4RO2+Yax4OyJQ5IgSvwTvqArb2kgox3P NNd/wGtfzEhIxzQg6taM3+tMi/C3hfj+UBLZoIU6HDX4eOtXK4qV2TeYYuExqohJu/8U c71w5Pc/frzK8l5RTz7orz4lppJVKS2yAFPBbuUqIPCYHk2Hwm6lOrYKcIlYm3HuJIzr ME/VFoUsvimS7g7m18BAmGTc+wrM1pufomGHN0Ks2g0hZ26xb+nS9UwDZhqpMJrgycnV j1TBjT0SANJHdpX/eCyU1gjZYENzO7qPFGJFn0nGmqE5NZhYAi9Cl9b0jiXd767YrcOh ECPg== X-Gm-Message-State: APjAAAUK2Zv1jJ2EFOJ43BXetKCg03l09qizp3/sv1bu4zdLEobWOEzc TEhcQLI3V+cPCnfAflROcTOSkATf X-Google-Smtp-Source: APXvYqyphxrLNhH0EJyhc2XXlooRbLOsawLTAEUuL68EoIr3j6VjGeSMgH1ziQJv1GXjlT5oi4FiMw== X-Received: by 2002:a2e:7d19:: with SMTP id y25mr23408486ljc.126.1555454504050; Tue, 16 Apr 2019 15:41:44 -0700 (PDT) Received: from vkochan-ThinkPad-T470p.lan ([93.75.250.209]) by smtp.gmail.com with ESMTPSA id n10sm11761156ljh.36.2019.04.16.15.41.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 15:41:43 -0700 (PDT) From: Vadim Kochan To: buildroot@buildroot.org Date: Wed, 17 Apr 2019 01:51:54 +0300 Message-Id: <20190416225154.4760-1-vadim4j@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [PATCH 1/1] package/git: Fix build with NLS enabled X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vadim Kochan MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" git fails to build with NLS enabled because of weak check for gettext in configure.ac. The AC_CHECK_LIB(c, gettext ...) is used to set LIBC_CONTAINS_LIBINTL variable. If the variable is set then '-libs' is not passed to the linker, but this variable is set to 'Yes' even libc implementation does not provide libintl support, the AC_CHECK passes because gcc has gettext builtin. So use instead AC_LINK_IFELSE with included libintl.h because it makes gettext to unfold as libintl_gettext which causes AC_CHECK to fail for cases when gettext is not provided by libc. Tested by ./utils/test-pkg with NLS disabled/enabled. Fixes: http://autobuild.buildroot.net/results/091b790ca6f5b46d5d29211dc1cb3ff05b62a965 http://autobuild.buildroot.net/results/a69b58b35b270fdd2df9b076e7030bb594520197 http://autobuild.buildroot.net/results/f104c4e6ff41b1dd175f2d27f3b4ea7c9b61f7c5 http://autobuild.buildroot.net/results/ee12bdba398a139995de5f6f6718be6a493541d9 http://autobuild.buildroot.net/results/74fa6b2bfbb1301e35c9dd1bbc04856c1cbf25f2 Signed-off-by: Vadim Kochan --- ...1-configure.ac-Properly-check-for-libintl.patch | 49 ++++++++++++++++++++++ package/git/git.mk | 1 + 2 files changed, 50 insertions(+) create mode 100644 package/git/0001-configure.ac-Properly-check-for-libintl.patch diff --git a/package/git/0001-configure.ac-Properly-check-for-libintl.patch b/package/git/0001-configure.ac-Properly-check-for-libintl.patch new file mode 100644 index 0000000000..2f367f547a --- /dev/null +++ b/package/git/0001-configure.ac-Properly-check-for-libintl.patch @@ -0,0 +1,49 @@ +From 01da08fd60a0bdb2994f85f943dba148d9321d4d Mon Sep 17 00:00:00 2001 +From: Vadim Kochan +Date: Wed, 17 Apr 2019 01:25:40 +0300 +Subject: [PATCH 1/1] configure.ac: Properly check for libintl + +Some libc implementations like uclibc or musl provides +gettext stubs via libintl library but this case is not checked +by AC_CHECK_LIBRARY(c, gettext ...) because gcc has gettext as builtin +which passess the check. + +So check it with included libintl.h where gettext may unfold into +libintl_gettext which will cause check to fail if libintl_gettext are +needed to be linked with -lintl. + +Signed-off-by: Vadim Kochan +--- + configure.ac | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7f84151..0b8e25f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -762,9 +762,19 @@ AC_CHECK_LIB([c], [basename], + GIT_CONF_SUBST([NEEDS_LIBGEN]) + test -n "$NEEDS_LIBGEN" && LIBS="$LIBS -lgen" + +-AC_CHECK_LIB([c], [gettext], +-[LIBC_CONTAINS_LIBINTL=YesPlease], +-[LIBC_CONTAINS_LIBINTL=]) ++AC_DEFUN([LIBINTL_SRC], [ ++AC_LANG_PROGRAM([[ ++#include ++]],[[ ++char *msg = gettext("test"); ++]])]) ++ ++AC_MSG_CHECKING([if libc contains libintl]) ++AC_LINK_IFELSE([LIBINTL_SRC], ++ [AC_MSG_RESULT([yes]) ++ LIBC_CONTAINS_LIBINTL=YesPlease], ++ [AC_MSG_RESULT([no]) ++ LIBC_CONTAINS_LIBINTL=]) + GIT_CONF_SUBST([LIBC_CONTAINS_LIBINTL]) + + # +-- +2.14.1 + diff --git a/package/git/git.mk b/package/git/git.mk index aec30e3eb3..804a6e2325 100644 --- a/package/git/git.mk +++ b/package/git/git.mk @@ -10,6 +10,7 @@ GIT_SITE = $(BR2_KERNEL_MIRROR)/software/scm/git GIT_LICENSE = GPL-2.0, LGPL-2.1+ GIT_LICENSE_FILES = COPYING LGPL-2.1 GIT_DEPENDENCIES = zlib $(TARGET_NLS_DEPENDENCIES) +GIT_AUTORECONF = YES ifeq ($(BR2_PACKAGE_OPENSSL),y) GIT_DEPENDENCIES += host-pkgconf openssl