Subject: Re: QBE and cproc upstreaming

From: [email-masked]
Date: Sat, 07 May 2022 16:34:40 +0000

Hi Liliana,

> IMHO, paren's initial patch is slightly better in quality than 55151,
> but there are two (three) things lacking. First, the synopsis and
> description are subpar. 55151 has a slightly better synopsis, don't
> feel too sure about the description though. Second, the "fix-cc" phase
> from 55151 should be added after unpack ("patch-test-script" sounds
> like a better phase name). It might be better to use (cc-for-target)
> in the substitution rather than gcc, but note that this substitution
> only applies for native compilation anyway.

I have made your suggested improvements, plus substantial changes to the build recipe that allows
you to cross-compile both QBE and cproc. I have confirmed that cross-compilation works for aarch64
and riscv64. Here is the updated code: <https://git.sr.ht/~whereiseveryone/guixrus/tree/master/guixrus/packages/qbe.scm>.

The changes are as follows for qbe:
* Patch the makefile to support cross-building with a TARGET variable. This is done with a standalone
patch.
* Set "TARGET" to the appropriate target system.
* Set the correct supported systems. (It supports x86_64, aarch64, and riscv64 currently.)
* Improve the synopsis and description.
* Update to the latest commit.
Note that tests still aren't provided because they use QEMU.

And cproc:
* Reenable tests. Not sure why they were disabled in the first place...
* Instead of skipping the configuration phase, replace it with an invocation of cproc's hand-written
./configure. Pass the correct arguments to it to allow cross-compilation to aarch64.
* Use gcc:lib as an input to support cross-compilation.
* Set the correct supported systems. (It supports riscv64 only under musl libc right now.)
* Improve the synopsis and description.
* Update to the latest commit.

I think they are ready for upstreaming now. I will send improved patches to the appropriate issue
threads.