summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-02-10 08:37:37 +0000
committerMike Frysinger <vapier@gentoo.org>2013-02-10 08:37:37 +0000
commit8db74902ab457905b113d0b2b05257a3abd0f18d (patch)
tree12584a32e8f9b782f2f59a302492a2af2b8d03b5 /sys-apps/iproute2
parentCleanup masked package (diff)
downloadhistorical-8db74902ab457905b113d0b2b05257a3abd0f18d.tar.gz
historical-8db74902ab457905b113d0b2b05257a3abd0f18d.tar.bz2
historical-8db74902ab457905b113d0b2b05257a3abd0f18d.zip
Add fix from upstream for building w/clang.
Diffstat (limited to 'sys-apps/iproute2')
-rw-r--r--sys-apps/iproute2/ChangeLog6
-rw-r--r--sys-apps/iproute2/files/iproute2-3.7.0-clang.patch72
-rw-r--r--sys-apps/iproute2/iproute2-3.7.0.ebuild3
3 files changed, 79 insertions, 2 deletions
diff --git a/sys-apps/iproute2/ChangeLog b/sys-apps/iproute2/ChangeLog
index ea1da72ec040..ac1864ee8a5b 100644
--- a/sys-apps/iproute2/ChangeLog
+++ b/sys-apps/iproute2/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-apps/iproute2
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/ChangeLog,v 1.206 2013/01/11 16:50:21 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/ChangeLog,v 1.207 2013/02/10 08:37:37 vapier Exp $
+
+ 10 Feb 2013; Mike Frysinger <vapier@gentoo.org> iproute2-3.7.0.ebuild,
+ +files/iproute2-3.7.0-clang.patch:
+ Add fix from upstream for building w/clang.
11 Jan 2013; Mike Frysinger <vapier@gentoo.org>
+files/iproute2-3.7.0-man7.patch, iproute2-3.7.0.ebuild:
diff --git a/sys-apps/iproute2/files/iproute2-3.7.0-clang.patch b/sys-apps/iproute2/files/iproute2-3.7.0-clang.patch
new file mode 100644
index 000000000000..17bb6ac856b3
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.7.0-clang.patch
@@ -0,0 +1,72 @@
+From 048bff6e0206bca33ee70516521f3048e7714752 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 17 Jan 2013 18:00:50 +0000
+Subject: [PATCH] ipxfrm: use alloca to allocate stack space
+
+Clang doesn't support the gcc extension for embeddeding flexible arrays
+inside of structures. Use the slightly more portable alloca().
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ ip/ipxfrm.c | 27 +++++++++++----------------
+ 1 file changed, 11 insertions(+), 16 deletions(-)
+
+diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
+index c7b3420..dda4a7a 100644
+--- a/ip/ipxfrm.c
++++ b/ip/ipxfrm.c
+@@ -25,6 +25,7 @@
+ * Masahide NAKAMURA @USAGI
+ */
+
++#include <alloca.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -555,16 +556,13 @@ static inline void xfrm_algo_print(struct xfrm_algo *algo, int type, int len,
+ static void xfrm_aead_print(struct xfrm_algo_aead *algo, int len,
+ FILE *fp, const char *prefix)
+ {
+- struct {
+- struct xfrm_algo algo;
+- char key[algo->alg_key_len / 8];
+- } base;
++ struct xfrm_algo *base_algo = alloca(sizeof(*base_algo) + algo->alg_key_len / 8);
+
+- memcpy(base.algo.alg_name, algo->alg_name, sizeof(base.algo.alg_name));
+- base.algo.alg_key_len = algo->alg_key_len;
+- memcpy(base.algo.alg_key, algo->alg_key, algo->alg_key_len / 8);
++ memcpy(base_algo->alg_name, algo->alg_name, sizeof(base_algo->alg_name));
++ base_algo->alg_key_len = algo->alg_key_len;
++ memcpy(base_algo->alg_key, algo->alg_key, algo->alg_key_len / 8);
+
+- __xfrm_algo_print(&base.algo, XFRMA_ALG_AEAD, len, fp, prefix, 0);
++ __xfrm_algo_print(base_algo, XFRMA_ALG_AEAD, len, fp, prefix, 0);
+
+ fprintf(fp, " %d", algo->alg_icv_len);
+
+@@ -574,16 +572,13 @@ static void xfrm_aead_print(struct xfrm_algo_aead *algo, int len,
+ static void xfrm_auth_trunc_print(struct xfrm_algo_auth *algo, int len,
+ FILE *fp, const char *prefix)
+ {
+- struct {
+- struct xfrm_algo algo;
+- char key[algo->alg_key_len / 8];
+- } base;
++ struct xfrm_algo *base_algo = alloca(sizeof(*base_algo) + algo->alg_key_len / 8);
+
+- memcpy(base.algo.alg_name, algo->alg_name, sizeof(base.algo.alg_name));
+- base.algo.alg_key_len = algo->alg_key_len;
+- memcpy(base.algo.alg_key, algo->alg_key, algo->alg_key_len / 8);
++ memcpy(base_algo->alg_name, algo->alg_name, sizeof(base_algo->alg_name));
++ base_algo->alg_key_len = algo->alg_key_len;
++ memcpy(base_algo->alg_key, algo->alg_key, algo->alg_key_len / 8);
+
+- __xfrm_algo_print(&base.algo, XFRMA_ALG_AUTH_TRUNC, len, fp, prefix, 0);
++ __xfrm_algo_print(base_algo, XFRMA_ALG_AUTH_TRUNC, len, fp, prefix, 0);
+
+ fprintf(fp, " %d", algo->alg_trunc_len);
+
+--
+1.8.0.2
+
diff --git a/sys-apps/iproute2/iproute2-3.7.0.ebuild b/sys-apps/iproute2/iproute2-3.7.0.ebuild
index ff4a22492e4d..40597b84d971 100644
--- a/sys-apps/iproute2/iproute2-3.7.0.ebuild
+++ b/sys-apps/iproute2/iproute2-3.7.0.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-3.7.0.ebuild,v 1.3 2013/01/11 16:50:21 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-3.7.0.ebuild,v 1.4 2013/02/10 08:37:37 vapier Exp $
EAPI="4"
@@ -38,6 +38,7 @@ DEPEND="${RDEPEND}
src_prepare() {
epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
epatch "${FILESDIR}"/${PN}-3.7.0-man7.patch #451166
+ epatch "${FILESDIR}"/${PN}-3.7.0-clang.patch
use ipv6 || epatch "${FILESDIR}"/${PN}-3.1.0-no-ipv6.patch #326849
sed -i \