[debhelper-devel] Bug#877357: Bug#877357: debhelper: Make qmake buildsystem support cross building

Dmitry Shachnev mitya57 at debian.org
Sun Oct 1 15:47:18 UTC 2017


Control: block -1 by 876861

Hi Niels!

On Sun, Oct 01, 2017 at 06:07:00AM +0000, Niels Thykier wrote:
> I have done a quick review and with my remarks below:
>
> [patch1]
> > @@ -52,6 +52,10 @@ sub configure {
> >  
> >  	push @options, '-makefile';
> >  	push @options, '-nocache';
> > +	if (is_cross_compiling()) {
> > +		# Force generic mkspec to avoid -m32 / -m64 flags
> > +		push @options, ("-spec", "linux-g++");
>    		^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> I believe we rely on cross-builds producing bit-for-bit identical output
> with a native build as a part of the QA.  If so, then this need to be
> unconditional (possibly in a later compat level).

The differences between linux-g++ and linux-g++-64 mkspecs are:

- using -m64 compiler flag, which is not needed on Debian and has no effect;
- using -L/usr/X11R6/lib64 linker flag, which also does not make any sense.

These options should not have any effect on produced result.

I have also just committed a change [1] to qtbase which makes linux-g++
the default mkspec on all Linux architectures (so it will be used for
non-cross builds too).

> If the -spec option is used, then I will need something that also works
> for other architectures/OSes.  It is fine if it is a stable of known
> OSes mapped to their option (like we do for cmake).

I have now added support for GNU/kFreeBSD and Hurd.

> > @@ -55,6 +56,14 @@ sub configure {
> >  	if (is_cross_compiling()) {
> >  		# Force generic mkspec to avoid -m32 / -m64 flags
> >  		push @options, ("-spec", "linux-g++");
> > +
> > +		my ($fh, $filename) = tempfile("qt.XXXX", SUFFIX => ".conf", TMPDIR => 1, UNLINK => 1);
> > +		$fh->print("[Paths]\n");
> > +		$fh->print("Prefix=/usr\n");
> > +		$fh->print("HostData=lib/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "/qt5\n");
> > +		$fh->print("Headers=include/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "/qt5\n");
>
> These two lines should almost certainly use DEB_HOST_MULTIARCH.  :)

Thank you! Fixed, updated patches are attached.

I forgot to mention that this currently works only when qt5-qmake:native is
added as a build dep. To make it work better, I plan to split qt5-qmake into
two packages, and make one that contains the qmake binary Multi-Arch: foreign
(just like qtbase5-dev-tools currently is). Because of this I added #876861
as a blocker, but it should not prevent you from updating debhelper earlier.

[1]: https://anonscm.debian.org/cgit/pkg-kde/qt/qtbase.git/commit/?id=1f0b1d8551bd1dcf

--
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-qmake.pm-Add-initial-support-for-cross-building.patch
Type: text/x-diff
Size: 2051 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20171001/a3ba95c9/attachment-0006.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-qmake.pm-Use-a-custom-qt.conf-file-for-cross-builds.patch
Type: text/x-diff
Size: 1380 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20171001/a3ba95c9/attachment-0007.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debhelper-devel/attachments/20171001/a3ba95c9/attachment-0003.sig>


More information about the debhelper-devel mailing list