summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/flex
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2019-11-29 14:11:48 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-04 12:30:58 +0000
commite8543db1c6e4a3ae6d6ed4481114090fdd43fa8f (patch)
treed78534e05a359d4d3b33157d90a30ac2c34794f7 /meta/recipes-devtools/flex
parentfb5037bbc50d298aa319bb6825de50b741413555 (diff)
downloadpoky-e8543db1c6e4a3ae6d6ed4481114090fdd43fa8f.tar.gz
flex: update to 2.6.4
Add a backport patch that addresses segfaults on newer glibc versions. Remove: CVE-2016-6354.patch (backport) 0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch (issue fixed upstream) do_not_create_pdf_doc.patch (issue fixed upstream) ptest pass rate is 100%. (From OE-Core rev: a0fe05f3ffd67dc42e053c20bd019bb9d463d0ad) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/flex')
-rw-r--r--meta/recipes-devtools/flex/flex/0001-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch32
-rw-r--r--meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch64
-rw-r--r--meta/recipes-devtools/flex/flex/CVE-2016-6354.patch59
-rw-r--r--meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch17
-rwxr-xr-xmeta/recipes-devtools/flex/flex/run-ptest2
-rw-r--r--meta/recipes-devtools/flex/flex_2.6.4.bb (renamed from meta/recipes-devtools/flex/flex_2.6.0.bb)12
6 files changed, 38 insertions, 148 deletions
diff --git a/meta/recipes-devtools/flex/flex/0001-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch b/meta/recipes-devtools/flex/flex/0001-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch
new file mode 100644
index 0000000000..60bf7ce8cf
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex/0001-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch
@@ -0,0 +1,32 @@
1From ed1f7e9de0d6a1d5a9e581e02a63593d22cf1e52 Mon Sep 17 00:00:00 2001
2From: Explorer09 <explorer09@gmail.com>
3Date: Mon, 4 Sep 2017 10:47:33 +0800
4Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac.
5
6This would, e.g. define _GNU_SOURCE in config.h, enabling the
7reallocarray() prototype in glibc 2.26+ on Linux systems with that
8version of glibc.
9
10Fixes #241.
11
12Upstream-Status: Backport
13Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14---
15 configure.ac | 2 ++
16 1 file changed, 2 insertions(+)
17
18diff --git a/configure.ac b/configure.ac
19index 55e774b..c879fe1 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -25,8 +25,10 @@
23 # autoconf requirements and initialization
24
25 AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
26+AC_PREREQ([2.60])
27 AC_CONFIG_SRCDIR([src/scan.l])
28 AC_CONFIG_AUX_DIR([build-aux])
29+AC_USE_SYSTEM_EXTENSIONS
30 LT_INIT
31 AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects])
32 AC_CONFIG_HEADER([src/config.h])
diff --git a/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch b/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch
deleted file mode 100644
index 438ca5f527..0000000000
--- a/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From 7072befe1397af4eb01c3ff7edf99f0cd5076089 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
3Date: Tue, 30 Aug 2016 14:25:32 +0200
4Subject: [PATCH] avoid c++ comments in c-code - fails with gcc-6
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9fixes:
10
11| error: C++ style comments are not allowed in ISO C90
12| num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
13
14Upstream-Status: Pending
15
16Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
17---
18 src/flex.skl | 2 +-
19 src/scan.c | 2 +-
20 src/skel.c | 2 +-
21 3 files changed, 3 insertions(+), 3 deletions(-)
22
23diff --git a/src/flex.skl b/src/flex.skl
24index 73a0b9e..ed71627 100644
25--- a/src/flex.skl
26+++ b/src/flex.skl
27@@ -2350,7 +2350,7 @@ void yyFlexLexer::yyensure_buffer_stack(void)
28 * scanner will even need a stack. We use 2 instead of 1 to avoid an
29 * immediate realloc on the next call.
30 */
31- num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
32+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
33 YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
34 (num_to_alloc * sizeof(struct yy_buffer_state*)
35 M4_YY_CALL_LAST_ARG);
36diff --git a/src/scan.c b/src/scan.c
37index b55df2d..f1dce75 100644
38--- a/src/scan.c
39+++ b/src/scan.c
40@@ -4672,7 +4672,7 @@ static void yyensure_buffer_stack (void)
41 * scanner will even need a stack. We use 2 instead of 1 to avoid an
42 * immediate realloc on the next call.
43 */
44- num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
45+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways...*/
46 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
47 (num_to_alloc * sizeof(struct yy_buffer_state*)
48 );
49diff --git a/src/skel.c b/src/skel.c
50index ef657d3..26cc889 100644
51--- a/src/skel.c
52+++ b/src/skel.c
53@@ -2561,7 +2561,7 @@ const char *skel[] = {
54 " * scanner will even need a stack. We use 2 instead of 1 to avoid an",
55 " * immediate realloc on the next call.",
56 " */",
57- " num_to_alloc = 1; // After all that talk, this was set to 1 anyways...",
58+ " num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */",
59 " YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc",
60 " (num_to_alloc * sizeof(struct yy_buffer_state*)",
61 " M4_YY_CALL_LAST_ARG);",
62--
632.5.5
64
diff --git a/meta/recipes-devtools/flex/flex/CVE-2016-6354.patch b/meta/recipes-devtools/flex/flex/CVE-2016-6354.patch
deleted file mode 100644
index 216ac7ae1c..0000000000
--- a/meta/recipes-devtools/flex/flex/CVE-2016-6354.patch
+++ /dev/null
@@ -1,59 +0,0 @@
1From 3939eccdff598f47e5b37b05d58bf1b44d3796e7 Mon Sep 17 00:00:00 2001
2From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Fri, 7 Oct 2016 14:15:38 +0300
4Subject: [PATCH] Prevent buffer overflow in yy_get_next_buffer
5
6This is upstream commit a5cbe929ac3255d371e698f62dc256afe7006466
7with some additional backporting to make binutils build again.
8
9Upstream-Status: Backport
10CVE: CVE-2016-6354
11Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
12---
13 src/flex.skl | 2 +-
14 src/scan.c | 2 +-
15 src/skel.c | 2 +-
16 3 files changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/src/flex.skl b/src/flex.skl
19index ed71627..814d562 100644
20--- a/src/flex.skl
21+++ b/src/flex.skl
22@@ -1718,7 +1718,7 @@ int yyFlexLexer::yy_get_next_buffer()
23
24 else
25 {
26- yy_size_t num_to_read =
27+ int num_to_read =
28 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
29
30 while ( num_to_read <= 0 )
31diff --git a/src/scan.c b/src/scan.c
32index f1dce75..1949872 100644
33--- a/src/scan.c
34+++ b/src/scan.c
35@@ -4181,7 +4181,7 @@ static int yy_get_next_buffer (void)
36
37 else
38 {
39- yy_size_t num_to_read =
40+ int num_to_read =
41 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
42
43 while ( num_to_read <= 0 )
44diff --git a/src/skel.c b/src/skel.c
45index 26cc889..0344d18 100644
46--- a/src/skel.c
47+++ b/src/skel.c
48@@ -1929,7 +1929,7 @@ const char *skel[] = {
49 "",
50 " else",
51 " {",
52- " yy_size_t num_to_read =",
53+ " int num_to_read =",
54 " YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;",
55 "",
56 " while ( num_to_read <= 0 )",
57--
582.1.4
59
diff --git a/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch b/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
deleted file mode 100644
index 29792efee8..0000000000
--- a/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1Upstream-Status: Inappropriate (embedded specific)
2
3Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
4
5Index: flex-2.6.0/doc/Makefile.am
6===================================================================
7--- flex-2.6.0.orig/doc/Makefile.am
8+++ flex-2.6.0/doc/Makefile.am
9@@ -2,7 +2,7 @@ help2man = @HELP2MAN@
10
11 info_TEXINFOS = flex.texi
12 dist_man_MANS = flex.1
13-dist_doc_DATA= flex.pdf
14+EXTRA_DIST= flex.pdf
15
16 CLEANFILES = \
17 flex.aux \
diff --git a/meta/recipes-devtools/flex/flex/run-ptest b/meta/recipes-devtools/flex/flex/run-ptest
index 19db337900..037301c40f 100755
--- a/meta/recipes-devtools/flex/flex/run-ptest
+++ b/meta/recipes-devtools/flex/flex/run-ptest
@@ -2,4 +2,4 @@
2 2
3# make would want to rebuild some files with a compiler otherwise :-/ 3# make would want to rebuild some files with a compiler otherwise :-/
4make FLEX=/usr/bin/flex -t check-TESTS || true 4make FLEX=/usr/bin/flex -t check-TESTS || true
5make FLEX=/usr/bin/flex check-TESTS 5make FLEX=/usr/bin/flex abs_builddir=./ check-TESTS
diff --git a/meta/recipes-devtools/flex/flex_2.6.0.bb b/meta/recipes-devtools/flex/flex_2.6.4.bb
index 9bdd99c59f..d8e2f7f28c 100644
--- a/meta/recipes-devtools/flex/flex_2.6.0.bb
+++ b/meta/recipes-devtools/flex/flex_2.6.4.bb
@@ -10,17 +10,15 @@ BBCLASSEXTEND = "native nativesdk"
10 10
11LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067" 11LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067"
12 12
13SRC_URI = "${SOURCEFORGE_MIRROR}/flex/flex-${PV}.tar.bz2 \ 13SRC_URI = "https://github.com/westes/flex/releases/download/v${PV}/flex-${PV}.tar.gz \
14 file://run-ptest \ 14 file://run-ptest \
15 file://do_not_create_pdf_doc.patch \
16 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \ 15 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
17 file://0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch \
18 file://CVE-2016-6354.patch \
19 ${@bb.utils.contains('PTEST_ENABLED', '1', '', 'file://disable-tests.patch', d)} \ 16 ${@bb.utils.contains('PTEST_ENABLED', '1', '', 'file://disable-tests.patch', d)} \
17 file://0001-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch \
20 " 18 "
21 19
22SRC_URI[md5sum] = "266270f13c48ed043d95648075084d59" 20SRC_URI[md5sum] = "2882e3179748cc9f9c23ec593d6adc8d"
23SRC_URI[sha256sum] = "24e611ef5a4703a191012f80c1027dc9d12555183ce0ecd46f3636e587e9b8e9" 21SRC_URI[sha256sum] = "e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995"
24 22
25# Flex has moved to github from 2.6.1 onwards 23# Flex has moved to github from 2.6.1 onwards
26UPSTREAM_CHECK_URI = "https://github.com/westes/flex/releases" 24UPSTREAM_CHECK_URI = "https://github.com/westes/flex/releases"
@@ -30,7 +28,7 @@ inherit autotools gettext texinfo ptest
30 28
31M4 = "${bindir}/m4" 29M4 = "${bindir}/m4"
32M4_class-native = "${STAGING_BINDIR_NATIVE}/m4" 30M4_class-native = "${STAGING_BINDIR_NATIVE}/m4"
33EXTRA_OECONF += "ac_cv_path_M4=${M4}" 31EXTRA_OECONF += "ac_cv_path_M4=${M4} ac_cv_func_reallocarray=no"
34EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4" 32EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4"
35 33
36EXTRA_OEMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', 'FLEX=${STAGING_BINDIR_NATIVE}/flex', '', d)}" 34EXTRA_OEMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', 'FLEX=${STAGING_BINDIR_NATIVE}/flex', '', d)}"