Compare commits

..

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

9 changed files with 138 additions and 214 deletions

View File

@ -1 +1 @@
f344d892aee6eb512c9b613a6b7feab2dbcc1200 SOURCES/flex-2.6.1.tar.xz
fafece095a0d9890ebd618adb1f242d8908076e1 SOURCES/flex-2.6.4.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/flex-2.6.1.tar.xz
SOURCES/flex-2.6.4.tar.gz

View File

@ -1,31 +0,0 @@
Index: b/src/flex.skl
===================================================================
--- a/src/flex.skl
+++ b/src/flex.skl
@@ -494,7 +494,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
*/
#define YY_LESS_LINENO(n) \
do { \
- int yyl;\
+ yy_size_t yyl;\
for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
@@ -520,7 +520,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
do \
{ \
/* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
+ yy_size_t yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = YY_G(yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
@@ -2576,7 +2576,7 @@ void yyFlexLexer::LexerError( yyconst ch
do \
{ \
/* Undo effects of setting up yytext. */ \
- int yyless_macro_arg = (n); \
+ yy_size_t yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
yytext[yyleng] = YY_G(yy_hold_char); \
YY_G(yy_c_buf_p) = yytext + yyless_macro_arg; \

View File

@ -1,37 +0,0 @@
commit 3946924ed5e77420c453bf841603c7278766093a
Author: rlar <rlar>
Date: Sun Feb 28 15:20:31 2016 +0100
generated code, `max_size' seems to be of type `int', fix casts accordingly
Index: b/src/gen.c
===================================================================
--- a/src/gen.c
+++ b/src/gen.c
@@ -1875,7 +1875,7 @@ void make_tables (void)
if (!C_plus_plus) {
if (use_read) {
outn ("\terrno=0; \\");
- outn ("\twhile ( (result = (int) read( fileno(yyin), buf, max_size )) < 0 ) \\");
+ outn ("\twhile ( (result = (int) read( fileno(yyin), buf, (yy_size_t) max_size )) < 0 ) \\");
outn ("\t{ \\");
outn ("\t\tif( errno != EINTR) \\");
outn ("\t\t{ \\");
@@ -1891,7 +1891,7 @@ void make_tables (void)
outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
outn ("\t\t{ \\");
outn ("\t\tint c = '*'; \\");
- outn ("\t\tsize_t n; \\");
+ outn ("\t\tint n; \\");
outn ("\t\tfor ( n = 0; n < max_size && \\");
outn ("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
outn ("\t\t\tbuf[n] = (char) c; \\");
@@ -1904,7 +1904,7 @@ void make_tables (void)
outn ("\telse \\");
outn ("\t\t{ \\");
outn ("\t\terrno=0; \\");
- outn ("\t\twhile ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\");
+ outn ("\t\twhile ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \\");
outn ("\t\t\t{ \\");
outn ("\t\t\tif( errno != EINTR) \\");
outn ("\t\t\t\t{ \\");

View File

@ -1,19 +0,0 @@
commit 986bb5e29492a927a2ad157505c900f75c97016a
Author: rlar <rlar>
Date: Sun Feb 28 15:20:31 2016 +0100
generated code, here `new_size' is of type `int', fix casts accordingly
Index: b/src/flex.skl
===================================================================
--- a/src/flex.skl
+++ b/src/flex.skl
@@ -1782,7 +1782,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
/* Extend the array by 50%, plus the number we really need. */
int new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
- (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG );
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size M4_YY_CALL_LAST_ARG );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}

View File

@ -0,0 +1,39 @@
This patch fixes a flex-2.6.4 build failure on x86_64 and possibly other
architectures where `size_t' is larger than `int'. The failure occurs as
follows:
A missing `reallocarray' prototype during compilation means that the
compiler assumes an `int' return type. When compiling with `-pie' (standard
for Fedora), addresses on the heap can be larger than `int' can store. Thus,
pointers returned from `reallocarray' are truncated and any read/write to
them leads to a SIGSEGV.
From 24fd0551333e7eded87b64dd36062da3df2f6380 Mon Sep 17 00:00:00 2001
From: Explorer09 <explorer09@gmail.com>
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.
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
Index: b/configure.ac
===================================================================
--- 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])

View File

@ -1,43 +0,0 @@
commit 33dd868353ab98bc33363d43be5a8b0e7e049072
Author: rlar <rlar>
Date: Sun Feb 28 15:20:31 2016 +0100
generated code, `yy_buf_size' is of type `int', fix casts accordingly
Index: b/src/flex.skl
===================================================================
--- a/src/flex.skl
+++ b/src/flex.skl
@@ -1732,7 +1732,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]],
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
yyrealloc( (void *) b->yy_ch_buf,
- b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );
+ (yy_size_t) (b->yy_buf_size + 2) M4_YY_CALL_LAST_ARG );
}
else
/* Can't grow it, we don't own it. */
@@ -2102,12 +2102,12 @@ static void yy_load_buffer_state YYFARG
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size;
+ b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) yyalloc( b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) M4_YY_CALL_LAST_ARG );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
@@ -2397,7 +2397,7 @@ YY_BUFFER_STATE yy_scan_buffer YYFARGS2
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = NULL;

View File

@ -1,24 +0,0 @@
commit cf4121fa97abac8aeaa5e08b8fc0b2380228494e
Author: rlar <rlar>
Date: Sat Feb 27 22:46:02 2016 +0100
generated code, `_yybytes_len' is of type `int', fix code accordingly
Index: b/src/flex.skl
===================================================================
--- a/src/flex.skl
+++ b/src/flex.skl
@@ -2451,11 +2451,11 @@ YY_BUFFER_STATE yy_scan_bytes YYFARGS2(
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
m4_dnl M4_YY_DECL_GUTS_VAR();
/* Get memory for full buffer, including space for trailing EOB's. */
- n = (yy_size_t) _yybytes_len + 2;
+ n = (yy_size_t) (_yybytes_len + 2);
buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

View File

@ -1,29 +1,22 @@
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
Summary: A tool for creating scanners (text pattern recognizers)
Summary: A tool for generating scanners (text pattern recognizers)
Name: flex
Version: 2.6.1
Version: 2.6.4
Release: 9%{?dist}
# parse.c and parse.h are under GPLv3+ with exception which allows
# relicensing. Since flex is shipped under BDS-style license,
# let's assume that the relicensing was done.
# gettext.h (copied from gnulib) is under LGPLv2+
License: BSD and LGPLv2+
Group: Development/Tools
URL: https://github.com/westes/flex
Source: https://github.com/westes/flex/releases/download/v%{version}/flex-%{version}.tar.xz
Source: https://github.com/westes/flex/releases/download/v%{version}/flex-%{version}.tar.gz
Patch0: flex-2.6.0-yyless.patch
Patch1: flex-max_size.patch
Patch2: flex-new_size.patch
Patch3: flex-yy_buf_size.patch
Patch4: flex-yybytes_len.patch
Patch0: flex-rh1389575.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: m4
BuildRequires: gettext bison m4 help2man gcc gcc-c++
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
BuildRequires: gettext gettext-devel bison m4 help2man gcc gcc-c++ automake libtool
BuildRequires: make
%description
The flex program generates scanners. Scanners are programs which can
@ -41,36 +34,62 @@ application development.
# We keep the libraries in separate sub-package to allow for multilib
# installations of flex.
%package devel
Summary: Libraries for flex scanner generator
Group: Development/Tools
%define somajor 2
%package -n libfl%{somajor}
Summary: Libraries for the flex scanner generator
%description -n libfl%{somajor}
flex is a tool for generating scanners.
This package contains the shared library with default implementations of
`main' and `yywrap' functions that binaries using flex can choose to link
against instead of implementing on their own.
%package -n libfl-devel
Summary: Development files for the flex scanner generator
Requires: libfl%{somajor} = %{version}-%{release}
%description -n libfl-devel
flex is a tool for generating scanners.
This package contains files required to build programs that use flex
libraries.
%package -n libfl-static
Summary: Static libraries for the flex scanner generator
# We renamed flex-static to flex-devel in version 2.5.35-15:
Obsoletes: flex-static < 2.5.35-15
Provides: flex-static
# We renamed flex-devel to libfl-static in version 2.6.4-6. This clarifies
# the nature of the package and brings us in line with naming used by SUSE
# and Debian:
Obsoletes: flex-devel < 2.6.4-6
Provides: flex-devel
%description devel
%description -n libfl-static
This package contains the library with default implementations of
`main' and `yywrap' functions that the client binary can choose to use
instead of implementing their own.
flex is a tool for generating scanners.
This package contains the static library with default implementations of
`main' and `yywrap' functions that binaries using flex can choose to
statically link against instead of implementing their own.
%package doc
Summary: Documentation for flex scanner generator
Group: Documentation
Summary: Documentation for the flex scanner generator
%description doc
This package contains documentation for flex scanner generator in
This package contains documentation for the flex scanner generator in
plain text and PDF formats.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
autoreconf -i
%configure --docdir=%{_pkgdocdir} CFLAGS="-fPIC $RPM_OPT_FLAGS"
make %{?_smp_mflags}
@ -79,15 +98,8 @@ rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
rm -f $RPM_BUILD_ROOT/%{_pkgdocdir}/{README.cvs,TODO}
# For now, excluding the new .la and .so files as we haven't had
# any requests for them and adding them will require a new subpackage.
# The .so files contain 2 optional implementations of main and yywrap
# for developer convenience. They are also available in the .a file
# provided in flex-devel.
# Exclude libtool archives (.la) as per Fedora packaging guidelines
find %{buildroot} -name '*.la' -delete
find %{buildroot} -name '*.so' -delete
find %{buildroot} -name '*.so.2' -delete
find %{buildroot} -name '*.so.2.0.0' -delete
( cd ${RPM_BUILD_ROOT}
ln -sf flex .%{_bindir}/lex
@ -99,52 +111,79 @@ find %{buildroot} -name '*.so.2.0.0' -delete
%find_lang flex
%post
if [ -f %{_infodir}/flex.info.gz ]; then # for --excludedocs
/sbin/install-info %{_infodir}/flex.info.gz --dir-file=%{_infodir}/dir ||:
fi
%preun
if [ $1 = 0 ]; then
if [ -f %{_infodir}/flex.info.gz ]; then # for --excludedocs
/sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir ||:
fi
fi
%check
echo ============TESTING===============
make check
echo ============END TESTING===========
%clean
rm -rf ${RPM_BUILD_ROOT}
%files -f flex.lang
%defattr(-,root,root)
%dir %{_pkgdocdir}
%license COPYING
%{_pkgdocdir}/NEWS
%{_pkgdocdir}/README
%{_pkgdocdir}/README.md
%{_bindir}/*
%{_mandir}/man1/*
%{_includedir}/FlexLexer.h
%{_infodir}/flex.info*
%files devel
%defattr(-,root,root)
%files -n libfl%{somajor}
%{_libdir}/libfl.so.%{somajor}*
%files -n libfl-devel
%{_includedir}/FlexLexer.h
%{_libdir}/libfl.so
%files -n libfl-static
%dir %{_pkgdocdir}
%license COPYING
%{_libdir}/*.a
%files doc
%defattr(-,root,root)
%{_pkgdocdir}
%changelog
* Tue Jul 31 2018 Arjun Shankar <arjun@redhat.com> - 2.6.1-9
- Add gcc and gcc-c++ as build-time requirements
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.6.4-9
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Mon Jun 18 2018 Arjun Shankar <arjun@redhat.com> - 2.6.1-8
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 2.6.4-8
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Aug 21 2020 Arjun Shankar <arjun@redhat.com> - 2.6.4-6
- Re-work flex subpackages and provide shared libraries (#1327851):
- Remove and obsolete the flex-devel subpackage containing static libraries
- Provide shared libraries in a new subpackage named libfl2
- Provide development files in a new subpackage named libfl-devel
- Provide static libraries in a new subpackage named libfl-static
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Sep 03 2018 Arjun Shankar <arjun@redhat.com> - 2.6.4-1
- Rebase to 2.6.4
- Fix build failure due to missing include and `reallocarray' prototype
- Add gettext-devel, automake and libtool to build dependencies, and
execute `autoreconf -i' to regenerate files after patching configure.ac
* Mon Jul 23 2018 Arjun Shankar <arjun@redhat.com> - 2.6.1-10
- Add gcc-c++ as a build-time requirement
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Jun 27 2018 Arjun Shankar <arjun@redhat.com> - 2.6.1-8
- Remove g++ signed/unsigned comparison warning in generated scanner
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.6.1-7