GNU bug report logs - #60760
[PATCH core-updates] gnu: bc: Fix cross-compilation.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Maxim Cournoyer <maxim.cournoyer@HIDDEN>; Keywords: patch; Done: Maxim Cournoyer <maxim.cournoyer@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.
bug closed, send any further explanations to 60760 <at> debbugs.gnu.org and Maxim Cournoyer <maxim.cournoyer@HIDDEN> Request was from Maxim Cournoyer <maxim.cournoyer@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Jan 2023 21:42:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jan 12 16:42:32 2023
Received: from localhost ([127.0.0.1]:48709 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pG5LD-0003JI-SJ
	for submit <at> 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 <maxim.cournoyer@HIDDEN>) id 1pG5LB-0003JA-P3
 for submit <at> 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 <maxim.cournoyer@HIDDEN>)
 id 1pG5LB-0005k4-IJ
 for guix-patches@HIDDEN; 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 <maxim.cournoyer@HIDDEN>)
 id 1pG5L9-0007Vp-HI
 for guix-patches@HIDDEN; Thu, 12 Jan 2023 16:42:29 -0500
Received: by mail-qv1-xf36.google.com with SMTP id m12so11515462qvt.9
 for <guix-patches@HIDDEN>; 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 <maxim.cournoyer@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH core-updates] gnu: bc: Fix cross-compilation.
Date: Thu, 12 Jan 2023 16:42:15 -0500
Message-Id: <20230112214215.30757-1-maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.38.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::f36;
 envelope-from=maxim.cournoyer@HIDDEN; 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-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Andreas Enge <andreas@HIDDEN>, Efraim Flashner <efraim@HIDDEN>,
 Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Eric Bavier <bavier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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(-)

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 <ben@HIDDEN>
-Date:   Tue Oct 17 10:51:34 2017 -0400
-
-    Try implementing cross-compilation
+Patch adapted from Nix.
+Upstream-status: Submitted to bug-bc@HIDDEN
 
 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 </dev/null >libmath.h
+-	./fbc -c $(srcdir)/libmath.b </dev/null >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 $@ $+

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
-- 
2.38.1





Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#60760; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 7 Feb 2023 20:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.