On 2017-09-16 11:16 +0300, Niko Tyni wrote: > On Sat, Sep 16, 2017 at 01:06:48AM +0100, Wookey wrote: > > Package: perl > > Version: 5.24.1-3+deb9u1 > > Severity: normal > > Tags: upstream patch > > > 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. > > Hi, incpth is set in Configure based on what the preprocessor reports > as its search path. Using that seems quite correct and robust to me.
OK. That seems fair enough. We can't really argue with our own cpp search path, I guess :-) I admit that I'm not exactly sure of the effect of the internal compiler paths in practice, but I presume they are sensible and/or harmless in this case. > Getting this upstream so that incpth is searched before the sysroot > prefixed dirs (which degrade to normal /usr/include and /usr/local/include > for us as sysroot is empty) may be hard. The sysroot stuff was added in > > https://perl5.git.perl.org/perl.git/commitdiff/98b12e44bdf730698c03a5a4d8fc93c41d931637 > and is presumably still used by other cross compiling efforts. > > Possibly the logic that could go upstream would be > > 1) look in $sysroot/usr/{,local/}include but only if $sysroot is set > 2) look in incpth > 3) look in locincpth > 4) if all fails, try /usr/include and /usr/local/include last That seems sensible, but IMHO sysroot ought to work with a multiarch layout too. One's sysroot filesystem could be a debian/ubuntu-based one. Whilst we provide a 'better' mechanism for being able to cross without having to use sysroots, sysroot-style building could still be used. The idea of sysroot is that the system works the same but the search is moved down to a new root, not that it's a 'special' layout. How about just decomposing incpth and prefixing all the paths with $sysroot. That'll work for both multiarch and non-multiarch layout both with and without sysroot. (unless people contrive to have building environments where incpth is not set to anything sensible?) If someone can justify adding $sysroot/usr/local/include even though it's not in incpth on the end then do that too. Using $locincpth sounds like it might be more correct here, but I'm not sure exactly how that is intended to be used. ie look in: 1) $sysroot/incpth 2) $sysroot/locincpth maybe fall back to /usr/include and /usr/local/include but that's going beyond what the current code does. That seems a cleaner solution to me. Wookey -- Principal hats: Linaro, Debian, Wookware, ARM http://wookware.org/
signature.asc
Description: Digital signature