Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/strongswan/, net-vpn/strongswan/files/
Date: Wed, 26 Feb 2020 08:51:44
Message-Id: 1582707091.0ee270245a780c0bbf41e7d59d26fe7ae7fcc116.slyfox@gentoo
1 commit: 0ee270245a780c0bbf41e7d59d26fe7ae7fcc116
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 26 08:47:33 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 26 08:51:31 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ee27024
7
8 net-vpn/strongswan: tweak for gcc-10, bug #706408
9
10 Closes: https://bugs.gentoo.org/706408
11 Package-Manager: Portage-2.3.89, Repoman-2.3.20
12 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
13
14 .../strongswan/files/strongswan-5.8.2-gcc-10.patch | 45 ++++++++++++++++++++++
15 net-vpn/strongswan/strongswan-5.8.2.ebuild | 4 +-
16 2 files changed, 48 insertions(+), 1 deletion(-)
17
18 diff --git a/net-vpn/strongswan/files/strongswan-5.8.2-gcc-10.patch b/net-vpn/strongswan/files/strongswan-5.8.2-gcc-10.patch
19 new file mode 100644
20 index 00000000000..a7be11729c7
21 --- /dev/null
22 +++ b/net-vpn/strongswan/files/strongswan-5.8.2-gcc-10.patch
23 @@ -0,0 +1,45 @@
24 +https://bugs.gentoo.org/706408
25 +https://github.com/strongswan/strongswan/pull/163
26 +
27 +From a1f73a67aed56628c4655caa1ae50a6a2e4ec639 Mon Sep 17 00:00:00 2001
28 +From: Sergei Trofimovich <slyfox@g.o>
29 +Date: Sun, 26 Jan 2020 11:03:27 +0000
30 +Subject: [PATCH] swanctl: fix build failure against gcc-10
31 +MIME-Version: 1.0
32 +Content-Type: text/plain; charset=UTF-8
33 +Content-Transfer-Encoding: 8bit
34 +
35 +On gcc-10 (and gcc-9 -fno-common) build fails as:
36 +
37 +```
38 +libtool: link: gcc ... -o .libs/swanctl ...
39 +ld: commands/load_authorities.o:strongswan/src/swanctl/./swanctl.h:33:
40 + multiple definition of `swanctl_dir'; commands/load_all.o:strongswan/src/swanctl/./swanctl.h:33: first defined here
41 +```
42 +
43 +gcc-10 will change the default from -fcommon to fno-common:
44 +https://gcc.gnu.org/PR85678.
45 +
46 +The error also happens if CFLAGS=-fno-common passed explicitly.
47 +
48 +Reported-by: Toralf Förster
49 +Bug: https://bugs.gentoo.org/706408
50 +Signed-off-by: Sergei Trofimovich <slyfox@g.o>
51 +---
52 + src/swanctl/swanctl.h | 2 +-
53 + 1 file changed, 1 insertion(+), 1 deletion(-)
54 +
55 +--- a/src/swanctl/swanctl.h
56 ++++ b/src/swanctl/swanctl.h
57 +@@ -30,7 +30,7 @@
58 + /**
59 + * Base directory for credentials and config
60 + */
61 +-char *swanctl_dir;
62 ++extern char *swanctl_dir;
63 +
64 + /**
65 + * Configuration file for connections, etc.
66 +--
67 +2.25.0
68 +
69
70 diff --git a/net-vpn/strongswan/strongswan-5.8.2.ebuild b/net-vpn/strongswan/strongswan-5.8.2.ebuild
71 index 2ab3a0ed5d3..bfcd20769ca 100644
72 --- a/net-vpn/strongswan/strongswan-5.8.2.ebuild
73 +++ b/net-vpn/strongswan/strongswan-5.8.2.ebuild
74 @@ -1,4 +1,4 @@
75 -# Copyright 1999-2019 Gentoo Authors
76 +# Copyright 1999-2020 Gentoo Authors
77 # Distributed under the terms of the GNU General Public License v2
78
79 EAPI="7"
80 @@ -45,6 +45,8 @@ RDEPEND="${COMMON_DEPEND}
81 !net-vpn/libreswan
82 selinux? ( sec-policy/selinux-ipsec )"
83
84 +PATCHES=("${FILESDIR}"/${P}-gcc-10.patch)
85 +
86 UGID="ipsec"
87
88 pkg_setup() {