Blame SOURCES/flex-rh1389575.patch

9e84d1
This patch fixes a flex-2.6.4 build failure on x86_64 and possibly other
9e84d1
architectures where `size_t' is larger than `int'. The failure occurs as
9e84d1
follows:
9e84d1
9e84d1
A missing `reallocarray' prototype during compilation means that the
9e84d1
compiler assumes an `int' return type. When compiling with `-pie' (standard
9e84d1
for Fedora), addresses on the heap can be larger than `int' can store. Thus,
9e84d1
pointers returned from `reallocarray' are truncated and any read/write to
9e84d1
them leads to a SIGSEGV.
9e84d1
9e84d1
From 24fd0551333e7eded87b64dd36062da3df2f6380 Mon Sep 17 00:00:00 2001
9e84d1
From: Explorer09 <explorer09@gmail.com>
9e84d1
Date: Mon, 4 Sep 2017 10:47:33 +0800
9e84d1
Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac.
9e84d1
9e84d1
This would, e.g. define _GNU_SOURCE in config.h, enabling the
9e84d1
reallocarray() prototype in glibc 2.26+ on Linux systems with that
9e84d1
version of glibc.
9e84d1
9e84d1
Fixes #241.
9e84d1
---
9e84d1
 configure.ac | 2 ++
9e84d1
 1 file changed, 2 insertions(+)
9e84d1
9e84d1
Index: b/configure.ac
9e84d1
===================================================================
9e84d1
--- a/configure.ac
9e84d1
+++ b/configure.ac
9e84d1
@@ -25,8 +25,10 @@
9e84d1
 # autoconf requirements and initialization
9e84d1
 
9e84d1
 AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
9e84d1
+AC_PREREQ([2.60])
9e84d1
 AC_CONFIG_SRCDIR([src/scan.l])
9e84d1
 AC_CONFIG_AUX_DIR([build-aux])
9e84d1
+AC_USE_SYSTEM_EXTENSIONS
9e84d1
 LT_INIT
9e84d1
 AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects])
9e84d1
 AC_CONFIG_HEADER([src/config.h])