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

Matthew Hall mhall at mhcomputing.net
Tue Feb 16 07:08:11 CET 2016


I had all kinds of very weird failures using the 64 bit clang target related to missing CPUFLAGS. For a while I hacked around it by adding a whole ton of -D for missing RTE CPUFLAGS macros. But then some further DPDK changes came and caused clang bud failures I could not debug and I had to give up and switch back to GCC. While I can't confirm this exact error I can 100% confirm very similar errors using Ubuntu 15.10 and the included clang with it. 

I think the general problem is that there isn't much in the way of regression testing for the build on this compile target. So unless it breaks for just the right expert at the right time nobody finds it and tracks it down. 

Matthew. 

On Feb 15, 2016, at 2:14 AM, Van Haaren, Harry <harry.van.haaren at intel.com> wrote:

>> 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