1 |
commit: 863c825a497d3614d35a73cb2c4c1de95a709ca4 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 28 17:00:37 2020 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 28 17:00:56 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=863c825a |
7 |
|
8 |
net-ftp/tftp-hpa: fix build with gcc-10 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/705834 |
11 |
Package-Manager: Portage-2.3.85_p2, Repoman-2.3.20_p36 |
12 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
13 |
|
14 |
net-ftp/tftp-hpa/files/tftp-hpa-5.2-gcc-10.patch | 42 ++++++++++++++++++++++++ |
15 |
net-ftp/tftp-hpa/tftp-hpa-5.2-r1.ebuild | 4 ++- |
16 |
2 files changed, 45 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/net-ftp/tftp-hpa/files/tftp-hpa-5.2-gcc-10.patch b/net-ftp/tftp-hpa/files/tftp-hpa-5.2-gcc-10.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..ff2488d5dfb |
21 |
--- /dev/null |
22 |
+++ b/net-ftp/tftp-hpa/files/tftp-hpa-5.2-gcc-10.patch |
23 |
@@ -0,0 +1,42 @@ |
24 |
+From 7afd5aa65fdabaa4583f6e1a84936eb9bdd33c65 Mon Sep 17 00:00:00 2001 |
25 |
+From: Sergei Trofimovich <slyfox@g.o> |
26 |
+Date: Tue, 21 Jan 2020 23:10:46 +0000 |
27 |
+Subject: [PATCH] tftp-hpa: fix build failure against gcc-10 |
28 |
+ |
29 |
+On gcc-10 (and gcc-9 -fno-common) build fails as: |
30 |
+ |
31 |
+``` |
32 |
+x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu tftp.o main.o ../common/libcommon.a -lreadline -liberty -o tftp |
33 |
+ld: main.o:(.bss+0x40): |
34 |
+ multiple definition of `toplevel'; tftp.o:(.bss+0x100): first defined here |
35 |
+collect2: error: ld returned 1 exit status |
36 |
+make[1]: *** [Makefile:12: tftp] Error 1 |
37 |
+``` |
38 |
+ |
39 |
+gcc-10 will change the default from -fcommon to fno-common: |
40 |
+https://gcc.gnu.org/PR85678. |
41 |
+ |
42 |
+The error also happens if CFLAGS=-fno-common passed explicitly. |
43 |
+ |
44 |
+Bug: https://bugs.gentoo.org/705834 |
45 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
46 |
+--- |
47 |
+ tftp/tftp.c | 2 +- |
48 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
49 |
+ |
50 |
+diff --git a/tftp/tftp.c b/tftp/tftp.c |
51 |
+index d15da22..d067f96 100644 |
52 |
+--- a/tftp/tftp.c |
53 |
++++ b/tftp/tftp.c |
54 |
+@@ -48,7 +48,7 @@ extern int maxtimeout; |
55 |
+ #define PKTSIZE SEGSIZE+4 |
56 |
+ char ackbuf[PKTSIZE]; |
57 |
+ int timeout; |
58 |
+-sigjmp_buf toplevel; |
59 |
++extern sigjmp_buf toplevel; |
60 |
+ sigjmp_buf timeoutbuf; |
61 |
+ |
62 |
+ static void nak(int, const char *); |
63 |
+-- |
64 |
+2.25.0 |
65 |
+ |
66 |
|
67 |
diff --git a/net-ftp/tftp-hpa/tftp-hpa-5.2-r1.ebuild b/net-ftp/tftp-hpa/tftp-hpa-5.2-r1.ebuild |
68 |
index cafb4a38548..78723b2d830 100644 |
69 |
--- a/net-ftp/tftp-hpa/tftp-hpa-5.2-r1.ebuild |
70 |
+++ b/net-ftp/tftp-hpa/tftp-hpa-5.2-r1.ebuild |
71 |
@@ -1,4 +1,4 @@ |
72 |
-# Copyright 1999-2015 Gentoo Foundation |
73 |
+# Copyright 1999-2020 Gentoo Authors |
74 |
# Distributed under the terms of the GNU General Public License v2 |
75 |
|
76 |
EAPI="5" |
77 |
@@ -24,7 +24,9 @@ DEPEND="${CDEPEND} |
78 |
RDEPEND="${CDEPEND} |
79 |
selinux? ( sec-policy/selinux-tftp ) |
80 |
" |
81 |
+ |
82 |
src_prepare() { |
83 |
+ epatch "${FILESDIR}"/tftp-hpa-5.2-gcc-10.patch |
84 |
epatch_user |
85 |
|
86 |
sed -i "/^AR/s:ar:$(tc-getAR):" MCONFIG.in || die |