[PATCH 0/2] Fix transfig build errors.

DoneSubmitted by Ivan Vilata i Balaguer.
Details
2 participants
  • Ivan Vilata i Balaguer
  • Ludovic Courtès
Owner
unassigned
Severity
normal
I
I
Ivan Vilata i Balaguer wrote on 7 Mar 00:45 +0100
(address . guix-patches@gnu.org)
cover.1646609645.git.ivan@selidor.net
Hello! The following patches fix two build errors of the package `transfig`
caused by the upgrade to binutils 2.36 (namely bug
https://bugs.debian.org/981072) and to GCC 10+ with option `-f-no-common`
(similar to https://bugs.gentoo.org/706706, which I found when I fixed the
previous one). Thanks!

Ivan Vilata i Balaguer (2):
gnu: transfig: Avoid "ar" option incompatibility with binutils 2.36.
gnu: transfig: Fix "multiple definition" errors with GCC 10+.

.../patches/transfig-gcc10-fno-common.patch | 33 +++++++++++++++++++
gnu/packages/xfig.scm | 14 ++++++--
2 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/transfig-gcc10-fno-common.patch

--
2.34.0


--
Ivan Vilata i Balaguer -- https://elvil.net/
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEHpvwBPZcchIQr6TuPezBBfXdI4IFAmIlR3MACgkQPezBBfXd
I4JdphAApnxSMQRozeaWM2T/LUK5AJztW03kxD6gKMBWgZn9rIdVnKq2+nB5HK0p
BSDLnguq/gJPt1OYeSGDISAZf5H1kE7pkILleEudDFoG+6S3HlA6rhMihXfBpRzr
zeLn7piSdcih/5Jru+F6UPPEBhH6VCMdZP851QZZAuFSJ16WRApKP99Bv9qC5yR+
gt1jiRjphPaqUPGYZ8mY1zd8egEYuD6JaGpZO79xpg1vMxUe13m7c6hweB+D65f2
8ZJTrb6k2k7wi9w75zAfBJL7Ihx3hA6d6OIArGhduvP2UXLclk5xn0XusCgjrDqR
4hGerECWnNTmjW20S6RVI7mnsGHBAkAYSkqQt8Htp6yR7MsR4gY21eNsfQLhmyWP
IEpVUs3Zf97zaKSFkBvEStlkUxBVMfdtrm2yjo1QylnXg/ZdluT1pE6/QHmoshhq
XYV44K8vaFClpU6U2V98UsxPXM6k2o7oiMzTgPB08heq8ArAAKqmM540O+fd9BXv
Cp2dBCznmAWbpX8P5GoejzdqvrOC/vrD/GePSplphlEE+YXeSzhqpAFDh7S4t20K
bjRjk2TiyZ+U0XRsD+XgCXwuC1mC2ECeGAY03u+8R0aTGRz/I8i4MDRhq3pPalEH
rt+lSCRPd1VNJnIzeBMGDGB3/8yacm0QwHwC8uDlKZYCHWOwwX0=
=udmf
-----END PGP SIGNATURE-----


I
I
Ivan Vilata i Balaguer wrote on 7 Mar 00:47 +0100
[PATCH 1/2] gnu: transfig: Avoid "ar" option incompatibility with binutils 2.36.
(address . 54279@debbugs.gnu.org)
11edb35031250b639c3610578bb567e2792baf26.1646609645.git.ivan@selidor.net

* gnu/packages/xfig.scm (transfig)[arguments]<#:phases>: Remove "l" option
from "ar" invocation in makefiles to avoid incompatible meaning in binutils
2.36 causing error "ar: libdeps specified more than once".
---
gnu/packages/xfig.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm
index 9004c79e22..ad2f701ff1 100644
--- a/gnu/packages/xfig.scm
+++ b/gnu/packages/xfig.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2022 Ivan Vilata i Balaguer <ivan@selidor.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -123,6 +124,7 @@ (define-public transfig
                (invoke "xmkmf" "-a")
                (substitute* '("Makefile"
                               "fig2dev/Makefile"
+                              "fig2dev/dev/Makefile"
                               "transfig/Makefile")
                  ;; These imake variables somehow remain undefined
                  (("DefaultGcc2[[:graph:]]*Opt") "-O2")
@@ -131,7 +133,12 @@ (define-public transfig
                  (("(MANPATH = )[[:graph:]]*" _ front)
                   (string-append front out "/share/man"))
                  (("(CONFDIR = )([[:graph:]]*)" _ front default)
-                  (string-append front out default)))
+                  (string-append front out default))
+                 ;; The "l" option was silently ignored until binutils 2.36,
+                 ;; where it got a different purpose.  So remove it to avoid
+                 ;; "ar: libdeps specified more than once".
+                 (("((AR|MODAR) = ar )clq" _ front)
+                  (string-append front "cq")))
                #t)))
          (add-after 'install 'install/doc
            (lambda _
-- 
2.34.0


-- 
Ivan Vilata i Balaguer -- https://elvil.net/
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEHpvwBPZcchIQr6TuPezBBfXdI4IFAmIlR/gACgkQPezBBfXd
I4JuzQ/+Mmf7Hzu9sFP7DGWyZJ7ZuBENqGoxIj+rAbuozAyLg02fcw5dF2QE9l26
Ei3ZuTN9FiJeaeSfGIBOH8xSsRckO7HgoW1ahnf5iDy+ldQg1zmJJLDzYphoG3k0
NV0sQ/lztHexXUgMd3iHByY/U3NvppHIvjD9hwLPitvBqiVCVspikD0HyOzjDaou
6nN+bdMKVW1mknfiSBHOjFQx0yqwxTsvZ+A697QClr1q5zJA3N78bFVeRJD0IzKR
yhh8bpXL4+yvPXgUOWu/DutSq3XrBNAACVPLb1QzlbGmCGMaQ6wwYeW7L6Pu91cL
19kfU2/VfK67sS9mSuTpPtzXCQAbd+w2WhwKDFJBgthLlWS3qVocRBwaEgw9w9gq
71jjSpLb2oFDqBALUBfm5Rm5w+3hLqm2+kgZRuYNFzSZDrgMb+L1jRZmiwhn42R9
pFWkC31orWQVo9RVxrpPx1f5XCxPfMcwODC5yRqWgCR57fXHSrQ8fnFSD9h/XNnk
hsucpwcwbljqhgca0cGAk4+UTfiZvRkpeTIvChcMn84eGChBPZ1fUnh7HYaz8DTx
BUE/QEATZMjl3gMJwyXvc/j7rkuM4xe0oRWJPHjYStmfN7rJJBVQeFT9bhppkhhI
ERJUwOc00hBnPdw3Ic53ZK+r1vTKqxAoYo0Efl87dYUQbFwBjZQ=
=7bRD
-----END PGP SIGNATURE-----


I
I
Ivan Vilata i Balaguer wrote on 7 Mar 00:47 +0100
[PATCH 2/2] gnu: transfig: Fix "multiple definition" errors with GCC 10+.
(address . 54279@debbugs.gnu.org)
d6880b3972801acaa52702153f0761a27282c7cb.1646609645.git.ivan@selidor.net
* gnu/packages/patches/transfig-gcc10-fno-common.patch: New patch.
* gnu/packages/xfig.scm (transfig)[source]<origin>: Use patch
"transfig-gcc10-fno-common.patch" to avoid "multiple definition" errors with
GCC 10+ and "-f-no-common".
---
.../patches/transfig-gcc10-fno-common.patch | 33 +++++++++++++++++++
gnu/packages/xfig.scm | 5 ++-
2 files changed, 37 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/transfig-gcc10-fno-common.patch

Toggle diff (61 lines)
diff --git a/gnu/packages/patches/transfig-gcc10-fno-common.patch b/gnu/packages/patches/transfig-gcc10-fno-common.patch
new file mode 100644
index 0000000000..ebe9236533
--- /dev/null
+++ b/gnu/packages/patches/transfig-gcc10-fno-common.patch
@@ -0,0 +1,33 @@
+Fixes "multiple definition" errors when building with GCC 10+.
+
+Based on <https://bugs.gentoo.org/show_bug.cgi?id=706706>.
+--- a/fig2dev/dev/gensvg.c	2010-07-01 22:41:16.000000000 +0200
++++ b/fig2dev/dev/gensvg.c	2022-02-27 20:02:33.379945500 +0100
+@@ -230,10 +230,12 @@
+ };
+ 
+ /* arrowhead arrays */
+-Point   points[50], fillpoints[50], clippoints[50];
+-int     npoints, nfillpoints, nclippoints;
+-int     arrowx1, arrowy1;	/* first point of object */
+-int     arrowx2, arrowy2;	/* second point of object */
++Point   fillpoints[50];
++int     nfillpoints;
++extern Point   points[50], clippoints[50];
++extern int     npoints, nclippoints;
++extern int     arrowx1, arrowy1;	/* first point of object */
++extern int     arrowx2, arrowy2;	/* second point of object */
+ 
+ static int tileno=0; /* number of current tile */ 
+ 
+--- a/fig2dev/fig2dev.h	2010-03-16 19:53:20.000000000 +0100
++++ b/fig2dev/fig2dev.h	2022-02-27 19:56:06.072253991 +0100
+@@ -126,7 +126,7 @@
+ extern char	*prog, *from, *to;
+ extern char	*name;
+ extern double	font_size;
+-Boolean	correct_font_size;	/* use correct font size */
++extern Boolean	correct_font_size;	/* use correct font size */
+ extern double	mag, fontmag;
+ extern FILE	*tfp;
+ 
diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm
index ad2f701ff1..1d4d17527c 100644
--- a/gnu/packages/xfig.scm
+++ b/gnu/packages/xfig.scm
@@ -86,7 +86,10 @@ (define-public transfig
                            version ".tar.gz"))
        (sha256
         (base32
-         "0i3p7qmg2w8qrad3pn42b0miwarql7yy0gpd49b1bpal6bqsiicf"))))
+         "0i3p7qmg2w8qrad3pn42b0miwarql7yy0gpd49b1bpal6bqsiicf"))
+       (patches
+        (search-patches
+         "transfig-gcc10-fno-common.patch")))) ; fix GCC10 build
     (build-system gnu-build-system)
     (native-inputs
      (list imake makedepend))
-- 
2.34.0


-- 
Ivan Vilata i Balaguer -- https://elvil.net/
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEHpvwBPZcchIQr6TuPezBBfXdI4IFAmIlSBMACgkQPezBBfXd
I4LMag//T9fTPOB6WOcIRgK1L9zzvrsObY7uRsV/ghRTxdPiboC4wsJ3i2qnNE2O
qje1AY7D0Qc/ERLtAMo31+BKUeVO4kIgIsQWZj+xxBhMufjpPQnamPbYoNe+SPBL
FHxAMtyv8anSPwe2wPYXKmmxaBCc8/c7FAhhkS4XECcM9CgKXqE7kIl6s6fMO4Vj
uoF26hO4UNN+7YPnmfGaSOc1aNyOrNaAO6V6kLhiiolMSKOXgsMLPEyZdLS9vRjK
M/nPZM8cPDY57aJbIpkW5I7/yirKaTWlQksAmwy4O8XEhr+9BvGJLkuT3H5gjW7S
sxXrHd8E/NWeYOD8CBCUXnbQ6NFhsZK31xZ8pYREohGCx62yetM3yg/0yPA6snp9
DGAqLgKwGzNWYS8rLKgSG8vO9MZQ1FXQGC8H58LYPDa/M0ySmU0InItZu6k9NlY3
QTETwSrzXi37khVIPG9CnNdStEoULXjMppXzK9g8L4bIGdlJDmyG8Ba9oGE3Exu3
Rrin3QyOa1KyTydQ446cYbzPkuTzqgBcdOnSSL8/Sv08OABA7GiwSt2Ba0AK0/7C
/67nStwA4vA0lGzltCTujckFItiPucC7tAiXaTu0lCaj550FbLlXopDWL8vV7eMz
OQxU39GPnwqgx2cghtUqN2xOkncOaka84IBEF+85lD1gC9cTAhI=
=TNiw
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 11 Mar 23:09 +0100
Re: bug#54279: [PATCH 0/2] Fix transfig build errors.
(name . Ivan Vilata i Balaguer)(address . ivan@selidor.net)
87sfrow398.fsf@gnu.org
Bona nit!

Ivan Vilata i Balaguer <ivan@selidor.net> skribis:

Toggle quote (7 lines)
> Hello! The following patches fix two build errors of the package `transfig`
> caused by the upgrade to binutils 2.36 (namely bug
> <https://issues.guix.gnu.org/53425> (similar to
> <https://bugs.debian.org/981072>) and to GCC 10+ with option `-f-no-common`
> (similar to <https://bugs.gentoo.org/706706>, which I found when I fixed the
> previous one). Thanks!

I added the patch to ‘gnu/local.mk’ and applied both patches.

Thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

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