{"id":812878,"url":"http://patchwork.ozlabs.org/api/patches/812878/?format=json","web_url":"http://patchwork.ozlabs.org/project/buildroot/patch/20170912144336.24931-1-aperez@igalia.com/","project":{"id":27,"url":"http://patchwork.ozlabs.org/api/projects/27/?format=json","name":"Buildroot development","link_name":"buildroot","list_id":"buildroot.buildroot.org","list_email":"buildroot@buildroot.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170912144336.24931-1-aperez@igalia.com>","list_archive_url":null,"date":"2017-09-12T14:43:36","name":"[1/1] flex: Fix segfault of stage1flex when host has glibc 2.26 or newer","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"608db9fd5ad30993585b0f376137e681f91c08ca","submitter":{"id":71810,"url":"http://patchwork.ozlabs.org/api/people/71810/?format=json","name":"Adrian Perez de Castro","email":"aperez@igalia.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/buildroot/patch/20170912144336.24931-1-aperez@igalia.com/mbox/","series":[{"id":2720,"url":"http://patchwork.ozlabs.org/api/series/2720/?format=json","web_url":"http://patchwork.ozlabs.org/project/buildroot/list/?series=2720","date":"2017-09-12T14:43:36","name":"[1/1] flex: Fix segfault of stage1flex when host has glibc 2.26 or newer","version":1,"mbox":"http://patchwork.ozlabs.org/series/2720/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812878/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812878/checks/","tags":{},"related":[],"headers":{"Return-Path":"<buildroot-bounces@busybox.net>","X-Original-To":["incoming@patchwork.ozlabs.org","buildroot@lists.busybox.net"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","buildroot@osuosl.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=busybox.net\n\t(client-ip=140.211.166.136; helo=silver.osuosl.org;\n\tenvelope-from=buildroot-bounces@busybox.net;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"RHdu1Ia6\"; dkim-atps=neutral"],"Received":["from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs6xg5ZTrz9s3T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 00:44:06 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 17E9E2F980;\n\tTue, 12 Sep 2017 14:44:01 +0000 (UTC)","from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id adHfPOYsoDbV; Tue, 12 Sep 2017 14:43:57 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id BC35426704;\n\tTue, 12 Sep 2017 14:43:57 +0000 (UTC)","from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 193A91BFE90\n\tfor <buildroot@lists.busybox.net>;\n\tTue, 12 Sep 2017 14:43:56 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 132BC893AD\n\tfor <buildroot@lists.busybox.net>;\n\tTue, 12 Sep 2017 14:43:56 +0000 (UTC)","from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TjZVDsSNkYIX for <buildroot@lists.busybox.net>;\n\tTue, 12 Sep 2017 14:43:53 +0000 (UTC)","from fanzine.igalia.com (fanzine.igalia.com [91.117.99.155])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 1B92288A24\n\tfor <buildroot@buildroot.org>; Tue, 12 Sep 2017 14:43:52 +0000 (UTC)","from [194.100.51.2] (helo=momiji) by fanzine.igalia.com with\n\tesmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim)\n\tid 1drmPl-0005np-7o\n\tfor <buildroot@buildroot.org>; Tue, 12 Sep 2017 16:43:49 +0200","from localhost (momiji [local])\n\tby momiji (OpenSMTPD) with ESMTPA id 6d6ed66a\n\tfor <buildroot@buildroot.org>; Tue, 12 Sep 2017 14:43:36 +0000 (UTC)"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"from auto-whitelisted by SQLgrey-1.7.6","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329; h=Message-Id:Date:Subject:To:From;\n\tbh=W35JnjiO1ZFIB35yyRiA2luEMtiYUCExua5TJXaFUjs=; \n\tb=RHdu1Ia6dR8y+V70nq9w6TNvTnoiQZsDkkBYpFelSObTzka3kcug6Tnh5H2darCLWPPdfisBVRK7QB5uMBaMujI4UZuIekdJ5c4/3IJXFLLDToh7h7H0BKL0edCrHiv1he0F3kPuoJkh0F3wBH99z7y3EEnSabC4y7IdQvZUeRoisU6bqcLcBYvbW1QJJ2eimMk6Mc/RHls2Mlw6PGuw3NjJEJW4SMY89eibQ6qpwpb7IqaVfe5uyiaCoA1Xpcs+HNUgW2TKKbacguxFrngTNPLZO/vLGD3YmJSirzp4x8FwKJcTVRPZej765n7NjXBVxLhgCSO0ZoLGXK9lqVZjgg==;","From":"Adrian Perez de Castro <aperez@igalia.com>","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\n\thas 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 <buildroot.busybox.net>","List-Unsubscribe":"<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>","List-Archive":"<http://lists.busybox.net/pipermail/buildroot/>","List-Post":"<mailto:buildroot@busybox.net>","List-Help":"<mailto:buildroot-request@busybox.net?subject=help>","List-Subscribe":"<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"buildroot-bounces@busybox.net","Sender":"\"buildroot\" <buildroot-bounces@busybox.net>"},"content":"When the host uses glibc 2.26 or newer, Flex will try to use the\nnewly-introduced reallocarray() function, but as it would not define\n_GNU_SOURCE a segmentation fault would occur later on due to the\ncompiler assumming that the function is implicitly defined.\n\nThis issue manifests itself due to a crash of \"stage1flex\" during the\nFlex bootstrap:\n\n  ./stage1flex   -o stage1scan.c ./scan.l\n  make[2]: *** [Makefile:1725: stage1scan.c] Segmentation fault (core dumped)\n\nThis imports the patch from the upstream Git repository, and adds flags\nin the .mk file to rebuild the Autotools scripts and support files.\n\nSigned-off-by: Adrian Perez de Castro <aperez@igalia.com>\n---\n ...-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch | 35 ++++++++++++++++++++++\n package/flex/flex.mk                               |  2 ++\n 2 files changed, 37 insertions(+)\n create mode 100644 package/flex/0002-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch","diff":"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\nnew file mode 100644\nindex 0000000000..03ad1ced04\n--- /dev/null\n+++ b/package/flex/0002-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch\n@@ -0,0 +1,35 @@\n+From ffa886a580929f26fd5e5a40c9c5334955c48553 Mon Sep 17 00:00:00 2001\n+From: Explorer09 <explorer09@gmail.com>\n+Date: Mon, 4 Sep 2017 10:47:33 +0800\n+Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac.\n+\n+This would, e.g. define _GNU_SOURCE in config.h, enabling the\n+reallocarray() prototype in glibc 2.26+ on Linux systems with that\n+version of glibc.\n+\n+Fixes #241.\n+\n+Backported-from: 24fd0551333e7eded87b64dd36062da3df2f6380\n+Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>\n+---\n+ configure.ac | 2 ++\n+ 1 file changed, 2 insertions(+)\n+\n+diff --git a/configure.ac b/configure.ac\n+index 55e774b..c879fe1 100644\n+--- a/configure.ac\n++++ b/configure.ac\n+@@ -25,8 +25,10 @@\n+ # autoconf requirements and initialization\n+ \n+ AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])\n++AC_PREREQ([2.60])\n+ AC_CONFIG_SRCDIR([src/scan.l])\n+ AC_CONFIG_AUX_DIR([build-aux])\n++AC_USE_SYSTEM_EXTENSIONS\n+ LT_INIT\n+ AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects])\n+ AC_CONFIG_HEADER([src/config.h])\n+-- \n+2.14.1\n+\ndiff --git a/package/flex/flex.mk b/package/flex/flex.mk\nindex b78269952e..b84732d383 100644\n--- a/package/flex/flex.mk\n+++ b/package/flex/flex.mk\n@@ -11,6 +11,8 @@ FLEX_LICENSE = FLEX\n FLEX_LICENSE_FILES = COPYING\n FLEX_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) host-m4\n FLEX_CONF_ENV = ac_cv_path_M4=/usr/bin/m4\n+FLEX_AUTORECONF = YES\n+FLEX_GETTEXTIZE = YES\n HOST_FLEX_DEPENDENCIES = host-m4\n \n define FLEX_DISABLE_PROGRAM\n","prefixes":["1/1"]}