Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate strlcpy definitions on ubuntu 18.04.2 #72

Open
openhacker opened this issue Jul 28, 2019 · 2 comments
Open

duplicate strlcpy definitions on ubuntu 18.04.2 #72

openhacker opened this issue Jul 28, 2019 · 2 comments

Comments

@openhacker
Copy link

When building on ubuntu (after I found all the dependencies, it would be nice to have a configure stage) I get (I'm using 4.20.11-042011-generic)
gcc -Wp,-MD,./.main.o.d.tmp -m64 -pthread -fPIC -march=corei7 -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -I/home/leisner/github/glb-director/src/glb-director/build/include -I/usr/share/dpdk/x86_64-default-linuxapp-gcc/include -include /usr/share/dpdk/x86_64-default-linuxapp-gcc/include/rte_config.h -O3 -g -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wimplicit-fallthrough=2 -Wno-format-truncation -Werror -pie -fPIE -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -fstack-protector-strong -DSTATSD -o main.o -c /home/leisner/github/glb-director/src/glb-director/main.c
In file included from /home/leisner/github/glb-director/src/glb-director/main.c:79:0:
/usr/share/dpdk/x86_64-default-linuxapp-gcc/include/rte_string_fns.h:103:33: error: redefinition of ‘rte_strlcpy’
#define strlcpy(dst, src, size) rte_strlcpy(dst, src, size)
^
/home/leisner/github/glb-director/src/glb-director/strlcpy.h:25:1: note: in expansion of macro ‘strlcpy’
strlcpy(char * __restrict dst, const char * __restrict src, size_t siz)
^~~~~~~
/usr/share/dpdk/x86_64-default-linuxapp-gcc/include/rte_string_fns.h:85:1: note: previous definition of ‘rte_strlcpy’ was here
rte_strlcpy(char *dst, const char *src, size_t size)
^~~~~~~~~~~
/usr/share/dpdk/mk/internal/rte.compile-pre.mk:138: recipe for target 'main.o' failed
make[2]: *** [main.o] Error 1
/usr/share/dpdk/mk/rte.extapp.mk:42: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/leisner/github/glb-director/src/glb-director'
Makefile:2: recipe for target 'mkdeb' failed
make: *** [mkdeb] Error 2

I modified rte_string_fns.h (for now) to get past this problem.

@ravisinghsfbay
Copy link
Contributor

Hi
Rant into the same issue on Ubuntu 18.04.2.

I think that the fix for this should be the following:

diff --git a/src/glb-director/util.h b/src/glb-director/util.h
index 288b880..b4e0dbe 100644
--- a/src/glb-director/util.h
+++ b/src/glb-director/util.h
@@ -33,7 +33,22 @@

#include <rte_branch_prediction.h>
#include <rte_mbuf.h>
+
+#ifdef RTE_EXEC_ENV_BSDAPP
+
+#ifdef __BSD_VISIBLE
#include "strlcpy.h"
+#endif
+
+#else
+
+#ifdef RTE_USE_LIBBSD
+#include "strlcpy.h"
+#else
+
+#endif
+
+#endif

static inline void burst_free_mbufs(struct rte_mbuf **pkts, unsigned num)
{

If this looks reasonable, I can submit a pull-request.
Let me know what you think.

@ravisinghsfbay
Copy link
Contributor

Filed PR #84 as a proposed fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants