* [PATCH] rte_dev: allow C-symbol-in-C++ dma operations
@ 2022-05-05 4:39 Tianhao Chai
2022-05-05 9:00 ` Bruce Richardson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Tianhao Chai @ 2022-05-05 4:39 UTC (permalink / raw)
To: dev; +Cc: Tianhao Chai
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
Currently the "extern C" section ends right before rte_dev_dma_unmap
and other DMA function declarations, causing some C++ compilers to
produce C++ mangled symbols to rte_dev_dma_unmap instead of C symbols.
This leads to build failures later when linking a final executable
against this object.
The issue is observed on DPDK 22.03 and G++ 11.
Signed-off-by: Tianhao Chai <cth451@gmail.com>
---
lib/eal/include/rte_dev.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h
index 448a41cb0e..e6ff1218f9 100644
--- a/lib/eal/include/rte_dev.h
+++ b/lib/eal/include/rte_dev.h
@@ -320,10 +320,6 @@ rte_dev_iterator_next(struct rte_dev_iterator *it);
dev != NULL; \
dev = rte_dev_iterator_next(it))
-#ifdef __cplusplus
-}
-#endif
-
/**
* @warning
* @b EXPERIMENTAL: this API may change without prior notice
@@ -496,4 +492,8 @@ int
rte_dev_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova,
size_t len);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_DEV_H_ */
--
2.35.1
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rte_dev: allow C-symbol-in-C++ dma operations
2022-05-05 4:39 [PATCH] rte_dev: allow C-symbol-in-C++ dma operations Tianhao Chai
@ 2022-05-05 9:00 ` Bruce Richardson
2022-05-05 9:53 ` David Marchand
2022-05-05 9:43 ` Tyler Retzlaff
2022-05-06 17:41 ` Morten Brørup
2 siblings, 1 reply; 5+ messages in thread
From: Bruce Richardson @ 2022-05-05 9:00 UTC (permalink / raw)
To: Tianhao Chai; +Cc: dev
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
On Wed, May 04, 2022 at 11:39:35PM -0500, Tianhao Chai wrote:
> Currently the "extern C" section ends right before rte_dev_dma_unmap
> and other DMA function declarations, causing some C++ compilers to
> produce C++ mangled symbols to rte_dev_dma_unmap instead of C symbols.
> This leads to build failures later when linking a final executable
> against this object.
>
> The issue is observed on DPDK 22.03 and G++ 11.
>
From the git history I think the first offending commit is a753e53.
Fixes: a753e53d517b ("eal: add device event monitor framework")
> Signed-off-by: Tianhao Chai <cth451@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> lib/eal/include/rte_dev.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h
> index 448a41cb0e..e6ff1218f9 100644
> --- a/lib/eal/include/rte_dev.h
> +++ b/lib/eal/include/rte_dev.h
> @@ -320,10 +320,6 @@ rte_dev_iterator_next(struct rte_dev_iterator *it);
> dev != NULL; \
> dev = rte_dev_iterator_next(it))
>
> -#ifdef __cplusplus
> -}
> -#endif
> -
> /**
> * @warning
> * @b EXPERIMENTAL: this API may change without prior notice
> @@ -496,4 +492,8 @@ int
> rte_dev_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova,
> size_t len);
>
> +#ifdef __cplusplus
> +}
> +#endif
> +
> #endif /* _RTE_DEV_H_ */
> --
> 2.35.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rte_dev: allow C-symbol-in-C++ dma operations
2022-05-05 9:00 ` Bruce Richardson
@ 2022-05-05 9:53 ` David Marchand
0 siblings, 0 replies; 5+ messages in thread
From: David Marchand @ 2022-05-05 9:53 UTC (permalink / raw)
To: Tianhao Chai; +Cc: Bruce Richardson, dev, Tyler Retzlaff
On Thu, May 5, 2022 at 11:00 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> On Wed, May 04, 2022 at 11:39:35PM -0500, Tianhao Chai wrote:
> > Currently the "extern C" section ends right before rte_dev_dma_unmap
> > and other DMA function declarations, causing some C++ compilers to
> > produce C++ mangled symbols to rte_dev_dma_unmap instead of C symbols.
> > This leads to build failures later when linking a final executable
> > against this object.
> >
> Fixes: a753e53d517b ("eal: add device event monitor framework")
Cc: stable@dpdk.org
>
> > Signed-off-by: Tianhao Chai <cth451@gmail.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rte_dev: allow C-symbol-in-C++ dma operations
2022-05-05 4:39 [PATCH] rte_dev: allow C-symbol-in-C++ dma operations Tianhao Chai
2022-05-05 9:00 ` Bruce Richardson
@ 2022-05-05 9:43 ` Tyler Retzlaff
2022-05-06 17:41 ` Morten Brørup
2 siblings, 0 replies; 5+ messages in thread
From: Tyler Retzlaff @ 2022-05-05 9:43 UTC (permalink / raw)
To: Tianhao Chai; +Cc: dev
On Wed, May 04, 2022 at 11:39:35PM -0500, Tianhao Chai wrote:
> Currently the "extern C" section ends right before rte_dev_dma_unmap
> and other DMA function declarations, causing some C++ compilers to
> produce C++ mangled symbols to rte_dev_dma_unmap instead of C symbols.
> This leads to build failures later when linking a final executable
> against this object.
>
> The issue is observed on DPDK 22.03 and G++ 11.
>
> Signed-off-by: Tianhao Chai <cth451@gmail.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] rte_dev: allow C-symbol-in-C++ dma operations
2022-05-05 4:39 [PATCH] rte_dev: allow C-symbol-in-C++ dma operations Tianhao Chai
2022-05-05 9:00 ` Bruce Richardson
2022-05-05 9:43 ` Tyler Retzlaff
@ 2022-05-06 17:41 ` Morten Brørup
2 siblings, 0 replies; 5+ messages in thread
From: Morten Brørup @ 2022-05-06 17:41 UTC (permalink / raw)
To: Tianhao Chai, dev
> From: Tianhao Chai [mailto:cth451@gmail.com]
> Sent: Thursday, 5 May 2022 06.40
> To: dev@dpdk.org
> Cc: Tianhao Chai
> Subject: [PATCH] rte_dev: allow C-symbol-in-C++ dma operations
>
> Currently the "extern C" section ends right before rte_dev_dma_unmap
> and other DMA function declarations, causing some C++ compilers to
> produce C++ mangled symbols to rte_dev_dma_unmap instead of C symbols.
> This leads to build failures later when linking a final executable
> against this object.
>
> The issue is observed on DPDK 22.03 and G++ 11.
>
> Signed-off-by: Tianhao Chai <cth451@gmail.com>
> ---
Acked-by: Morten Brørup <mb@smartsharesystems.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-06 17:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 4:39 [PATCH] rte_dev: allow C-symbol-in-C++ dma operations Tianhao Chai
2022-05-05 9:00 ` Bruce Richardson
2022-05-05 9:53 ` David Marchand
2022-05-05 9:43 ` Tyler Retzlaff
2022-05-06 17:41 ` Morten Brørup
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).