From patchwork Thu Jan 12 21:42:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 46075 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 C5B3127BBED; Thu, 12 Jan 2023 21:43:25 +0000 (GMT) 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 4447F27BBEB for ; Thu, 12 Jan 2023 21:43:23 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pG5Lk-0005yX-3W; Thu, 12 Jan 2023 16:43:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pG5Li-0005yB-9T for guix-patches@gnu.org; Thu, 12 Jan 2023 16:43:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pG5Lh-0007Yl-VM for guix-patches@gnu.org; Thu, 12 Jan 2023 16:43:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pG5Lh-0003KI-Qx for guix-patches@gnu.org; Thu, 12 Jan 2023 16:43:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60760] [PATCH core-updates] gnu: bc: Fix cross-compilation. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Jan 2023 21:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60760 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60760@debbugs.gnu.org Cc: Andreas Enge , Efraim Flashner , Maxim Cournoyer , Eric Bavier X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167355975212733 (code B ref -1); Thu, 12 Jan 2023 21:43:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jan 2023 21:42:32 +0000 Received: from localhost ([127.0.0.1]:48709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pG5LD-0003JI-SJ for submit@debbugs.gnu.org; Thu, 12 Jan 2023 16:42:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:59006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pG5LB-0003JA-P3 for submit@debbugs.gnu.org; Thu, 12 Jan 2023 16:42:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pG5LB-0005k4-IJ for guix-patches@gnu.org; Thu, 12 Jan 2023 16:42:29 -0500 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pG5L9-0007Vp-HI for guix-patches@gnu.org; Thu, 12 Jan 2023 16:42:29 -0500 Received: by mail-qv1-xf36.google.com with SMTP id m12so11515462qvt.9 for ; Thu, 12 Jan 2023 13:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jhJjB4IoodVYHeV2gyiWxtptyrp37YlSuN44fK5c68I=; b=LsIJ6jQF8pWlCh5o74qf6WvWVRTGKcHeF8kN8F4fmsMTjrgUIFTA6ksPYfo/sA6DAC qRWXSk96CxKvoT0A5qOjkvz5TYAb4ibhzmK4rDADYFNwg/j2iHokxMG1LHPqR18yBO2x U2PFagzn1bmCn9OgAa50ygiW59H0dlrnxlJ6EBkEpQRwR/zCIqiWrdz0AK7sWOKOdDio onz2TxvfWXwz0NZAK8D/aaliEb1Dsfi7AOGbbttYhaevhuAg9yOpOHyB5RPUgvF9EjD2 uE/oni1+faIsjgzD4nkCzZ6LpUsJfJzjtpeugkTHCG+uT2mNxaKLtruwgmakTHa5napc DMew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jhJjB4IoodVYHeV2gyiWxtptyrp37YlSuN44fK5c68I=; b=GV11Uj/0b2y4sgLAqZyVFRBx2GnOd3jXuVFHtClhy/fly3HJG/j0f5jVehqJnyH+nO ZKmwHQKd263Sy6cefTJtkjPm7xpJokh2XkOFhlcgZD08i0ClY3twCy491mzK48bFw7Zk lH85deMb33aIjGY32YKf6Yw792Fixe3LtG8ObMu8IcsSI55mU9be5c7fSzS2RpqIrsJe yQ2uAZ4dEL4/pnKUd3h7826i3xuabotVrYIpILGl7xyqy7zePjis7ox39nlYmy0wCpqp 7HKnd8OOq2QNtUj1mbSEHc59Hk1Uk8ywHWEjEPurdRA3tYHK8n7unSk+9w2paL+UjE3C TCQA== X-Gm-Message-State: AFqh2koKnG/qhEljlhmsW8BwFWgeyTB1uoi0mM13b+BG4UepBJiqrCt/ O4FXDbZiqavS1OjEtveeYu2CWM6lxXfxod0i X-Google-Smtp-Source: AMrXdXtUGg7KnuHb1oBXM+00KRg2Uw1pUlLE9kLAi4w4AW8w7xrw/1HBNDOSUSIpYZGR7x+VNhKgqQ== X-Received: by 2002:a0c:b41e:0:b0:532:3b1b:12f5 with SMTP id u30-20020a0cb41e000000b005323b1b12f5mr18410491qve.38.1673559746338; Thu, 12 Jan 2023 13:42:26 -0800 (PST) Received: from localhost.localdomain (dsl-159-79.b2b2c.ca. [66.158.159.79]) by smtp.gmail.com with ESMTPSA id j9-20020a05620a288900b006f9f714cb6asm11260040qkp.50.2023.01.12.13.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 13:42:25 -0800 (PST) From: Maxim Cournoyer Date: Thu, 12 Jan 2023 16:42:15 -0500 Message-Id: <20230112214215.30757-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f36; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches The existing cross-compilation patch no longer worked. It's been reworked and submitted to upstream. * gnu/packages/algebra.scm (bc) [native-inputs]: Add readline. * gnu/packages/patches/bc-fix-cross-compilation.patch: Refresh patch. --- gnu/packages/algebra.scm | 2 +- .../patches/bc-fix-cross-compilation.patch | 74 ++++++++++++------- 2 files changed, 47 insertions(+), 29 deletions(-) base-commit: 5e4ec8218142eee8e6e148e787381a5ef891c5b1 prerequisite-patch-id: 37b3abaa163d6eafa0403451a4cdc34e9026a688 prerequisite-patch-id: 776778c03bce9b7ad3ab94a120f42b764c00fcae prerequisite-patch-id: c45d0aa817c9c4fb9e1ed94cb9effda5ce590c23 prerequisite-patch-id: da44eec28b968e671b2a73432f1a0f9449edfe68 prerequisite-patch-id: ac08f345033c78bf44c856f1f246b52e7e1ab3b2 prerequisite-patch-id: 0f75348f4b5d2c1db3563398018909685c2f169f prerequisite-patch-id: 31583c7e1b1a1a49ca5084658d267512087fc9a5 prerequisite-patch-id: c9e90155c5f5c753533f6625d338725e71f8c048 prerequisite-patch-id: 185df995edeef5c8448682ac8abc6fbd42f90391 prerequisite-patch-id: 779f92f61bd7ee1d6a84106fa8e86dac4e660ec3 prerequisite-patch-id: 3b4c9f362251c0db6439bb6d63fc6d72564c0197 prerequisite-patch-id: cd60018a3d79ec2ac2c92f8554194a239decf33b prerequisite-patch-id: 254ad01da5894d525bf859ca1b65f3ac6ca7e446 diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 3ceef8ecd2..89e17cd73f 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -683,7 +683,7 @@ (define-public bc (patches (search-patches "bc-fix-cross-compilation.patch")))) (build-system gnu-build-system) (native-inputs - (list automake autoconf ed flex texinfo)) + (list automake autoconf ed flex readline texinfo)) (inputs (list readline)) (arguments diff --git a/gnu/packages/patches/bc-fix-cross-compilation.patch b/gnu/packages/patches/bc-fix-cross-compilation.patch index 14dfecdbde..04f2c92abf 100644 --- a/gnu/packages/patches/bc-fix-cross-compilation.patch +++ b/gnu/packages/patches/bc-fix-cross-compilation.patch @@ -1,15 +1,19 @@ -Patch taken from nix. - -commit fdda59736ddc048cf38a2c7103f4f5d9eeaf995e -Author: Ben Gamari -Date: Tue Oct 17 10:51:34 2017 -0400 - - Try implementing cross-compilation +Patch adapted from Nix. +Upstream-status: Submitted to bug-bc@gnu.org. diff --git a/bc/Makefile.am b/bc/Makefile.am -index d9d412e..fdef633 100644 +index d9d412e..13f2b1e 100644 --- a/bc/Makefile.am +++ b/bc/Makefile.am +@@ -8,7 +8,7 @@ EXTRA_DIST = bc.h bcdefs.h const.h fix-libmath_h global.h libmath.b proto.h \ + sbc.y + noinst_HEADERS = libmath.h + +-DISTCLEANFILES = sbc sbc.c sbc.h libmath.h ++DISTCLEANFILES = fbc sbc sbc.c sbc.h libmath.h + + MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \ + bc.y bcdefs.h const.h execute.c fix-libmath_h \ @@ -17,6 +17,7 @@ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \ AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../h @@ -18,31 +22,36 @@ index d9d412e..fdef633 100644 LIBL = @LEXLIB@ LDADD = $(LIBBC) $(LIBL) @READLINELIB@ -@@ -29,12 +30,20 @@ $(PROGRAMS): libmath.h $(LIBBC) +@@ -29,15 +30,22 @@ $(PROGRAMS): libmath.h $(LIBBC) scan.o: bc.h global.o: libmath.h -+ -+main_host.c : main.c -+ cp $< $@ -fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o -+fbcOBJ = $(addsuffix _host,main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o) -+ -+%.o_host : CC:=$(CC_FOR_BUILD) -+ -+%.o_host : %.c -+ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $< ++%.o_host: CC := $(CC_FOR_BUILD) ++%.o_host: %.c ++ $(COMPILE) -c -o $@ $< -libmath.h: libmath.b $(fbcOBJ) $(LIBBC) -+libmath.h: libmath.b $(fbcOBJ) $(LIBBC_HOST) - echo '{0}' > libmath.h +- echo '{0}' > libmath.h - $(MAKE) global.o - $(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS) -+ $(MAKE) global.o_host -+ $(CC_FOR_BUILD) -o fbc $(fbcOBJ) global.o_host $(LIBBC_HOST) $(LIBL) ${READLINELIB} $(LIBS) - ./fbc -c $(srcdir)/libmath.b libmath.h +- ./fbc -c $(srcdir)/libmath.b libmath.h ++fbcOBJ = $(addsuffix _host,\ ++ main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o) ++ ++global_host.c: global.c ++ sed 's/#include "libmath.h"/{0}/' $< > $@ ++ ++fbc: $(fbcOBJ) global_host.o_host $(LIBBC_HOST) $(LIBS) ++ $(CC_FOR_BUILD) $(LIBL) $(READLINELIB) -o $@ $^ ++ ++libmath.h: libmath.b fbc $(LIBBC_HOST) ++ ./fbc -c $(srcdir)/libmath.b < /dev/null > libmath.h $(srcdir)/fix-libmath_h - rm -f ./fbc ./global.o +- rm -f ./fbc ./global.o + + sbcOBJ = main.o sbc.o scan.o execute.o global.o load.o storage.o util.o \ + warranty.o diff --git a/configure.ac b/configure.ac index fc74573..5cabb73 100644 --- a/configure.ac @@ -64,7 +73,7 @@ index fc74573..5cabb73 100644 AM_PROG_LEX diff --git a/lib/Makefile.am b/lib/Makefile.am -index ec4bf59..c670f5b 100644 +index ec4bf59..24c9f42 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,5 +1,5 @@ @@ -74,14 +83,23 @@ index ec4bf59..c670f5b 100644 AM_CPPFLAGS = -I. -I.. -I$(srcdir)/../h -@@ -24,3 +24,11 @@ testmul: testmul.o number.o +@@ -7,8 +7,6 @@ libbc_a_SOURCES = getopt.c getopt1.c vfprintf.c number.c + + DEFS = @DEFS@ $(DEFSADD) + +-AM_CFLAGS = @CFLAGS@ +- + MAINTAINERCLEANFILES = Makefile.in number.c + CLEANFILES = testmul specialnumber muldigits.h + +@@ -24,3 +22,11 @@ testmul: testmul.o number.o specialnumber: newnumber.o cp newnumber.o number.o + -+%.o_host : CC:=$(CC_FOR_BUILD) ++%.o_host: CC := $(CC_FOR_BUILD) +%.o_host : %.c -+ $(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $< ++ $(COMPILE) -c -o $@ $< + +libbc_host.a : $(addsuffix _host,$(libbc_a_OBJECTS)) + ar cru $@ $+