From patchwork Tue Sep 12 14:43:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Perez de Castro X-Patchwork-Id: 812878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="RHdu1Ia6"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xs6xg5ZTrz9s3T for ; Wed, 13 Sep 2017 00:44:06 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 17E9E2F980; Tue, 12 Sep 2017 14:44:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id adHfPOYsoDbV; Tue, 12 Sep 2017 14:43:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id BC35426704; Tue, 12 Sep 2017 14:43:57 +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 193A91BFE90 for ; Tue, 12 Sep 2017 14:43:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 132BC893AD for ; Tue, 12 Sep 2017 14:43:56 +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 TjZVDsSNkYIX for ; Tue, 12 Sep 2017 14:43:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fanzine.igalia.com (fanzine.igalia.com [91.117.99.155]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1B92288A24 for ; Tue, 12 Sep 2017 14:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Message-Id:Date:Subject:To:From; bh=W35JnjiO1ZFIB35yyRiA2luEMtiYUCExua5TJXaFUjs=; b=RHdu1Ia6dR8y+V70nq9w6TNvTnoiQZsDkkBYpFelSObTzka3kcug6Tnh5H2darCLWPPdfisBVRK7QB5uMBaMujI4UZuIekdJ5c4/3IJXFLLDToh7h7H0BKL0edCrHiv1he0F3kPuoJkh0F3wBH99z7y3EEnSabC4y7IdQvZUeRoisU6bqcLcBYvbW1QJJ2eimMk6Mc/RHls2Mlw6PGuw3NjJEJW4SMY89eibQ6qpwpb7IqaVfe5uyiaCoA1Xpcs+HNUgW2TKKbacguxFrngTNPLZO/vLGD3YmJSirzp4x8FwKJcTVRPZej765n7NjXBVxLhgCSO0ZoLGXK9lqVZjgg==; Received: from [194.100.51.2] (helo=momiji) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1drmPl-0005np-7o for ; Tue, 12 Sep 2017 16:43:49 +0200 Received: from localhost (momiji [local]) by momiji (OpenSMTPD) with ESMTPA id 6d6ed66a for ; Tue, 12 Sep 2017 14:43:36 +0000 (UTC) From: Adrian Perez de Castro To: buildroot@buildroot.org Date: Tue, 12 Sep 2017 17:43:36 +0300 Message-Id: <20170912144336.24931-1-aperez@igalia.com> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [PATCH 1/1] flex: Fix segfault of stage1flex when host has glibc 2.26 or newer X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When the host uses glibc 2.26 or newer, Flex will try to use the newly-introduced reallocarray() function, but as it would not define _GNU_SOURCE a segmentation fault would occur later on due to the compiler assumming that the function is implicitly defined. This issue manifests itself due to a crash of "stage1flex" during the Flex bootstrap: ./stage1flex -o stage1scan.c ./scan.l make[2]: *** [Makefile:1725: stage1scan.c] Segmentation fault (core dumped) This imports the patch from the upstream Git repository, and adds flags in the .mk file to rebuild the Autotools scripts and support files. Signed-off-by: Adrian Perez de Castro --- ...-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch | 35 ++++++++++++++++++++++ package/flex/flex.mk | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 package/flex/0002-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch diff --git a/package/flex/0002-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch b/package/flex/0002-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch new file mode 100644 index 0000000000..03ad1ced04 --- /dev/null +++ b/package/flex/0002-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch @@ -0,0 +1,35 @@ +From ffa886a580929f26fd5e5a40c9c5334955c48553 Mon Sep 17 00:00:00 2001 +From: Explorer09 +Date: Mon, 4 Sep 2017 10:47:33 +0800 +Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac. + +This would, e.g. define _GNU_SOURCE in config.h, enabling the +reallocarray() prototype in glibc 2.26+ on Linux systems with that +version of glibc. + +Fixes #241. + +Backported-from: 24fd0551333e7eded87b64dd36062da3df2f6380 +Signed-off-by: Adrian Perez de Castro +--- + configure.ac | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 55e774b..c879fe1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -25,8 +25,10 @@ + # autoconf requirements and initialization + + AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex]) ++AC_PREREQ([2.60]) + AC_CONFIG_SRCDIR([src/scan.l]) + AC_CONFIG_AUX_DIR([build-aux]) ++AC_USE_SYSTEM_EXTENSIONS + LT_INIT + AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects]) + AC_CONFIG_HEADER([src/config.h]) +-- +2.14.1 + diff --git a/package/flex/flex.mk b/package/flex/flex.mk index b78269952e..b84732d383 100644 --- a/package/flex/flex.mk +++ b/package/flex/flex.mk @@ -11,6 +11,8 @@ FLEX_LICENSE = FLEX FLEX_LICENSE_FILES = COPYING FLEX_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-m4 FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4 +FLEX_AUTORECONF = YES +FLEX_GETTEXTIZE = YES HOST_FLEX_DEPENDENCIES = host-m4 define FLEX_DISABLE_PROGRAM