[Reproducible-commits] [perl] 07/36: Fix Errno.pm generation for gcc-5.0

Mattia Rizzolo mattia at mapreri.org
Tue Nov 17 14:00:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

mapreri-guest pushed a commit to branch pu/reproducible_builds
in repository perl.

commit 19809565cb228a6862d9d2bd403dfcc8b5be67d7
Author: Petr Písař <ppisar at redhat.com>
Date:   Wed Feb 11 15:46:37 2015 +0100

    Fix Errno.pm generation for gcc-5.0
    
    gcc-5.0 -E interleaves now line numbers with expended macros, so that
    the generated errno.c will be preprocessed to
    
    EBFONT => [[
               59
                    ]]
    
    which is hard to parse in in line-based reader.
    
    So use -P option with gcc >= 5.0. Global -P usage would break makedepend,
    global -ftrack-macro-expansion=0 would break lib/h2ph.t.
    
    RT#123784
    
    (Backported by Niko Tyni <ntyni at debian.org>)
    
    Origin: upstream, http://perl5.git.perl.org/perl.git/commit/816b056ffb99ae54642320e20dc30a59fd1effef
    Bug: https://rt.perl.org/Ticket/Display.html?id=123784
    Bug-Debian: https://bugs.debian.org/778060
    Patch-Name: fixes/gcc5-errno.diff
---
 ext/Errno/Errno_pm.PL | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index 26dcd30..2160c61 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -225,20 +225,31 @@ sub write_errno_pm {
     {	# BeOS (support now removed) did not enter this block
     # invoke CPP and read the output
 
+	my $inhibit_linemarkers = '';
+	if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) {
+	    # GCC 5.0 interleaves expanded macros with line numbers breaking
+	    # each line into multiple lines. RT#123784
+	    $inhibit_linemarkers = ' -P';
+	}
+
 	if ($^O eq 'VMS') {
-	    my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}";
+	    my $cpp = "$Config{cppstdin} $Config{cppflags}" .
+		$inhibit_linemarkers . " $Config{cppminus}";
 	    $cpp =~ s/sys\$input//i;
 	    open(CPPO,"$cpp  errno.c |") or
 		die "Cannot exec $Config{cppstdin}";
 	} elsif ($IsMSWin32 || $^O eq 'NetWare') {
-	    open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
-		die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
+	    my $cpp = "$Config{cpprun} $Config{cppflags}" .
+		$inhibit_linemarkers;
+	    open(CPPO,"$cpp errno.c |") or
+		die "Cannot run '$cpp errno.c'";
 	} elsif ($IsSymbian) {
-            my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc -";
+            my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc" .
+		$inhibit_linemarkers ." -";
 	    open(CPPO,"$cpp < errno.c |")
 		or die "Cannot exec $cpp";
         } else {
-	    my $cpp = default_cpp();
+	    my $cpp = default_cpp() . $inhibit_linemarkers;
 	    open(CPPO,"$cpp < errno.c |")
 		or die "Cannot exec $cpp";
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/perl.git



More information about the Reproducible-commits mailing list