New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] Make Errno_pm.PL compatible with /usr/include/<ARCH>/errno.h #16751
Comments
From @ntyniThis is a bug report for perl from ntyni@debian.org, As seen in <https://bugs.debian.org/798955>, Debian glibc The attached patch changes the logic to take the cpp fallback instead This will also enable multiarch (non-sysroot) cross builds. Original patch by Helmut Grohne. Bug-Debian: https://bugs.debian.org/875921 Flags: Site configuration information for perl 5.29.5: Configured by niko at Sat Nov 17 20:25:08 EET 2018. Summary of my perl5 (revision 5 version 29 subversion 5) configuration: Locally applied patches: @INC for perl 5.29.5: Environment for perl 5.29.5: |
From @ntyni0001-Make-Errno_pm.PL-compatible-with-usr-include-ARCH-er.patchFrom 66c44c59a373128794723ae75e48c1f21328e357 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sat, 17 Nov 2018 19:27:42 +0200
Subject: [PATCH] Make Errno_pm.PL compatible with /usr/include/<ARCH>/errno.h
As seen in <https://bugs.debian.org/798955>, Debian glibc
maintainers intend to move system header files from /usr/include to
/usr/include/<arch> at some point. This would break Errno_pm.PL, which
has logic for asking cpp for the location of errno.h but fails earlier
if errno.h is not on a list of known paths.
Take the cpp fallback instead of dying. The behaviour should stay
identical as long as errno.h is not moved.
This will also enable multiarch (non-sysroot) cross builds.
Original patch by Helmut Grohne.
Bug-Debian: https://bugs.debian.org/875921
---
ext/Errno/Errno_pm.PL | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index d565f31b2f..84fd151d27 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
use Config;
use strict;
-our $VERSION = "1.29";
+our $VERSION = "1.30";
my %err = ();
@@ -111,6 +111,17 @@ sub default_cpp {
sub get_files {
my %file = ();
+ # When cross-compiling we may store a path for gcc's "sysroot" option:
+ my $sysroot = $Config{sysroot} || '';
+ my $linux_errno_h;
+ if ($^O eq 'linux') {
+ # Some Linuxes have weird errno.hs which generate
+ # no #file or #line directives
+ ($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" }
+ "$sysroot/usr/include", "$sysroot/usr/local/include",
+ split / / => $Config{locincpth};
+ }
+
# VMS keeps its include files in system libraries
if ($^O eq 'VMS') {
$file{'Sys$Library:DECC$RTLDEF.TLB'} = 1;
@@ -125,17 +136,10 @@ sub get_files {
}
} elsif ($^O eq 'linux' &&
$Config{gccversion} ne '' &&
- $Config{gccversion} !~ /intel/i
+ $Config{gccversion} !~ /intel/i &&
# might be using, say, Intel's icc
+ $linux_errno_h
) {
- # When cross-compiling we may store a path for gcc's "sysroot" option:
- my $sysroot = $Config{sysroot} || '';
- # Some Linuxes have weird errno.hs which generate
- # no #file or #line directives
- my ($linux_errno_h) = grep { -e $_ } map { "$_/errno.h" }
- "$sysroot/usr/include", "$sysroot/usr/local/include",
- split / / => $Config{locincpth} or
- die "Cannot find errno.h";
$file{$linux_errno_h} = 1;
} elsif ($^O eq 'haiku') {
# hidden in a special place
--
2.19.1
|
From @jkeenanOn Sat, 17 Nov 2018 19:19:21 GMT, ntyni@debian.org wrote:
Made available for smoke testing in this branch: smoke-me/jkeenan/ntyni/rt-133662-errno-pm -- |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Sat, 17 Nov 2018 11:19:21 -0800, ntyni@debian.org wrote:
Thanks, applied as 6c5080f. Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#133662 (status was 'resolved')
Searchable as RT133662$
The text was updated successfully, but these errors were encountered: