github / glb-director

GitHub Load Balancer Director and supporting tooling.
Other
2.37k stars 227 forks source link

duplicate strlcpy definitions on ubuntu 18.04.2 #72

Open openhacker opened 5 years ago

openhacker commented 5 years ago

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 commented 5 years ago

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

include

+ +#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 commented 4 years ago

Filed PR https://github.com/github/glb-director/pull/84 as a proposed fix for this issue.