From patchwork Mon Jul 30 05:39:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 950717 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=none (p=none dis=none) header.from=mendozajonas.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="elnnBKYg"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="OY9Q0UYv"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41f7gn5dLkz9rvt for ; Mon, 30 Jul 2018 15:40:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7E1FA8907B; Mon, 30 Jul 2018 05:40:02 +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 UAAyQy4fEcK0; Mon, 30 Jul 2018 05:40:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 10AE688B1A; Mon, 30 Jul 2018 05:40:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 9CCE61C2849 for ; Mon, 30 Jul 2018 05:39:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 99C1E87E58 for ; Mon, 30 Jul 2018 05:39:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H-r0NBEvFFyS for ; Mon, 30 Jul 2018 05:39:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by fraxinus.osuosl.org (Postfix) with ESMTPS id D466287DF7 for ; Mon, 30 Jul 2018 05:39:57 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 4AA8C21BA5; Mon, 30 Jul 2018 01:39:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 30 Jul 2018 01:39:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=oA1e3SmK/s8DaM58j xNfCe1RY4oJtkHUVyo8hyzYCmo=; b=elnnBKYguIOHC1EnfO+Nb/66kiK6XXGFL lB65NZkGmtuX4gTDJVzn0e1N3KZTmzvEqYBN7gDLLenl/zUVeB6fPrfVAvj+Pks2 24GzjK+tCkY9ji2JeamcH8FjK+YF1Ia6NUp+4BghduFwoNcReikOC2Ifro/oBOp1 ulmDiajUkoJobuav6U2AgqQMwtk+jQlkbFupbqCnr0JDgz0do+vo0KuNcrbUEYWI N7ibvhx2zZ1KEDOvVe3ixJ2w/eZr0xNaXixXYB6nZXtCOOcGrv+fc0Q6rNNnRdU2 H5jDTmgK1R1B1KKxLx8aXio/ZuMY9CErxgeZ1itHZHifpOu9vlZeA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=oA1e3SmK/s8DaM58j xNfCe1RY4oJtkHUVyo8hyzYCmo=; b=OY9Q0UYvZaKAcKkmQeCil4oGsJiHzHpwh sVQgW91EyoiuZNPxYIWz4gNlzfh4ZoDULLEG0dMQFNNofBwRqnRCpWxejeX3eZdf xG4AzZaesFtV40Cbxtd9J/Jwh+l0Jn0o4ivZMeyPH4sRSfDV+I+R9dny6hpnYASg NnUJAw6aOb7PuZ3PNv+THjYc9zWZ+/6eIMvWCeKhhalSH9EQVxHvZD2XsYRf2sOZ hyDlKtwGM3PaZu23qewprPXZIc/3wHPo6jW06Hp3KVFXEkEvzb1kO74J5QVyGYJB PLZrDEz03aU18SJ45W1Z9sXT+gz+NnWQCwBMCb+4P5cvIUoXiJeDg== X-ME-Proxy: X-ME-Sender: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id B23A4E4116; Mon, 30 Jul 2018 01:39:54 -0400 (EDT) From: Samuel Mendoza-Jonas To: buildroot@buildroot.org Date: Mon, 30 Jul 2018 15:39:36 +1000 Message-Id: <20180730053936.26460-1-sam@mendozajonas.com> X-Mailer: git-send-email 2.18.0 Subject: [Buildroot] [RFC PATCH] host-localedef: Compile against glibc X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In glibc 2.27 the following change occured: "Statically compiled applications attempting to load locales compiled for the GNU C Library version 2.27 will fail and fall back to the builtin C/POSIX locale." This impacts us since upstream buildroot uses a localdef built against an older eglibc release [0]. Update the host-localedef package to build against glibc 2.27. Unfortunately we can't compile just the localedef utility, but even so this does not increase the build time too significantly. eg: With glibc localedef: real 33m11.278s user 171m51.684s sys 19m46.528s With eglibc localedef: real 31m12.715s user 155m13.616s sys 16m23.504s [0] https://bugs.busybox.net/show_bug.cgi?id=11096 Signed-off-by: Samuel Mendoza-Jonas --- This is a patch we're using in our own Buildroot branch to keep us going until a solution is found for the above bug report. While it does add a few minutes to our example build it avoids hacking glibc to only build localedef which is a solution some other users have gone for. Definitely an RFC as I'm sure some of the configuration in localedef.mk could be trimmed down but I took the safer bet of basing it off the existing glibc.mk. .../0001-Don-t-include-xlocale.h.patch | 50 ----------- package/localedef/localedef.hash | 2 +- package/localedef/localedef.mk | 87 +++++++++++++++++-- 3 files changed, 79 insertions(+), 60 deletions(-) delete mode 100644 package/localedef/0001-Don-t-include-xlocale.h.patch diff --git a/package/localedef/0001-Don-t-include-xlocale.h.patch b/package/localedef/0001-Don-t-include-xlocale.h.patch deleted file mode 100644 index 9a6c2f8e90..0000000000 --- a/package/localedef/0001-Don-t-include-xlocale.h.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: Bernhard Walle -Date: Mon, 2 Oct 2017 16:55:23 +0200 -Subject: [PATCH] Don't include - -This header has been removed in glibc 2.26: - -https://abi-laboratory.pro/tracker/changelog/glibc/2.26/log.html - ------------------------- >8 ------------------------ -* The nonstandard header has been removed. Most programs should - use instead. If you have a specific need for the definition of - locale_t with no other declarations, please contact - libc-alpha@sourceware.org and explain. ------------------------- 8< ------------------------ - -Signed-off-by: Bernhard Walle - -Upstream: https://git.pengutronix.de/cgit/ptxdist/tree/patches/localedef-eglibc-2.14.1-r17443-ptx1/0003-Don-t-include-xlocale.h.patch -Signed-off-by: Peter Seiderer ---- - eglibc/locale/langinfo.h | 2 +- - eglibc/locale/locale.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/eglibc/locale/langinfo.h b/eglibc/locale/langinfo.h -index 0a5336507196..76707a4584c1 100644 ---- a/eglibc/locale/langinfo.h -+++ b/eglibc/locale/langinfo.h -@@ -589,7 +589,7 @@ extern char *nl_langinfo (nl_item __item) __THROW; - more information. */ - - /* Get locale datatype definition. */ --# include -+# include - - /* Just like nl_langinfo but get the information from the locale object L. */ - extern char *nl_langinfo_l (nl_item __item, __locale_t __l); -diff --git a/eglibc/locale/locale.h b/eglibc/locale/locale.h -index 2aa19e76acb2..18be711a2d40 100644 ---- a/eglibc/locale/locale.h -+++ b/eglibc/locale/locale.h -@@ -143,7 +143,7 @@ __END_NAMESPACE_STD - This is a proof-of-concept implementation. */ - - /* Get locale datatype definition. */ --# include -+# include_next - - /* Return a reference to a data structure representing a set of locale - datasets. Unlike for the CATEGORY parameter for `setlocale' the diff --git a/package/localedef/localedef.hash b/package/localedef/localedef.hash index ee14fb16b8..6f2d6313b6 100644 --- a/package/localedef/localedef.hash +++ b/package/localedef/localedef.hash @@ -1,2 +1,2 @@ # Locally calculated -sha256 9a60f7cdab6fb39adf23a12102f2d950d5f07f0cd7e51e85ec327e07440a79c6 localedef-eglibc-2.14.1-r17443-ptx1.tar.bz2 +sha256 33189b3f10c88730a1f686fac794bc01f31765f12ffd75bc5e8a0f2a690d217a localedef-glibc-2.27-57-g6c99e37f6fb640a50a3113b2dbee5d5389843c1e.tar.gz diff --git a/package/localedef/localedef.mk b/package/localedef/localedef.mk index 11d9ba3848..c93132cc3f 100644 --- a/package/localedef/localedef.mk +++ b/package/localedef/localedef.mk @@ -4,19 +4,88 @@ # ################################################################################ -LOCALEDEF_VERSION = 2.14.1-r17443-ptx1 -LOCALEDEF_SOURCE = localedef-eglibc-$(LOCALEDEF_VERSION).tar.bz2 -LOCALEDEF_SITE = http://www.pengutronix.de/software/ptxdist/temporary-src +# Use the same VERSION and SITE as target glibc +LOCALEDEF_VERSION = glibc-2.27-57-g6c99e37f6fb640a50a3113b2dbee5d5389843c1e +LOCALEDEF_SITE = $(call github,bminor,glibc,$(GLIBC_VERSION)) -HOST_LOCALEDEF_CONF_OPTS += \ - --prefix=/usr \ - --with-glibc=./eglibc +HOST_LOCALEDEF_LICENSE = GPL-2.0+ (programs), LGPL-2.1+, BSD-3-Clause, MIT (library) +HOST_LOCALEDEF_LICENSE_FILES = COPYING COPYING.LIB LICENSES -HOST_LOCALEDEF_CONF_ENV = CFLAGS="$(HOST_CFLAGS) -fgnu89-inline" +# glibc is part of the toolchain so disable the toolchain dependency +HOST_LOCALEDEF_ADD_TOOLCHAIN_DEPENDENCY = NO -# The makefile does not implement an install target +HOST_LOCALEDEF_SUBDIR = build + +# Thumb build is broken, build in ARM mode +ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y) +HOST_LOCALEDEF_EXTRA_CFLAGS += -marm +endif + +# MIPS64 defaults to n32 so pass the correct -mabi if +# we are using a different ABI. OABI32 is also used +# in MIPS so we pass -mabi=32 in this case as well +# even though it's not strictly necessary. +ifeq ($(BR2_MIPS_NABI64),y) +HOST_LOCALEDEF_EXTRA_CFLAGS += -mabi=64 +else ifeq ($(BR2_MIPS_OABI32),y) +HOST_LOCALEDEF_EXTRA_CFLAGS += -mabi=32 +endif + +ifeq ($(BR2_ENABLE_DEBUG),y) +HOST_LOCALEDEF_EXTRA_CFLAGS += -g +endif + +# The stubs.h header is not installed by install-headers, but is +# needed for the gcc build. An empty stubs.h will work, as explained +# in http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html. The same trick +# is used by Crosstool-NG. +ifeq ($(BR2_TOOLCHAIN_BUILDROOT_HOST_LOCALEDEF),y) +define HOST_LOCALEDEF_ADD_MISSING_STUB_H + mkdir -p $(STAGING_DIR)/usr/include/gnu + touch $(STAGING_DIR)/usr/include/gnu/stubs.h +endef +endif + +# Even though we use the autotools-package infrastructure, we have to +# override the default configure commands for several reasons: +# +# 1. We have to build out-of-tree, but we can't use the same +# 'symbolic link to configure' used with the gcc packages. +# +# 2. We have to execute the configure script with bash and not sh. +# +# Note that as mentionned in +# http://patches.openembedded.org/patch/38849/, glibc must be +# built with -O2, so we pass our own CFLAGS and CXXFLAGS below. +define HOST_LOCALEDEF_CONFIGURE_CMDS + mkdir -p $(@D)/build + # Do the configuration + (cd $(@D)/build; \ + $(HOST_CONFIGURE_OPTS) \ + CFLAGS="-O2 $(HOST_LOCALEDEF_EXTRA_CFLAGS)" CPPFLAGS="" \ + CXXFLAGS="-O2 $(HOST_LOCALEDEF_EXTRA_CFLAGS)" \ + $(SHELL) $(@D)/configure \ + ac_cv_path_BASH_SHELL=/bin/bash \ + libc_cv_forced_unwind=yes \ + libc_cv_ssp=no \ + --target=$(GNU_HOST_NAME) \ + --host=$(GNU_HOST_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + $(if $(BR2_SOFT_FLOAT),--without-fp,--with-fp) \ + $(if $(BR2_x86_64),--enable-lock-elision) \ + --with-pkgversion="Buildroot" \ + --without-cvs \ + --disable-profile \ + --without-gd \ + --enable-obsolete-rpc) + $(HOST_LOCALEDEF_ADD_MISSING_STUB_H) +endef + +$(eval $(autotools-package)) +# The makefile does not implement an install target for localedef define HOST_LOCALEDEF_INSTALL_CMDS - $(INSTALL) -D -m 0755 $(@D)/localedef $(HOST_DIR)/bin/localedef + $(INSTALL) -D -m 0755 $(@D)/build/locale/localedef $(HOST_DIR)/bin/localedef endef $(eval $(host-autotools-package))