From patchwork Sun May 8 20:21:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "\\(" X-Patchwork-Id: 39162 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6963227BBEA; Sun, 8 May 2022 21:32:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ECE7327BBE9 for ; Sun, 8 May 2022 21:32:12 +0100 (BST) Received: from localhost ([::1]:38084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnnZc-0006Ov-4P for patchwork@mira.cbaines.net; Sun, 08 May 2022 16:32:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnnQk-0005g5-B7 for guix-patches@gnu.org; Sun, 08 May 2022 16:23:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnnQk-00022l-1c for guix-patches@gnu.org; Sun, 08 May 2022 16:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnnQj-0002iT-Td for guix-patches@gnu.org; Sun, 08 May 2022 16:23:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#53833] [PATCH v2] gnu: Add qbe. References: <20220207011332.27844-1-jgart@dismail.de> In-Reply-To: <20220207011332.27844-1-jgart@dismail.de> Resent-From: "(unmatched-parenthesis" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 May 2022 20:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53833 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53833@debbugs.gnu.org Cc: "\(unmatched-parenthesis" Received: via spool by 53833-submit@debbugs.gnu.org id=B53833.165204134510397 (code B ref 53833); Sun, 08 May 2022 20:23:01 +0000 Received: (at 53833) by debbugs.gnu.org; 8 May 2022 20:22:25 +0000 Received: from localhost ([127.0.0.1]:55313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnnQ3-0002hV-Is for submit@debbugs.gnu.org; Sun, 08 May 2022 16:22:25 -0400 Received: from knopi.disroot.org ([178.21.23.139]:46158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnnQ1-0002hM-7S for 53833@debbugs.gnu.org; Sun, 08 May 2022 16:22:18 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 97A1E435E9; Sun, 8 May 2022 22:22:15 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W9U_BMJuB_0X; Sun, 8 May 2022 22:22:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1652041333; bh=DRJOqEsD0A0uXEgGIucVwq9KSafRhsRAQIb3XPKzT4Y=; h=From:To:Cc:Subject:Date; b=AozXMSfiqGDSHOGM8+IK/qeaGQKBLQRutquP9PAOEQOleBKHnF44TEQ8q2DCj7Gql 54rqn1FNjgRB0oub/5wKGhAsQhPIX0CsUjvLQihqY2Hb5SxvVXGS7dywJ9Iiscy3Wm izYQaPaL6TvY+ag7yhLhKw7/cRE/CdA2B1eWICIcDjGZOszHzFCQzxPJ/BwtL6nyaS hbDR7uq2VqBgEhDTRP1WMBVwxHqRhtvxmWl7eGKhO4IyHZs9+saVQJULIJQfz+dkKZ FB/R5/j1UZrSWdL5dnTqoiSYpv41tdprRNj9kZ8rTsEnc5LKvcNWfnGjHoqoReUxqx KWufRH2bbF09A== Date: Sun, 8 May 2022 21:21:55 +0100 Message-Id: <20220508202154.9648-1-paren@disroot.org> Mime-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: "\(unmatched-parenthesis" X-ACL-Warn: , "\(unmatched-parenthesis via Guix-patches" X-Patchwork-Original-From: "\(unmatched-parenthesis via Guix-patches" via From: "\\(" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/c.scm (qbe): New variable. Signed-off-by: (unmatched-parenthesis --- 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(+) 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 ;;; Copyright © 2021 David Dashyan ;;; Copyright © 2021 Foo Chuan Wei +;;; Copyright © 2022 (unmatched parenthesis ;;; ;;; 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))))