[dpdk-stable] patch 'eal: fix internal ABI tag with clang' has been queued to stable release 20.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 5 12:18:26 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/07/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/527f81e20ee738ac62e3268accb7841ba94db184

Thanks.

Luca Boccassi

---
>From 527f81e20ee738ac62e3268accb7841ba94db184 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Fri, 29 Jan 2021 16:48:16 +0000
Subject: [PATCH] eal: fix internal ABI tag with clang

[ upstream commit 4ab63cd60ceb343db43da8ed060e45e165393dae ]

Clang does not have an "error" attribute for functions, so for marking
internal functions we need to check for the error attribute, and provide
a fallback if it is not present. For clang, we can use "diagnose_if"
attribute, similarly checking for its presence before use.

Fixes: fba5af82adc8 ("eal: add internal ABI tag definition")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 lib/librte_eal/include/rte_compat.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/include/rte_compat.h b/lib/librte_eal/include/rte_compat.h
index 4cd8f68d68..2718612cce 100644
--- a/lib/librte_eal/include/rte_compat.h
+++ b/lib/librte_eal/include/rte_compat.h
@@ -19,12 +19,23 @@ __attribute__((section(".text.experimental")))
 
 #endif
 
-#ifndef ALLOW_INTERNAL_API
+#ifndef __has_attribute
+/* if no has_attribute assume no support for attribute too */
+#define __has_attribute(x) 0
+#endif
+
+#if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */
 
 #define __rte_internal \
 __attribute__((error("Symbol is not public ABI"), \
 section(".text.internal")))
 
+#elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */
+
+#define __rte_internal \
+__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
+section(".text.internal")))
+
 #else
 
 #define __rte_internal \
-- 
2.29.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-05 11:18:38.890084853 +0000
+++ 0220-eal-fix-internal-ABI-tag-with-clang.patch	2021-02-05 11:18:29.174698119 +0000
@@ -1 +1 @@
-From 4ab63cd60ceb343db43da8ed060e45e165393dae Mon Sep 17 00:00:00 2001
+From 527f81e20ee738ac62e3268accb7841ba94db184 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4ab63cd60ceb343db43da8ed060e45e165393dae ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list