[dpdk-dev] x86_64-native-linuxapp-clang compilation broken?

Van Haaren, Harry harry.van.haaren at intel.com
Mon Feb 15 11:14:21 CET 2016


> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Marc
> In file included from
> /home/marc/dpdk/lib/librte_eal/linuxapp/eal/eal_pci.c:42:
> /home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:870:2:
> error: implicit declaration of function '_mm_alignr_epi8' is invalid in
> C99
>       [-Werror,-Wimplicit-function-declaration]
>         MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
>         ^

Can reproduce this here, Ubuntu clang version 3.6.2-1 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
This issue seems to be caused by a lack of intrinsic CFLAGS, clang and GCC build output with make V=1 on the same machine (unnecessary output stripped):


clang -Wp,-MD,./.eal_pci.o.d.tmp -m64 -pthread  -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2


gcc -Wp,-MD,./.eal_pci.o.d.tmp -m64 -pthread -fPIC  -march=native -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 -DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND -DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C -DRTE_MACHINE_CPUFLAG_AVX2 -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_CPUFLAG_RDRAND,RTE_CPUFLAG_FSGSBASE,RTE_CPUFLAG_F16C,RTE_CPUFLAG_AVX2


There is no copy-paste error above: the clang intrinsic CFLAGS is much shorter than GCC.

Strangely, this issue also exists when building i686 gcc target *on a 32bit host/VM*. Git bisect shows that this issue exists on 32bit target / 32bit host since commit 9144d6b, which optimized eal/x86 rte_memcpy.

It looks like the build-system is not correctly identifying the intrinsics to build with. I've had a look through mk/toolchain/clang/*  and mk/rte.cpuflags.mk  but haven't seen anything I think could be the cause...

Perhaps somebody with familiarity with the build system could take a look?

-Harry


More information about the dev mailing list