[PATCH] gnu: Add qbe.

  • Done
  • quality assurance status badge
Details
5 participants
  • jgart
  • Liliana Marie Prikler
  • Liliana Marie Prikler
  • Ludovic Courtès
  • paren
Owner
unassigned
Submitted by
jgart
Severity
normal
Merged with
J
J
jgart wrote on 7 Feb 2022 02:13
(address . guix-patches@gnu.org)(name . jgart)(address . jgart@dismail.de)
20220207011332.27844-1-jgart@dismail.de
* gnu/packages/c.scm (qbe): New variable.
---
gnu/packages/c.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (43 lines)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 459d996fa2..8966b7b8d0 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -142,6 +142,36 @@ (define-public pcc
;; preferred. See http://pcc.ludd.ltu.se/licenses/ for more details.
(license (list license:bsd-2 license:bsd-3))))
+(define-public qbe
+ (let ((commit "2ca6fb25a238842418019a3f9ee8d1beb1327f7e")
+ (revision "0"))
+ (package
+ (name "qbe")
+ (version (git-version "0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "git://c9x.me/qbe")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0qbnsrwk10v0s42vzxy2wvksd8xl8bmxfzqv2a4j4zjaklqgfd6j"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; Tests require a running qemu?
+ #:make-flags (list (string-append "CC=" ,(cc-for-target))
+ (string-append "PREFIX=" %output))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure))))
+ (synopsis "Backend compiler")
+ (description "@code{qbe} is a compiler backend.")
+ (home-page "https://c9x.me/compile/")
+ (license license:expat))))
+
(define-public libbytesize
(package
(name "libbytesize")
--
2.35.0
L
L
Liliana Marie Prikler wrote on 7 Feb 2022 10:47
7974e4fbf6a2b7beb41ead69a708a78a460b295e.camel@ist.tugraz.at
Am Sonntag, dem 06.02.2022 um 20:13 -0500 schrieb jgart:
Toggle quote (20 lines)
> * gnu/packages/c.scm (qbe): New variable.
> ---
>  gnu/packages/c.scm | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>
> diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
> index 459d996fa2..8966b7b8d0 100644
> --- a/gnu/packages/c.scm
> +++ b/gnu/packages/c.scm
> @@ -142,6 +142,36 @@ (define-public pcc
>      ;; preferred.  See http://pcc.ludd.ltu.se/licenses/ for more
> details.
>      (license (list license:bsd-2 license:bsd-3))))
>  
> +(define-public qbe
> +  (let ((commit "2ca6fb25a238842418019a3f9ee8d1beb1327f7e")
> +        (revision "0"))
> +    (package
> +      (name "qbe")
> +      (version (git-version "0.0" revision commit))
From the homepage: "QBE is in constant change. It is a young project
and I still have many ideas to try." As always, I don't think it's too
good of an idea to package projects that tell you "this edge will make
you bleed". Or in the words of the manual

Toggle quote (4 lines)
> Occasionally, we package snapshots of upstream’s version control
> system (VCS) instead of formal releases. This should remain
> exceptional, because it is up to upstream developers to clarify what
> the stable release is.
I think upstream is very clear here that QBE is not yet stable and
therefore not something you'd want in a distro. Of course, since the
recipe is a rather simple one, you can easily maintain it in your own
channel -- or not package it at all and use it from source with just a
C compiler.

Toggle quote (15 lines)
> +      (source
> +        (origin
> +          (method git-fetch)
> +          (uri
> +            (git-reference
> +              (url "git://c9x.me/qbe")
> +              (commit commit)))
> +          (file-name (git-file-name name version))
> +          (sha256
> +           (base32
> +           
> "0qbnsrwk10v0s42vzxy2wvksd8xl8bmxfzqv2a4j4zjaklqgfd6j"))))
> +      (build-system gnu-build-system)
> +      (arguments
> +       `(#:tests? #f ; Tests require a running qemu?
You should be able to add qemu to native-inputs if that's all it takes.
Toggle quote (7 lines)
> +         #:make-flags (list (string-append "CC=" ,(cc-for-target))
> +                            (string-append "PREFIX=" %output))
> +         #:phases
> +         (modify-phases %standard-phases
> +           (delete 'configure))))
> +      (synopsis "Backend compiler")
> +      (description "@code{qbe} is a compiler backend.")
It'd be nice if the description was more descriptive :)
Also the synopsis should probably not invert the ordering of "compiler"
and "backend".
Toggle quote (7 lines)
> +      (home-page "https://c9x.me/compile/")
> +      (license license:expat))))
> +
>  (define-public libbytesize
>    (package
>      (name "libbytesize")

Cheers
J
J
jgart wrote on 8 Feb 2022 22:10
(name . Liliana Marie Prikler)(address . liliana.prikler@ist.tugraz.at)(address . 53833@debbugs.gnu.org)
20220208161034.GB28776@gac.attlocal.net
On Mon, 07 Feb 2022 10:47:08 +0100 Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> wrote:
Toggle quote (36 lines)
> Am Sonntag, dem 06.02.2022 um 20:13 -0500 schrieb jgart:
> > * gnu/packages/c.scm (qbe): New variable.
> > ---
> >  gnu/packages/c.scm | 30 ++++++++++++++++++++++++++++++
> >  1 file changed, 30 insertions(+)
> >
> > diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
> > index 459d996fa2..8966b7b8d0 100644
> > --- a/gnu/packages/c.scm
> > +++ b/gnu/packages/c.scm
> > @@ -142,6 +142,36 @@ (define-public pcc
> >      ;; preferred.  See http://pcc.ludd.ltu.se/licenses/ for more
> > details.
> >      (license (list license:bsd-2 license:bsd-3))))
> >  
> > +(define-public qbe
> > +  (let ((commit "2ca6fb25a238842418019a3f9ee8d1beb1327f7e")
> > +        (revision "0"))
> > +    (package
> > +      (name "qbe")
> > +      (version (git-version "0.0" revision commit))
> From the homepage: "QBE is in constant change. It is a young project
> and I still have many ideas to try." As always, I don't think it's too
> good of an idea to package projects that tell you "this edge will make
> you bleed". Or in the words of the manual
>
> > Occasionally, we package snapshots of upstream’s version control
> > system (VCS) instead of formal releases. This should remain
> > exceptional, because it is up to upstream developers to clarify what
> > the stable release is.
> I think upstream is very clear here that QBE is not yet stable and
> therefore not something you'd want in a distro. Of course, since the
> recipe is a rather simple one, you can easily maintain it in your own
> channel -- or not package it at all and use it from source with just a
> C compiler.

Hi lilyp,

Thanks for the review. It's much appreciated.

Here's a recent talk from FOSDEM 2022 on qbe by Drew Devault in case
you're interested in finding out more about it:


I already have qbe in Guix 'R Us along with cproc:


If maintainers think it will be ready for Guix in the future ping me or
feel free to send an update as you see fit.

all best,

jgart

gemini://whereiseveryone.srht.site/

L
L
Ludovic Courtès wrote on 5 Apr 2022 18:11
Re: bug#53833: [PATCH] gnu: Add qbe.
(name . jgart)(address . jgart@dismail.de)
87sfqrldcu.fsf_-_@gnu.org
Hi jgart,

jgart <jgart@dismail.de> skribis:

Toggle quote (7 lines)
> I already have qbe in Guix 'R Us along with cproc:
>
> https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/qbe.scm#L43
>
> If maintainers think it will be ready for Guix in the future ping me or
> feel free to send an update as you see fit.

I’m not opposed to including it if it’s useful but like you write, since
you have it in a channel, maybe we can wait until it’s mature enough
before getting it in Guix proper.

I’m closing this issue but feel free to ping us when you think it should
get in.

Thanks,
Ludo’.
Closed
P
(address . 53833@debbugs.gnu.org)
b3652409ce29bb4b93043fe7f4b5527239e6dad3@disroot.org
QBE is now being used in one reasonably mature project: https://harelang.orghttps://harelang.org/

While it's not at 1.0 yet, it's been in development for ~2 (i think) years now.
L
L
Liliana Marie Prikler wrote on 26 Apr 2022 09:43
(address . ludo@gnu.org)
fd9a92d751334edbaecaaf9ca9a1c88e82af0d33.camel@ist.tugraz.at
Am Montag, dem 25.04.2022 um 20:05 +0000 schrieb paren@disroot.org:
Toggle quote (5 lines)
> QBE is now being used in one reasonably mature project:
> https://harelang.org
>
> While it's not at 1.0 yet, it's been in development for ~2 (i think)
> years now.
I'm not asking for a 1.0, I'd be fine with a 0.1 or even a 0.0.1. As
it stands, every place I look at says "this is experimental" rather
than "you can use this and it ought to work as intended at least for
these sample programs".

Cheers
P
93eb9d1f96c32f607f056fe3b3225f89d99f2a2e@disroot.org
Toggle quote (5 lines)
> I'm not asking for a 1.0, I'd be fine with a 0.1 or even a 0.0.1. As
> it stands, every place I look at says "this is experimental" rather
> than "you can use this and it ought to work as intended at least for
> these sample programs".

Ah, I think you misunderstood slightly: I was saying that Hare was not yet at 1.0 yet (although QBE isn't either.) Regardless, I think it is mature enough for Guix, especially as a stable programming language uses it now.

By the way, https://c9x.me/compileis really outdated, so its estimate on QBE's stability is probably inaccurate by now.
L
L
Ludovic Courtès wrote on 1 May 2022 15:16
(name . Liliana Marie Prikler)(address . liliana.prikler@ist.tugraz.at)
87h7694cma.fsf@gnu.org
Hi,

Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> skribis:

Toggle quote (11 lines)
> Am Montag, dem 25.04.2022 um 20:05 +0000 schrieb paren@disroot.org:
>> QBE is now being used in one reasonably mature project:
>> https://harelang.org
>>
>> While it's not at 1.0 yet, it's been in development for ~2 (i think)
>> years now.
> I'm not asking for a 1.0, I'd be fine with a 0.1 or even a 0.0.1. As
> it stands, every place I look at says "this is experimental" rather
> than "you can use this and it ought to work as intended at least for
> these sample programs".

But that’s fine: having a web page at all, or one that doesn’t read
“experimental”, has never been a criterion for getting a package in
Guix.

There’s now a second patch for qbe:


I propose to go ahead and apply it, adding anything missing from paren’s
initial patch.

Thanks,
Ludo’.
L
L
Liliana Marie Prikler wrote on 2 May 2022 08:33
(name . Ludovic Courtès)(address . ludo@gnu.org)
23ff4ecaf07b3cec38d452d69785f1dd450581d7.camel@ist.tugraz.at
Hi Ludo,

Am Sonntag, dem 01.05.2022 um 15:16 +0200 schrieb Ludovic Courtès:
Toggle quote (19 lines)
> Hi,
>
> Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> skribis:
>
> > Am Montag, dem 25.04.2022 um 20:05 +0000 schrieb paren@disroot.org:
> >
> > > QBE is now being used in one reasonably mature project:
> > > https://harelang.org
> > >
> > > While it's not at 1.0 yet, it's been in development for ~2 (i
> > > think) years now.
> > I'm not asking for a 1.0, I'd be fine with a 0.1 or even a 0.0.1. 
> > As it stands, every place I look at says "this is experimental"
> > rather than "you can use this and it ought to work as intended at
> > least for these sample programs".
>
> But that’s fine: having a web page at all, or one that doesn’t read
> “experimental”, has never been a criterion for getting a package in
> Guix.
That's not my criterion either. My critierion is more or less "Will we
have to revision-bump this package daily/every few days because people
want to play with the latest stuff?" With upstream having seen no
commit for three weeks at this point, I guess it might be fine.

Toggle quote (6 lines)
> There’s now a second patch for qbe:
>
>   https://issues.guix.gnu.org/55151
>
> I propose to go ahead and apply it, adding anything missing from
> paren’s initial patch.
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.

cproc too seems to grow at a slower pace now. Might be worth moving
stuff over from guixrus now. Note that the cproc package has #:tests
#f without an explanation, though, so it needs some polishing.

Cheers
P
P
paren wrote on 7 May 2022 18:34
Re: QBE and cproc upstreaming
(address . 53833@debbugs.gnu.org)(address . liliana.prikler@ist.tugraz.at)
8b70a176c466220eea29aa967d104fdfc2ac93e6@disroot.org
Hi Liliana,

Toggle quote (9 lines)
> 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

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.
(
(
(unmatched-parenthesis wrote on 7 May 2022 19:09
[PATCH] gnu: Add qbe.
(address . 53833@debbugs.gnu.org)(name . (unmatched-parenthesis)(address . paren@disroot.org)
20220507170942.13785-1-paren@disroot.org
* gnu/packages/c.scm (qbe): New variable.

Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
---
gnu/packages/c.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

Toggle diff (43 lines)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index da034d5fd9..1e3296dae1 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -1064,3 +1064,36 @@ (define-public utf8-h
C and C++. The functions it provides are like those from the C header
string.h, but with a utf8* prefix instead of the str* prefix.")
(license license:unlicense))))
+
+(define-public qbe
+ (let ((commit "2caa26e388b1c904d2f12fb09f84df7e761d8331")
+ (revision "1"))
+ (package
+ (name "qbe")
+ (version (git-version "0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "git://c9x.me/qbe")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (patches (search-patches "qbe-makefile-add-target.patch"))
+ (sha256
+ (base32 "1gv03ym0gqrl4wkbhysa82025xwrkr1fg44z814b6vnggwlqgljc"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; Tests require a running qemu
+ #:make-flags ,#~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PREFIX=" #$output)
+ (string-append "TARGET=" #$(or (%current-target-system)
+ (%current-system))))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure))))
+ (supported-systems (list "x86_64-linux" "aarch64-linux" "riscv64-linux"))
+ (synopsis "Simple, straightforward backend compiler")
+ (description "QBE is a compiler backend with the goal of reaching 70% of the
+performance of advanced compilers such as LLVM and GCC in only 10% of the code.")
+ (home-page "https://c9x.me/compile/")
+ (license license:expat))))
--
2.36.0
(
(
(unmatched-parenthesis wrote on 7 May 2022 19:11
[PATCH] gnu: patches: Add qbe-makefile-add-target.patch.
(address . 53833@debbugs.gnu.org)(name . (unmatched-parenthesis)(address . paren@disroot.org)
20220507171104.13861-1-paren@disroot.org
* gnu/packages/patches/qbe-makefile-add-target.patch: New variable.

Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
---
.../patches/qbe-makefile-add-target.patch | 56 +++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100644 gnu/packages/patches/qbe-makefile-add-target.patch

Toggle diff (64 lines)
diff --git a/gnu/packages/patches/qbe-makefile-add-target.patch b/gnu/packages/patches/qbe-makefile-add-target.patch
new file mode 100644
index 0000000000..e87559c3fa
--- /dev/null
+++ b/gnu/packages/patches/qbe-makefile-add-target.patch
@@ -0,0 +1,56 @@
+This patch modifies the QBE makefile to add a TARGET variable that allows us to support
+cross-compiling it. We modify the case...esac in the config.h target to use this variable
+instead of TARGET.
+--- a/Makefile
++++ b/Makefile
+@@ -17,6 +17,8 @@ OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) $(ARM64OBJ) $(RV64OBJ)
+
+ CFLAGS += -Wall -Wextra -std=c99 -g -pedantic
+
++TARGET = unknown
++
+ $(OBJDIR)/$(BIN): $(OBJ) $(OBJDIR)/timestamp
+ @test -z "$(V)" || echo "ld $@"
+ $(V)$(CC) $(LDFLAGS) $(OBJ) -o $@
+@@ -39,26 +41,21 @@ $(RV64OBJ): rv64/all.h
+ $(OBJDIR)/main.o: config.h
+
+ config.h:
+- @case `uname` in \
+- *Darwin*) \
+- echo "#define Defasm Gasmacho"; \
+- echo "#define Deftgt T_amd64_sysv"; \
+- ;; \
+- *) \
+- echo "#define Defasm Gaself"; \
+- case `uname -m` in \
+- *aarch64*) \
+- echo "#define Deftgt T_arm64"; \
+- ;; \
+- *riscv64*) \
+- echo "#define Deftgt T_rv64"; \
+- ;; \
+- *) \
+- echo "#define Deftgt T_amd64_sysv";\
+- ;; \
+- esac \
+- ;; \
+- esac > $@
++ @echo "#define Defasm Gaself" >> $@
++ @case $(TARGET) in \
++ *x86_64*) \
++ echo "#define Deftgt T_amd64_sysv"; \
++ ;; \
++ *aarch64*) \
++ echo "#define Deftgt T_arm64"; \
++ ;; \
++ *riscv64*) \
++ echo "#define Deftgt T_rv64"; \
++ ;; \
++ *) \
++ echo "#error target not set to x86_64, aarch64, or riscv64 in makefile"; \
++ ;; \
++ esac >> $@
+
+ install: $(OBJDIR)/$(BIN)
+ mkdir -p "$(DESTDIR)/$(PREFIX)/bin/"
--
2.36.0
(
(
(unmatched-parenthesis wrote on 7 May 2022 19:21
[PATCH] gnu: packages: c: Add (unmatched parenthesis copyright statement.
(address . 53833@debbugs.gnu.org)(name . (unmatched-parenthesis)(address . paren@disroot.org)
20220507172135.14701-1-paren@disroot.org
* gnu/packages/c.scm: Add my copyright line.

Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
---
I forgot to add my copyright AGAIN /o\ I am extremely absent-minded :P

gnu/packages/c.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index e03ea2e6eb..1477734718 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
;;; Copyright © 2021 David Dashyan <mail@davie.li>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
--
2.36.0
P
P
paren wrote on 7 May 2022 20:19
Re: Upstreaming QBE and cproc
(address . 53833@debbugs.gnu.org)
838884700bc7082f7c62407b4cf9c1ec85dc3e54@disroot.org
I just noticed that the QBE makefile patch contains a mistake in the description:

Toggle quote (4 lines)
> This patch modifies the QBE makefile to add a TARGET variable that allows us to support
> cross-compiling it. We modify the case...esac in the config.h target to use this variable
> instead of TARGET.

"instead of TARGET" should be "instead of uname". I can't really see much point in submitting a whole v2 patch for that, especially since i've already made further adjustments to the c.scm file for cproc, so could whoever merges this change that please? Thanks!
(
(
(unmatched-parenthesis wrote on 8 May 2022 22:21
[PATCH v2] gnu: Add qbe.
(address . 53833@debbugs.gnu.org)(name . (unmatched-parenthesis)(address . paren@disroot.org)
20220508202154.9648-1-paren@disroot.org
* gnu/packages/c.scm (qbe): New variable.

Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
---
This improved patch (1) squashes the three commits together, (2) enables
tests for QBE, and (3) fixes some style nits.

Thanks to lilyp for feedback on #guix!

gnu/packages/c.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (61 lines)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index da034d5fd9..c9a25eb801 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
;;; Copyright © 2021 David Dashyan <mail@davie.li>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1064,3 +1065,46 @@ (define-public utf8-h
C and C++. The functions it provides are like those from the C header
string.h, but with a utf8* prefix instead of the str* prefix.")
(license license:unlicense))))
+
+(define-public qbe
+ (let ((commit "2caa26e388b1c904d2f12fb09f84df7e761d8331")
+ (revision "1"))
+ (package
+ (name "qbe")
+ (version (git-version "0.0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "git://c9x.me/qbe")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1gv03ym0gqrl4wkbhysa82025xwrkr1fg44z814b6vnggwlqgljc"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags
+ #~(list (string-append "CC=" #$(cc-for-target))
+ (string-append "PREFIX=" #$output)
+ ;; `GUIXTARGET` is used instead of `TARGET` to avoid changing
+ ;; the meaning of tools/test.sh (which uses `TARGET` too).
+ (string-append "GUIXTARGET=" #$(or (%current-target-system)
+ (%current-system))))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'allow-cross-compilation
+ (lambda _
+ (substitute* "Makefile"
+ (("`uname -m`") "$(GUIXTARGET)"))))
+ (add-after 'allow-cross-compilation 'use-gcc-for-tests
+ (lambda _
+ (substitute* "tools/test.sh"
+ (("cc=\"cc -no-pie\"")
+ (string-append "cc=\"${CC} -no-pie\"")))))
+ (delete 'configure))))
+ (supported-systems (list "x86_64-linux" "aarch64-linux" "riscv64-linux"))
+ (synopsis "Simple compiler backend")
+ (description "QBE is a small compiler backend using an SSA-based intermediate
+language as input.")
+ (home-page "https://c9x.me/compile/")
+ (license license:expat))))
--
2.36.0
L
L
Liliana Marie Prikler wrote on 24 May 2022 08:43
(address . control@debbugs.gnu.org)
8fdea3aaa79939d25f1fbe1a7b92b7f73ae20cc1.camel@ist.tugraz.at
merge 53833 55151 55605
merge 55187 55606
block 55187 by 53833
block 53834 by 53833
thanks
L
L
Liliana Marie Prikler wrote on 24 May 2022 08:50
2b0a34e61f45a706afb7e84a5cac9aae8a9e10aa.camel@ist.tugraz.at
Hi, this is mostly a reminder for myself to push this soon.

Am Sonntag, dem 08.05.2022 um 21:21 +0100 schrieb (unmatched-
parenthesis:
Toggle quote (3 lines)
> * gnu/packages/c.scm (qbe): New variable.
>
> Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
Don't add sign-off headers for your own patches, those are for
committers signing of other people's patches :)

Toggle quote (19 lines)
> [...]
> +    (arguments
> +     (list #:make-flags
> +           #~(list (string-append "CC=" #$(cc-for-target))
> +                   (string-append "PREFIX=" #$output)
> +                   ;; `GUIXTARGET` is used instead of `TARGET` to
> avoid changing
> +                   ;; the meaning of tools/test.sh (which uses
> `TARGET` too).
> +                   (string-append "GUIXTARGET=" #$(or (%current-
> target-system)
> +                                                      (%current-
> system))))
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (add-after 'unpack 'allow-cross-compilation
> +                 (lambda _
> +                   (substitute* "Makefile"
> +                     (("`uname -m`") "$(GUIXTARGET)"))))
Instead of going through the variable, why not inline it into the
substitute*?
Toggle quote (16 lines)
> +               (add-after 'allow-cross-compilation 'use-gcc-for-
> tests
> +                 (lambda _
> +                   (substitute* "tools/test.sh"
> +                     (("cc=\"cc -no-pie\"")
> +                      (string-append "cc=\"${CC} -no-pie\"")))))
> +               (delete 'configure))))
> +    (supported-systems (list "x86_64-linux" "aarch64-linux"
> "riscv64-linux"))
> +    (synopsis "Simple compiler backend")
> +    (description "QBE is a small compiler backend using an SSA-based
> intermediate
> +language as input.")
> +    (home-page "https://c9x.me/compile/")
> +    (license license:expat))))

Otherwise LGTM.

Cheers
L
L
Liliana Marie Prikler wrote on 24 May 2022 21:44
956d04d18e0dd7474550167906f0aadc09cac98d.camel@gmail.com
Am Dienstag, dem 24.05.2022 um 08:50 +0200 schrieb Liliana Marie
Prikler:
Toggle quote (49 lines)
> Hi, this is mostly a reminder for myself to push this soon.
>
> Am Sonntag, dem 08.05.2022 um 21:21 +0100 schrieb (unmatched-
> parenthesis:
> > * gnu/packages/c.scm (qbe): New variable.
> >
> > Signed-off-by: (unmatched-parenthesis <paren@disroot.org>
> Don't add sign-off headers for your own patches, those are for
> committers signing of other people's patches :)
>
> > [...]
> > +    (arguments
> > +     (list #:make-flags
> > +           #~(list (string-append "CC=" #$(cc-for-target))
> > +                   (string-append "PREFIX=" #$output)
> > +                   ;; `GUIXTARGET` is used instead of `TARGET` to
> > avoid changing
> > +                   ;; the meaning of tools/test.sh (which uses
> > `TARGET` too).
> > +                   (string-append "GUIXTARGET=" #$(or (%current-
> > target-system)
> > +                                                      (%current-
> > system))))
> > +           #:phases
> > +           #~(modify-phases %standard-phases
> > +               (add-after 'unpack 'allow-cross-compilation
> > +                 (lambda _
> > +                   (substitute* "Makefile"
> > +                     (("`uname -m`") "$(GUIXTARGET)"))))
> Instead of going through the variable, why not inline it into the
> substitute*?
> > +               (add-after 'allow-cross-compilation 'use-gcc-for-
> > tests
> > +                 (lambda _
> > +                   (substitute* "tools/test.sh"
> > +                     (("cc=\"cc -no-pie\"")
> > +                      (string-append "cc=\"${CC} -no-pie\"")))))
> > +               (delete 'configure))))
> > +    (supported-systems (list "x86_64-linux" "aarch64-linux"
> > "riscv64-linux"))
> > +    (synopsis "Simple compiler backend")
> > +    (description "QBE is a small compiler backend using an SSA-
> > based
> > intermediate
> > +language as input.")
> > +    (home-page "https://c9x.me/compile/")
> > +    (license license:expat))))
>
> Otherwise LGTM.
Applied with the above as well as my liberal interpretation of what
passes as `guix style'.

Cheers
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 53833@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 53833
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch