Your message dated Mon, 19 Nov 2018 19:49:54 +0000
with message-id <[email protected]>
and subject line Bug#875921: fixed in perl 5.28.0-4
has caused the Debian Bug report #875921,
regarding perl: Perl cross-build does not search correct paths for errno.h
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
875921: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=875921
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: perl
Version: 5.24.1-3+deb9u1
Severity: normal
Tags: upstream patch


Cross-building perl fails unless there is a copy of errno.h in
/usr/include or /usr/local/include. These are almost certainly
build-arch files unless you are building in a sysroot. The code is
essentially assuming a non-multiarch layout and the use of a
sysroot. When the sysroot is '' (as it is when crossing on debian)
this picks up the potentially wrong-arch errno.h of the build system.

The offending code is:
  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";
in ext/Error/Errno_pm.PL

For glibc-only systems this assumption does not break anything because
errno.h does not change by architecture. Nevertheless this is not
robust, and will break if/when #798955 is implemented. 

On a Debian (i.e. multiarch) system a search for header files should
look in /usr/include/$DEB_HOST_MULTIARCH before /usr/include. Once
798955 is implemented, looking in /usr/include is arguably incorrect,
although $sysroot/usr/include still makes sense

There is no obvious variable in the config file to set up this
search. The closest is incpth, and using that does work, which is what
the attached patch does. I'm not sure that it is really the optimum
include path set to search. Possibly yet another config option for
this would be the right thing to do. Better would be defining one for
$DEB_HOST_MULTIARCH so the path can be composed. 

I noticed this because I'm bootstrapping using rebootstrap, which
builds all libc6-dev's with #798955 implemented, so there is no
/usr/include/errno.h at all. You can simulate this by moving all the
headers in libc6-dev from /usr/include to /usr/include/$DEB_HOST_MULTIARCH

Patch supplied as simple patch and dpkg 3.0 (quilt) format fix.


Wookey
diff -urN perl-5.24.1.orig/ext/Errno/Errno_pm.PL perl-5.24.1/ext/Errno/Errno_pm.PL
--- perl-5.24.1.orig/ext/Errno/Errno_pm.PL	2017-09-15 16:04:41.332385550 +0000
+++ perl-5.24.1/ext/Errno/Errno_pm.PL	2017-09-15 16:04:56.948023389 +0000
@@ -133,7 +133,7 @@
 	# 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{incpth}"), "$sysroot/usr/include", "$sysroot/usr/local/include/",
 	    split / / => $Config{locincpth} or
 		die "Cannot find errno.h";
 	$file{$linux_errno_h} = 1;
diff -urN perl-5.24.1.orig/debian/patches/crossbuild-multiarch-paths-errno-fix.diff perl-5.24.1/debian/patches/crossbuild-multiarch-paths-errno-fix.diff
--- perl-5.24.1.orig/debian/patches/crossbuild-multiarch-paths-errno-fix.diff	1970-01-01 01:00:00.000000000 +0100
+++ perl-5.24.1/debian/patches/crossbuild-multiarch-paths-errno-fix.diff	2017-09-15 17:13:55.843532995 +0100
@@ -0,0 +1,20 @@
+Description: Look in multiarch include paths so errno.h is found when crossing
+ errno.h may be in /usr/include/$multiarch/ on a debian system.
+ The build system needs to look in there, but currently assumes a sysroot with no multiarch paths
+ The sysroot is harmless here, but the lack of multiarch support is fatal.
+ The config does not include the multiarch path simply. Closest available 
+ is incpth which includes gcc internal arch-specific dirs and the correct multiarch dirs.
 
+Author: Wookey <[email protected]>
+Last-Update: 2017-09-15
+
+--- perl-5.24.1.orig/ext/Errno/Errno_pm.PL
++++ perl-5.24.1/ext/Errno/Errno_pm.PL
+@@ -133,7 +133,7 @@ sub get_files {
+ 	# 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{incpth}"), "$sysroot/usr/include", "$sysroot/usr/local/include/",
+ 	    split / / => $Config{locincpth} or
+ 		die "Cannot find errno.h";
+ 	$file{$linux_errno_h} = 1;
diff -urN perl-5.24.1.orig/debian/patches/series perl-5.24.1/debian/patches/series
--- perl-5.24.1.orig/debian/patches/series	2017-09-15 17:04:41.172389260 +0100
+++ perl-5.24.1/debian/patches/series	2017-09-15 17:09:30.273687590 +0100
@@ -71,3 +71,4 @@
 fixes/getopt-long-4.diff
 fixes/fbm-instr-crash.diff
 debian/CVE-2016-1238/base-pm-amends-pt2.diff
+crossbuild-multiarch-paths-errno-fix.diff

--- End Message ---
--- Begin Message ---
Source: perl
Source-Version: 5.28.0-4

We believe that the bug you reported is fixed in the latest version of
perl, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Niko Tyni <[email protected]> (supplier of updated perl package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 19 Nov 2018 20:01:39 +0200
Source: perl
Binary: perl-base perl-doc perl-debug libperl5.28 libperl-dev perl-modules-5.28 
perl
Architecture: source
Version: 5.28.0-4
Distribution: unstable
Urgency: medium
Maintainer: Niko Tyni <[email protected]>
Changed-By: Niko Tyni <[email protected]>
Description:
 libperl-dev - Perl library: development files
 libperl5.28 - shared Perl library
 perl       - Larry Wall's Practical Extraction and Report Language
 perl-base  - minimal Perl system
 perl-debug - debug-enabled Perl interpreter
 perl-doc   - Perl documentation
 perl-modules-5.28 - Core Perl modules
Closes: 875921 912900 913096 913347 913349 913637 914013
Changes:
 perl (5.28.0-4) unstable; urgency=medium
 .
   [ Dominic Hargreaves ]
   * Add missing test dependency for 'prove' test (Closes: #913096)
 .
   [ Niko Tyni ]
   * Make perl Break apt-show-versions (<< 0.22.10) due to Storable
     changes. (Closes: #913349)
   * Cherry-pick several upstream fixes:
     + improve Storable recursion checks (Closes: #912900)
     + fix $^X when /proc is not mounted (Closes: #913347)
     + avoid mangling /bin non-perl shebangs on merged-/usr systems
       (Closes: #913637)
   * Apply patch from Helmut Grohne making Errno_pm.PL compatible with
     /usr/include/<ARCH>/errno.h . (Closes: #875921)
   * Apply patch from James Clarke fixing 'perl -i' functionality
     on kfreebsd. (See #912521)
   * Change perl-debug package priority from extra to optional.
   * Remove unused outdated lintian overrides.
   * Make perl-base and libperl5.28 Suggest sensible-utils for
     sensible-pager. (Closes: #914013)
Checksums-Sha1:
 1dfcc94a7e3e7c9652781f6604cd211e90a912ac 2813 perl_5.28.0-4.dsc
 351f046f73379171e0537b99ec17e50d8fb9c15c 165832 perl_5.28.0-4.debian.tar.xz
 44bad113955ffe4e7798dabaf7f4efdfedafa9a1 4677 perl_5.28.0-4_source.buildinfo
Checksums-Sha256:
 cca19dc5b1600c52dd288ef1401ab595a524344c8bc9f750915ad49b25bfdbec 2813 
perl_5.28.0-4.dsc
 6e8ff85ce28e80cf8f531a98d41761132bae67cb87e0eebb77523f94fdf9a749 165832 
perl_5.28.0-4.debian.tar.xz
 94a6e6f521f4cbe4684ebdcebd62ea72fdb1cae3ebe5d19d4398e1305d5f3999 4677 
perl_5.28.0-4_source.buildinfo
Files:
 736cb4c0ef90476ad01f344975959b6d 2813 perl standard perl_5.28.0-4.dsc
 f309c9283c96158ebdc2a83d11c0151a 165832 perl standard 
perl_5.28.0-4.debian.tar.xz
 e0fe8be11e14d1419d940973c5535a2a 4677 perl standard 
perl_5.28.0-4_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCAAvFiEEdqKOQsmBHZHoj7peLsD/s7cwGx8FAlvy+q4RHG50eW5pQGRl
Ymlhbi5vcmcACgkQLsD/s7cwGx8PaQ/+NFF+Jg2bflkL/awGpInZgNyg6pnOxiJi
YjUcrzFrmbUCf51ecbm049meG2NK5/swhaWk+4qYStKpPyz+TU4C4HuKdJlQMOUp
JdkF+vqgbnR38BxqQGjVseFFlmyf5vKb92W8HIsV+F9SOj2//Gf0f8kBYU3BwYoZ
wqw8JyfoWwERqnHnMvWl092E9GhV3nO01UxIeKfe0jvfglt+2jReqvMVFaRSIXD8
F5Lw+8hjemfso6vF8NtOyb9Vk7bPZGWRY4j/gm6kVy1Ys3WAZbqt5iWj8hqB6zBG
gIzc0YU7aDeJ1a+0jYTOw/c+eP36PuO9oNcv/Oq550X2Bj1ddB3Tjeoz0CyZrmwL
lW5ZR7Ang1UomP/AieOgQKXpJXXEbbGx5ukwBrjCHec0+/WmW/J5J7CQg3L1eeId
btQgaLPLxk1tkbqDkWUfDphSXiHoOmso/JZO+/y85cCS6BKTS9wmk6UEioch2d63
Qos0IGyKYevtd6XsnikTIugJfcS65QG5djg5bo3q8lUEVB+LqrX2jSy+ooPPceVC
WSM17OCqLYParLHB2ffw5RTSfj4UCgqgJBp8hLyQFsGhxWrImbXr/+U1+dynRBKz
acTZet9SlkanAx3kQZ0ykdsJkopiERquIXqkJATdC4t/PDCx0gmcYspJLMsZPjAG
5AudY6b70Ck=
=SZaJ
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to