On Mon, Feb 01, 2016 at 04:41:44PM +0200, Niko Tyni wrote:
> Package: libperl-dev
> Version: 5.22.1-5

> I think the libperl-dev -> perl (-> perl-base) dependency is a bug now
> that libperl5.22 is M-A:same and has the full standard library. It should
> be enough for libperl-dev to Depend on libperl5.22.

On second thoughts, it's not quite that simple.

The supported way of embedding a perl interpreter (which is what every 
package linking against libperl does AFAIK) is to use the output of

 % perl -MExtUtils::Embed -e ccopts
 % perl -MExtUtils::Embed -e ldopts

which currently expand to

 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe 
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  
-I/usr/lib/x86_64-linux-gnu/perl/5.22/CORE

 -Wl,-E  -fstack-protector-strong -L/usr/local/lib  
-L/usr/lib/x86_64-linux-gnu/perl/5.22/CORE -lperl -ldl -lm -lpthread -lc -lcrypt

Both of these are obviously arch-dependent.

So even if the build dependencies become satisfiable for a cross build,
those packages will try to link against the build arch libperl rather
than the host arch one, and use the build arch perl headers.

Under the hood, the arch-dependent parts come from Config.pm. As
it happens, we currently ship symlinks to Config.pm in libperl5.22 under

 /usr/lib/<triplet>/perl/cross-config-<version>

as an experimental and undocumented measure mainly intended for cross
building Perl XS modules (arch:any lib*-perl packages).

As far as I can see, it should be possible to get things to work by
using ExtUtils::Embed with the above in @INC.

The ExtUtils::Embed calls are usually buried deep in upstream build
systems, and the above is very much Debian specific, so this would
probably introduce non-upstreamable patches. I'm not sure how wide
adoption we can expect for that.

Anyway, all the necessary components are in libperl5.22 so I suppose
this bug is still fixable by removing the perl dependency and adding some
documentation about how to achieve cross builds with the current setup.

Last, I note that if the perl dependency is removed, the symlink

 lrwxrwxrwx 1 root root 4 Dec  6  2013 /usr/share/doc/libperl-dev -> perl

needs to be turned into a regular directory or a symlink to libperl5.22.
-- 
Niko Tyni   nt...@debian.org

Reply via email to