From patchwork Sat May 7 17:11:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\\(" X-Patchwork-Id: 39150 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 890B927BBEA; Sat, 7 May 2022 18:12:12 +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, URIBL_BLOCKED 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 5010027BBE9 for ; Sat, 7 May 2022 18:12:12 +0100 (BST) Received: from localhost ([::1]:49632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnNyV-0007T4-Gh for patchwork@mira.cbaines.net; Sat, 07 May 2022 13:12:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnNyN-0007Ss-O8 for guix-patches@gnu.org; Sat, 07 May 2022 13:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59009) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnNyN-0003X6-Fb for guix-patches@gnu.org; Sat, 07 May 2022 13:12:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnNyM-0003uM-Aw for guix-patches@gnu.org; Sat, 07 May 2022 13:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#53833] [PATCH] gnu: patches: Add qbe-makefile-add-target.patch. 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: Sat, 07 May 2022 17:12:02 +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.165194348114976 (code B ref 53833); Sat, 07 May 2022 17:12:02 +0000 Received: (at 53833) by debbugs.gnu.org; 7 May 2022 17:11:21 +0000 Received: from localhost ([127.0.0.1]:52906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnNxV-0003tF-Vw for submit@debbugs.gnu.org; Sat, 07 May 2022 13:11:21 -0400 Received: from knopi.disroot.org ([178.21.23.139]:52514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnNxT-0003t7-Tn for 53833@debbugs.gnu.org; Sat, 07 May 2022 13:11:08 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3575E43674; Sat, 7 May 2022 19:11:07 +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 269xLshh58-a; Sat, 7 May 2022 19:11:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1651943465; bh=HcWcCdJbIeSYlrKAuKsOW0Jvr8iEMJSMZ8JgJ9PV+vs=; h=From:To:Cc:Subject:Date; b=hO746lQJUnk61t/wx1qAHFch8/ydxZMsMyfOeJoHfTTeCta/QAoNXLUJkUFDDF3sk LSMJVNZn2NSz2m6JENXz72T0j1fonrp9Y1l24VYKUyvpPBAJ9k2+haVsZ+UMSUhLue bcEI8/RVZyer5sDTO6LBkthF3ha4afBPsWeAVl9lfu7aUpHDbt3RGS+S39YtmabF0H +vaYrI9odnA8ooi5ipQ1NnvvTqwAdvLAEPWK6CADWE9h1KM3XYNT8LsRDNe5OVqEBB 1nN5f6fs834AeItV349KugMXUVc1h7wanzUC5+4DxawVgs3hIUu0Ygx20tm+rBQ5AO SqL187KZ/iEHg== Date: Sat, 7 May 2022 18:11:04 +0100 Message-Id: <20220507171104.13861-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/patches/qbe-makefile-add-target.patch: New variable. Signed-off-by: (unmatched-parenthesis --- .../patches/qbe-makefile-add-target.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 gnu/packages/patches/qbe-makefile-add-target.patch 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/"