diff options
author | Chong.Lu@windriver.com <Chong.Lu@windriver.com> | 2014-06-13 14:12:55 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-06-21 19:22:24 +0200 |
commit | 65ac416470b871888ca6c743ddbec56e5bc2c1fd (patch) | |
tree | 02617ffa3fe48851cbfc349e783af4ad402641fd | |
parent | 3d5d8c6d0f21de60dc84610a4d47da2d8c062901 (diff) | |
download | meta-openembedded-65ac416470b871888ca6c743ddbec56e5bc2c1fd.tar.gz |
samba: fix parsing linemarkers in preprocessor output
When PIDL calls out to C preprocessor to expand IDL files
and parse the output, it filters out linemarkers and line control
information as described in http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html
and http://gcc.gnu.org/onlinedocs/cpp/Line-Control.html#Line-Control
With gcc 4.8 stdc-predef.h is included automatically and linemarker for the
file has extended flags that PIDL couldn't parse ('system header that needs to
be extern "C" protected for C++')
Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r-- | meta-oe/recipes-connectivity/samba/samba/0001-PIDL-fix-parsing-linemarkers-in-preprocessor-output.patch | 68 | ||||
-rw-r--r-- | meta-oe/recipes-connectivity/samba/samba_3.6.8.bb | 1 |
2 files changed, 69 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/samba/samba/0001-PIDL-fix-parsing-linemarkers-in-preprocessor-output.patch b/meta-oe/recipes-connectivity/samba/samba/0001-PIDL-fix-parsing-linemarkers-in-preprocessor-output.patch new file mode 100644 index 000000000..586867d8f --- /dev/null +++ b/meta-oe/recipes-connectivity/samba/samba/0001-PIDL-fix-parsing-linemarkers-in-preprocessor-output.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | From b07ade6e6fcc8b844cf1fb8b6038617281c4c2d0 Mon Sep 17 00:00:00 2001 | ||
4 | From: Alexander Bokovoy <ab@samba.org> | ||
5 | Date: Wed, 6 Feb 2013 10:17:57 +0200 | ||
6 | Subject: [PATCH] PIDL: fix parsing linemarkers in preprocessor output | ||
7 | |||
8 | Commit b07ade6e6fcc8b844cf1fb8b6038617281c4c2d0 v3-6-stable | ||
9 | |||
10 | When PIDL calls out to C preprocessor to expand IDL files | ||
11 | and parse the output, it filters out linemarkers and line control | ||
12 | information as described in http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html | ||
13 | and http://gcc.gnu.org/onlinedocs/cpp/Line-Control.html#Line-Control | ||
14 | |||
15 | With gcc 4.8 stdc-predef.h is included automatically and linemarker for the | ||
16 | file has extended flags that PIDL couldn't parse ('system header that needs to | ||
17 | be extern "C" protected for C++') | ||
18 | |||
19 | Thanks to Jakub Jelinek <jakub@redhat.com> for explanation of the linemarker format. | ||
20 | |||
21 | Fixes https://bugzilla.redhat.com/show_bug.cgi?id=906517 | ||
22 | |||
23 | Reviewed-by: Andreas Schneider <asn@samba.org> | ||
24 | (cherry picked from commit 6ba7ab5c14801aecae96373d5a9db7ab82957526) | ||
25 | |||
26 | Signed-off-by: Andreas Schneider <asn@samba.org> | ||
27 | |||
28 | Fix bug #9636 - pidl can't parse new linemarkers in preprocessor output. | ||
29 | (cherry picked from commit 643571470f2e4cd2f58bd60ac7189abb826d33cc) | ||
30 | (cherry picked from commit b5a8afd6550e9091d169d3010751913bb483fc4b) | ||
31 | --- | ||
32 | pidl/idl.yp | 4 +++- | ||
33 | pidl/lib/Parse/Pidl/IDL.pm | 4 +++- | ||
34 | 2 files changed, 6 insertions(+), 2 deletions(-) | ||
35 | |||
36 | diff --git a/pidl/idl.yp b/pidl/idl.yp | ||
37 | index b5c5185..c8a65f6 100644 | ||
38 | --- a/pidl/idl.yp | ||
39 | +++ b/pidl/idl.yp | ||
40 | @@ -610,7 +610,9 @@ again: | ||
41 | |||
42 | for ($parser->YYData->{INPUT}) { | ||
43 | if (/^\#/) { | ||
44 | - if (s/^\# (\d+) \"(.*?)\"( \d+|)//) { | ||
45 | + # Linemarker format is described at | ||
46 | + # http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html | ||
47 | + if (s/^\# (\d+) \"(.*?)\"(( \d+){1,4}|)//) { | ||
48 | $parser->YYData->{LINE} = $1-1; | ||
49 | $parser->YYData->{FILE} = $2; | ||
50 | goto again; | ||
51 | diff --git a/pidl/lib/Parse/Pidl/IDL.pm b/pidl/lib/Parse/Pidl/IDL.pm | ||
52 | index d4820ff..6927c89 100644 | ||
53 | --- a/pidl/lib/Parse/Pidl/IDL.pm | ||
54 | +++ b/pidl/lib/Parse/Pidl/IDL.pm | ||
55 | @@ -2576,7 +2576,9 @@ again: | ||
56 | |||
57 | for ($parser->YYData->{INPUT}) { | ||
58 | if (/^\#/) { | ||
59 | - if (s/^\# (\d+) \"(.*?)\"( \d+|)//) { | ||
60 | + # Linemarker format is described at | ||
61 | + # http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html | ||
62 | + if (s/^\# (\d+) \"(.*?)\"(( \d+){1,4}|)//) { | ||
63 | $parser->YYData->{LINE} = $1-1; | ||
64 | $parser->YYData->{FILE} = $2; | ||
65 | goto again; | ||
66 | -- | ||
67 | 1.7.5.4 | ||
68 | |||
diff --git a/meta-oe/recipes-connectivity/samba/samba_3.6.8.bb b/meta-oe/recipes-connectivity/samba/samba_3.6.8.bb index f80e41ed0..c3e834def 100644 --- a/meta-oe/recipes-connectivity/samba/samba_3.6.8.bb +++ b/meta-oe/recipes-connectivity/samba/samba_3.6.8.bb | |||
@@ -31,6 +31,7 @@ SRC_URI += "\ | |||
31 | file://configure-disable-core_pattern-cross-check.patch;patchdir=.. \ | 31 | file://configure-disable-core_pattern-cross-check.patch;patchdir=.. \ |
32 | file://configure-libunwind.patch;patchdir=.. \ | 32 | file://configure-libunwind.patch;patchdir=.. \ |
33 | file://samba-3.6.22-CVE-2013-4496.patch;patchdir=.. \ | 33 | file://samba-3.6.22-CVE-2013-4496.patch;patchdir=.. \ |
34 | file://0001-PIDL-fix-parsing-linemarkers-in-preprocessor-output.patch;patchdir=.. \ | ||
34 | " | 35 | " |
35 | SRC_URI[md5sum] = "fbb245863eeef2fffe172df779a217be" | 36 | SRC_URI[md5sum] = "fbb245863eeef2fffe172df779a217be" |
36 | SRC_URI[sha256sum] = "4f5a171a8d902c6b4f822ed875c51eb8339196d9ccf0ecd7f6521c966b3514de" | 37 | SRC_URI[sha256sum] = "4f5a171a8d902c6b4f822ed875c51eb8339196d9ccf0ecd7f6521c966b3514de" |