summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2017-01-09 15:28:10 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-16 18:05:12 +0000
commit2bc83c8a3b87f29b62fe778ca1e8790604b72d5f (patch)
treeb039a8eaab42f83815f8f175bfab61e9895902df
parent171a07091873b5692f74751edc3ae09172ae3d76 (diff)
downloadpoky-2bc83c8a3b87f29b62fe778ca1e8790604b72d5f.tar.gz
flex: upgrade to 2.6.2
Patches dropped as they are merged upstream: - CVE-2016-6354.patch - 0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch - do_not_create_pdf_doc.patch Apply a patch from github to simplify cross-compilation and not need a flex-native to bootstrap. (From OE-Core rev: 3632abd01abb8dfff230e18f828af705da488f97) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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/crosscompile.patch214
-rw-r--r--meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch17
-rw-r--r--meta/recipes-devtools/flex/flex_2.6.2.bb (renamed from meta/recipes-devtools/flex/flex_2.6.0.bb)11
5 files changed, 219 insertions, 146 deletions
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/crosscompile.patch b/meta/recipes-devtools/flex/flex/crosscompile.patch
new file mode 100644
index 0000000000..14463d93f4
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex/crosscompile.patch
@@ -0,0 +1,214 @@
1Add this patch from https://github.com/westes/flex/pull/153 with minor changes
2to fix cross compilation.
3
4Upstream-Status: Submitted
5Signed-off-by: Ross Burton <ross.burton@intel.com>
6
7From 52d4a3ca249be984614d9204dcc7b957bc04b2ac Mon Sep 17 00:00:00 2001
8From: Alastair Hughes <hobbitalastair@gmail.com>
9Date: Fri, 6 Jan 2017 19:06:03 +1300
10Subject: [PATCH] build: support cross compiling
11
12Check for cross compiling. If cross compiling, build stage1flex using a
13custom link command.
14We also override LDADD since that adds the replacement implementations
15that are cross compiled, and instead always use the replacement library
16implementations.
17
18We don't use BUILD_OBJEXT and BUILD_EXEEXT since it seems that automake
19does not support these.
20
21Fixes #78.
22
23Signed-off-by: Alastair Hughes <hobbitalastair@gmail.com>
24Signed-off-by: Ross Burton <ross.burton@intel.com>
25---
26 configure.ac | 3 ++
27 m4/ax_prog_cc_for_build.m4 | 125 +++++++++++++++++++++++++++++++++++++++++++++
28 src/Makefile.am | 17 ++++++
29 3 files changed, 145 insertions(+)
30 create mode 100644 m4/ax_prog_cc_for_build.m4
31
32diff --git a/configure.ac b/configure.ac
33index 901339f..2a7dce2 100644
34--- a/configure.ac
35+++ b/configure.ac
36@@ -42,6 +42,7 @@ AM_GNU_GETTEXT_VERSION([0.19])
37 AC_PROG_YACC
38 AM_PROG_LEX
39 AC_PROG_CC
40+AX_PROG_CC_FOR_BUILD
41 AC_PROG_CXX
42 AM_PROG_CC_C_O
43 AC_PROG_LN_S
44@@ -75,6 +76,8 @@ AC_ARG_ENABLE([bootstrap],
45 [], [enable_bootstrap=yes])
46 AM_CONDITIONAL([ENABLE_BOOTSTRAP], [test "x$enable_bootstrap" = xyes])
47
48+AM_CONDITIONAL([CROSS], [test "x$cross_compiling" = xyes])
49+
50 AC_PATH_PROG([BISON], bison, no)
51 AS_IF([test "$BISON" != no],[],
52 [ AC_SUBST([BISON], [\${top_srcdir}/build-aux/missing bison])
53diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4
54new file mode 100644
55index 0000000..77fd346
56--- /dev/null
57+++ b/m4/ax_prog_cc_for_build.m4
58@@ -0,0 +1,125 @@
59+# ===========================================================================
60+# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
61+# ===========================================================================
62+#
63+# SYNOPSIS
64+#
65+# AX_PROG_CC_FOR_BUILD
66+#
67+# DESCRIPTION
68+#
69+# This macro searches for a C compiler that generates native executables,
70+# that is a C compiler that surely is not a cross-compiler. This can be
71+# useful if you have to generate source code at compile-time like for
72+# example GCC does.
73+#
74+# The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
75+# needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).
76+# The value of these variables can be overridden by the user by specifying
77+# a compiler with an environment variable (like you do for standard CC).
78+#
79+# It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object
80+# file extensions for the build platform, and GCC_FOR_BUILD to `yes' if
81+# the compiler we found is GCC. All these variables but GCC_FOR_BUILD are
82+# substituted in the Makefile.
83+#
84+# LICENSE
85+#
86+# Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>
87+#
88+# Copying and distribution of this file, with or without modification, are
89+# permitted in any medium without royalty provided the copyright notice
90+# and this notice are preserved. This file is offered as-is, without any
91+# warranty.
92+
93+#serial 8
94+
95+AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
96+AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
97+AC_REQUIRE([AC_PROG_CC])dnl
98+AC_REQUIRE([AC_PROG_CPP])dnl
99+AC_REQUIRE([AC_EXEEXT])dnl
100+AC_REQUIRE([AC_CANONICAL_HOST])dnl
101+
102+dnl Use the standard macros, but make them use other variable names
103+dnl
104+pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
105+pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
106+pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
107+pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
108+pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
109+pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
110+pushdef([ac_cv_objext], ac_cv_build_objext)dnl
111+pushdef([ac_exeext], ac_build_exeext)dnl
112+pushdef([ac_objext], ac_build_objext)dnl
113+pushdef([CC], CC_FOR_BUILD)dnl
114+pushdef([CPP], CPP_FOR_BUILD)dnl
115+pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
116+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
117+pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
118+pushdef([host], build)dnl
119+pushdef([host_alias], build_alias)dnl
120+pushdef([host_cpu], build_cpu)dnl
121+pushdef([host_vendor], build_vendor)dnl
122+pushdef([host_os], build_os)dnl
123+pushdef([ac_cv_host], ac_cv_build)dnl
124+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
125+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
126+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
127+pushdef([ac_cv_host_os], ac_cv_build_os)dnl
128+pushdef([ac_cpp], ac_build_cpp)dnl
129+pushdef([ac_compile], ac_build_compile)dnl
130+pushdef([ac_link], ac_build_link)dnl
131+
132+save_cross_compiling=$cross_compiling
133+save_ac_tool_prefix=$ac_tool_prefix
134+cross_compiling=no
135+ac_tool_prefix=
136+
137+AC_PROG_CC
138+AC_PROG_CPP
139+AC_EXEEXT
140+
141+ac_tool_prefix=$save_ac_tool_prefix
142+cross_compiling=$save_cross_compiling
143+
144+dnl Restore the old definitions
145+dnl
146+popdef([ac_link])dnl
147+popdef([ac_compile])dnl
148+popdef([ac_cpp])dnl
149+popdef([ac_cv_host_os])dnl
150+popdef([ac_cv_host_vendor])dnl
151+popdef([ac_cv_host_cpu])dnl
152+popdef([ac_cv_host_alias])dnl
153+popdef([ac_cv_host])dnl
154+popdef([host_os])dnl
155+popdef([host_vendor])dnl
156+popdef([host_cpu])dnl
157+popdef([host_alias])dnl
158+popdef([host])dnl
159+popdef([LDFLAGS])dnl
160+popdef([CPPFLAGS])dnl
161+popdef([CFLAGS])dnl
162+popdef([CPP])dnl
163+popdef([CC])dnl
164+popdef([ac_objext])dnl
165+popdef([ac_exeext])dnl
166+popdef([ac_cv_objext])dnl
167+popdef([ac_cv_exeext])dnl
168+popdef([ac_cv_prog_cc_g])dnl
169+popdef([ac_cv_prog_cc_cross])dnl
170+popdef([ac_cv_prog_cc_works])dnl
171+popdef([ac_cv_prog_gcc])dnl
172+popdef([ac_cv_prog_CPP])dnl
173+
174+dnl Finally, set Makefile variables
175+dnl
176+BUILD_EXEEXT=$ac_build_exeext
177+BUILD_OBJEXT=$ac_build_objext
178+AC_SUBST(BUILD_EXEEXT)dnl
179+AC_SUBST(BUILD_OBJEXT)dnl
180+AC_SUBST([CFLAGS_FOR_BUILD])dnl
181+AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
182+AC_SUBST([LDFLAGS_FOR_BUILD])dnl
183+])
184diff --git a/src/Makefile.am b/src/Makefile.am
185index 3b5e362..05fe8d3 100644
186--- a/src/Makefile.am
187+++ b/src/Makefile.am
188@@ -22,7 +22,24 @@ stage1flex_SOURCES = \
189 scan.l \
190 $(COMMON_SOURCES)
191
192+if CROSS
193+stage1flex_LDADD =
194+stage1flex_SOURCES += \
195+ ../lib/malloc.c \
196+ ../lib/realloc.c \
197+ ../lib/reallocarray.c
198+stage1flex_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC_FOR_BUILD) \
199+ $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
200+
201+$(stage1flex_OBJECTS): CC=$(CC_FOR_BUILD)
202+$(stage1flex_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD)
203+$(stage1flex_OBJECTS): CPP=$(CPP_FOR_BUILD)
204+$(stage1flex_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
205+$(stage1flex_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD)
206+else
207 stage1flex_CFLAGS = $(AM_CFLAGS)
208+stage1flex_LINK = $(LINK)
209+endif
210
211 flex_SOURCES = \
212 $(COMMON_SOURCES)
213--
2142.8.1
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 032833ae7a..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.5.37/doc/Makefile.am
6===================================================================
7--- flex-2.5.37.orig/doc/Makefile.am 2012-07-21 04:18:27.000000000 +0300
8+++ flex-2.5.37/doc/Makefile.am 2013-07-30 17:57:09.834834531 +0300
9@@ -2,7 +2,7 @@
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.hks \
diff --git a/meta/recipes-devtools/flex/flex_2.6.0.bb b/meta/recipes-devtools/flex/flex_2.6.2.bb
index ab35b09f99..1780cabbff 100644
--- a/meta/recipes-devtools/flex/flex_2.6.0.bb
+++ b/meta/recipes-devtools/flex/flex_2.6.2.bb
@@ -6,21 +6,20 @@ SECTION = "devel"
6LICENSE = "BSD" 6LICENSE = "BSD"
7 7
8DEPENDS = "${@bb.utils.contains('PTEST_ENABLED', '1', 'bison-native flex-native', '', d)}" 8DEPENDS = "${@bb.utils.contains('PTEST_ENABLED', '1', 'bison-native flex-native', '', d)}"
9
9BBCLASSEXTEND = "native nativesdk" 10BBCLASSEXTEND = "native nativesdk"
10 11
11LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067" 12LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067"
12 13
13SRC_URI = "${SOURCEFORGE_MIRROR}/flex/flex-${PV}.tar.bz2 \ 14SRC_URI = "https://github.com/westes/flex/releases/download/v${PV}/flex-${PV}.tar.gz \
15 file://crosscompile.patch;apply=1 \
14 file://run-ptest \ 16 file://run-ptest \
15 file://do_not_create_pdf_doc.patch \
16 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \ 17 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)} \ 18 ${@bb.utils.contains('PTEST_ENABLED', '1', '', 'file://disable-tests.patch', d)} \
20 " 19 "
21 20
22SRC_URI[md5sum] = "266270f13c48ed043d95648075084d59" 21SRC_URI[md5sum] = "cc6d76c333db7653d5caf423a3335239"
23SRC_URI[sha256sum] = "24e611ef5a4703a191012f80c1027dc9d12555183ce0ecd46f3636e587e9b8e9" 22SRC_URI[sha256sum] = "9a01437a1155c799b7dc2508620564ef806ba66250c36bf5f9034b1c207cb2c9"
24 23
25# Flex has moved to github from 2.6.1 onwards 24# Flex has moved to github from 2.6.1 onwards
26UPSTREAM_CHECK_URI = "https://github.com/westes/flex/releases" 25UPSTREAM_CHECK_URI = "https://github.com/westes/flex/releases"