]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/perl-Fix-Errno.pm-generation-for-gcc-5.0.patch
core115: Include captive portal in updater
[ipfire-2.x.git] / src / patches / perl-Fix-Errno.pm-generation-for-gcc-5.0.patch
CommitLineData
26d7f93e
MT
1From 96bcd6ed97ff05f5b421005f23973279dbfcafbf Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
3Date: Wed, 11 Feb 2015 15:46:37 +0100
4Subject: [PATCH 1/2] Fix Errno.pm generation for gcc-5.0
5
6gcc-5.0 -E interleaves now line numbers with expended macros, so that
7the generated errno.c will be preprocessed to
8
9EBFONT => [[
10 59
11 ]]
12
13which is hard to parse in in line-based reader.
14
15So use -P option with gcc >= 5.0. Global -P usage would break makedepend,
16global -ftrack-macro-expansion=0 would break lib/h2ph.t.
17
18RT#123784
19---
20 ext/Errno/Errno_pm.PL | 23 +++++++++++++++++------
21 1 file changed, 17 insertions(+), 6 deletions(-)
22
23diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
24index 3dadfce..c6bfa06 100644
25--- a/ext/Errno/Errno_pm.PL
26+++ b/ext/Errno/Errno_pm.PL
27@@ -215,20 +215,31 @@ sub write_errno_pm {
28 { # BeOS (support now removed) did not enter this block
29 # invoke CPP and read the output
30
31+ my $inhibit_linemarkers = '';
32+ if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) {
33+ # GCC 5.0 interleaves expanded macros with line numbers breaking
34+ # each line into multiple lines. RT#123784
35+ $inhibit_linemarkers = ' -P';
36+ }
37+
38 if ($^O eq 'VMS') {
39- my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}";
40+ my $cpp = "$Config{cppstdin} $Config{cppflags}" .
41+ $inhibit_linemarkers . " $Config{cppminus}";
42 $cpp =~ s/sys\$input//i;
43 open(CPPO,"$cpp errno.c |") or
44 die "Cannot exec $Config{cppstdin}";
45 } elsif ($IsMSWin32 || $^O eq 'NetWare') {
46- open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
47- die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
48+ my $cpp = "$Config{cpprun} $Config{cppflags}" .
49+ $inhibit_linemarkers;
50+ open(CPPO,"$cpp errno.c |") or
51+ die "Cannot run '$cpp errno.c'";
52 } elsif ($IsSymbian) {
53- my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc -";
54+ my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc" .
55+ $inhibit_linemarkers ." -";
56 open(CPPO,"$cpp < errno.c |")
57 or die "Cannot exec $cpp";
58 } else {
59- my $cpp = default_cpp();
60+ my $cpp = default_cpp() . $inhibit_linemarkers;
61 open(CPPO,"$cpp < errno.c |")
62 or die "Cannot exec $cpp";
63 }
64--
652.3.0
66