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

2016-02-17 Thread Marc
On 16 February 2016 at 19:47, Matthew Hall  wrote:

> On Tue, Feb 16, 2016 at 12:57:24PM +, De Lara Guarch, Pablo wrote:
> > We suspect this might be an architecture dependent issue.
> > Could you tell us which CPU you are using?
> >
> > Thanks,
> > Pablo
>
> When it happens to me I am using a Skylake Core i7-6700K.
>

Broadwell qemu emulated.

Marc


>
> Matthew.
>


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

2016-02-17 Thread De Lara Guarch, Pablo
Hi,

> From: marc.sune at gmail.com [mailto:marc.sune at gmail.com] On Behalf Of
> Marc
> Sent: Tuesday, February 16, 2016 11:19 PM
> To: Matthew Hall
> Cc: De Lara Guarch, Pablo; Mcnamara, John; dev at dpdk.org
> Subject: Re: [dpdk-dev] x86_64-native-linuxapp-clang compilation broken?
> 
> 
> 
> On 16 February 2016 at 19:47, Matthew Hall 
> wrote:
> On Tue, Feb 16, 2016 at 12:57:24PM +, De Lara Guarch, Pablo wrote:
> > We suspect this might be an architecture dependent issue.
> > Could you tell us which CPU you are using?
> >
> > Thanks,
> > Pablo
> 
> When it happens to me I am using a Skylake Core i7-6700K.
> 
> Broadwell qemu emulated.


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

2016-02-17 Thread Matthew Hall
On Wed, Feb 17, 2016 at 11:07:40AM +, De Lara Guarch, Pablo wrote:
> It looks like old versions of clang are not able to identify correctly the 
> newer CPUs:
> 
> LLVM (http://llvm.org/):
>   LLVM version 3.6.2
> 
>   Optimized build.
>   Built Aug 18 2015 (08:39:18).
>   Default target: x86_64-pc-linux-gnu
>   Host CPU: x86-64 
> 
> 
> LLVM (http://llvm.org/):
>   LLVM version 3.7.0
>   Optimized build.
>   Built Jan 22 2016 (17:39:46).
>   Default target: x86_64-redhat-linux-gnu
>   Host CPU: broadwell
> 
> I will submit a patch adding a note in known issues section, unless anybody 
> knows
> how to fix this in our side (as far as I know, it is a clang issue).
> 
> Thanks,
> Pablo

Hello Pablo,

Just having some explanation of the root cause is a great start even if it 
can't necessarily be fixed in DPDK. I will install clang 3.7.X and retry it.

Matthew.


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

2016-02-14 Thread Marc
It seems compilation for clang Linux target is broken:

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);
^
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:716:16:
note: expanded from macro 'MOVEUNALIGNED_LEFT47'
case 0x01: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x01); break;\
   ^
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:667:64:
note: expanded from macro 'MOVEUNALIGNED_LEFT47_IMM'
_mm_storeu_si128((__m128i *)((uint8_t *)dst + 0 * 16),
_mm_alignr_epi8(xmm1, xmm0, offset));\
   ^
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:870:2:
error: passing 'int' to parameter of incompatible type '__m128i'
  (vector of 2 'long long' values)
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:716:16:
note: expanded from macro 'MOVEUNALIGNED_LEFT47'
case 0x01: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x01); break;\
   ^~~
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:667:64:
note: expanded from macro 'MOVEUNALIGNED_LEFT47_IMM'
_mm_storeu_si128((__m128i *)((uint8_t *)dst + 0 * 16),
_mm_alignr_epi8(xmm1, xmm0, offset));\

 ^~~
/usr/include/clang/3.5.0/include/emmintrin.h:1183:40: note: passing
argument to parameter '__b' here
_mm_storeu_si128(__m128i *__p, __m128i __b)
   ^
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: passing 'int' to parameter of incompatible type '__m128i'
  (vector of 2 'long long' values)
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:716:16:
note: expanded from macro 'MOVEUNALIGNED_LEFT47'
case 0x01: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x01); break;\
   ^~~
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:668:64:
note: expanded from macro 'MOVEUNALIGNED_LEFT47_IMM'
_mm_storeu_si128((__m128i *)((uint8_t *)dst + 1 * 16),
_mm_alignr_epi8(xmm2, xmm1, offset));\

 ^~~
/usr/include/clang/3.5.0/include/emmintrin.h:1183:40: note: passing
argument to parameter '__b' here
_mm_storeu_si128(__m128i *__p, __m128i __b)
   ^
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: passing 'int' to parameter of incompatible type '__m128i'
  (vector of 2 'long long' values)
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:716:16:
note: expanded from macro 'MOVEUNALIGNED_LEFT47'
case 0x01: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x01); break;\
   ^~~
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:669:64:
note: expanded from macro 'MOVEUNALIGNED_LEFT47_IMM'
_mm_storeu_si128((__m128i *)((uint8_t *)dst + 2 * 16),
_mm_alignr_epi8(xmm3, xmm2, offset));\

 ^~~
/usr/include/clang/3.5.0/include/emmintrin.h:1183:40: note: passing
argument to parameter '__b' here
_mm_storeu_si128(__m128i *__p, __m128i __b)
   ^
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: passing 'int' to parameter of incompatible type '__m128i'
  (vector of 2 'long long' values)
MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);
^
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:716:16:
note: expanded from macro 'MOVEUNALIGNED_LEFT47'
case 0x01: MOVEUNALIGNED_LEFT47_IMM(dst, src, n, 0x01); break;\
   ^~~
/home/marc/dpdk/x86_64-native-linuxapp-clang/include/rte_memcpy.h:670:64:
note: expanded from macro 'MOVEUNALIGNED_LEFT47_IMM'
_mm_storeu_si128((__m128i *)((uint8_t *)dst + 3 * 16),
_mm_alignr_epi8(xmm4, xmm3, offset));\

 ^~~
/usr/include/clang/3.5.0/include/emmintrin.h:1183:40: note: passi

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

2016-02-15 Thread Mcnamara, John


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Marc
> Sent: Sunday, February 14, 2016 10:21 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] x86_64-native-linuxapp-clang compilation broken?
> 
> It seems compilation for clang Linux target is broken:
> 
> 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);
> ^
> ...
> 
> marc at dpdk:~/dpdk$ clang --version
> Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM
> 3.5.0)
> Target: x86_64-pc-linux-gnu
> Thread model: posix

Hi,

It compiles ok for me with the latest HEAD and clang 3.70:

$ make install -j T=x86_64-native-linuxapp-clang CC=/usr/bin/clang
...
Build complete [x86_64-native-linuxapp-clang]
...


$ clang --version
clang version 3.7.0 (tags/RELEASE_370/final)
Target: x86_64-redhat-linux-gnu
Thread model: posix

I do have to avoid using the ccached clang since it gives a (different) error 
about macro expansions. However, that isn't the issue you are seeing.

John





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

2016-02-15 Thread Mcnamara, John


> -Original Message-
> From: Mcnamara, John
> Sent: Monday, February 15, 2016 9:39 AM
> To: 'Marc' ; dev at dpdk.org
> Subject: RE: [dpdk-dev] x86_64-native-linuxapp-clang compilation broken?
> 
> 
> 
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Marc
> > Sent: Sunday, February 14, 2016 10:21 PM
> > To: dev at dpdk.org
> > Subject: [dpdk-dev] x86_64-native-linuxapp-clang compilation broken?
> >
> > It seems compilation for clang Linux target is broken:
> >
> > 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);
> > ^
> > ...
> >
> > marc at dpdk:~/dpdk$ clang --version
> > Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM
> > 3.5.0)
> > Target: x86_64-pc-linux-gnu
> > Thread model: posix
> 
> Hi,
> 
> It compiles ok for me with the latest HEAD and clang 3.70:
> 
> $ make install -j T=x86_64-native-linuxapp-clang CC=/usr/bin/clang
> ...
> Build complete [x86_64-native-linuxapp-clang]
> ...
> 
> 
> $ clang --version
> clang version 3.7.0 (tags/RELEASE_370/final)
> Target: x86_64-redhat-linux-gnu
> Thread model: posix
> 
> I do have to avoid using the ccached clang since it gives a (different)
> error about macro expansions. However, that isn't the issue you are
> seeing.
> 

P.S.

I see that similar, but not quite the same errors, if I use the -gcc target 
with clang:

$ make install -j T=x86_64-native-linuxapp-gcc CC=/usr/bin/clang

John


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

2016-02-15 Thread Van Haaren, Harry
> 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


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

2016-02-15 Thread Matthew Hall
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  
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


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

2016-02-16 Thread Mcnamara, John


> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Marc
> Sent: Sunday, February 14, 2016 10:21 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] x86_64-native-linuxapp-clang compilation broken?
> 
> It seems compilation for clang Linux target is broken:
> 
>...
>
> marc at dpdk:~/dpdk$ clang --version
> Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM
> 3.5.0)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
> 
> Any ideas?

Hi,

I built clang 3.5.0 and built DPDK successfully with it on FC23:

$ /tmp/llvm-3.5.0.src/Release+Asserts/bin/clang --version
clang version 3.5.0 (tags/RELEASE_350/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

What OS version are you using?

John



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

2016-02-16 Thread Marc
On 16 February 2016 at 12:49, Mcnamara, John 
wrote:

>
>
> > -Original Message-
> > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Marc
> > Sent: Sunday, February 14, 2016 10:21 PM
> > To: dev at dpdk.org
> > Subject: [dpdk-dev] x86_64-native-linuxapp-clang compilation broken?
> >
> > It seems compilation for clang Linux target is broken:
> >
> >...
> >
> > marc at dpdk:~/dpdk$ clang --version
> > Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM
> > 3.5.0)
> > Target: x86_64-pc-linux-gnu
> > Thread model: posix
> >
> > Any ideas?
>
> Hi,
>
> I built clang 3.5.0 and built DPDK successfully with it on FC23:
>
> $ /tmp/llvm-3.5.0.src/Release+Asserts/bin/clang --version
> clang version 3.5.0 (tags/RELEASE_350/final)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
>
> What OS version are you using?
>

Debian 8, amd64

Regards
Marc


>
> John
>
>


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

2016-02-16 Thread De Lara Guarch, Pablo
Hi Marc,

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Marc
> Sent: Tuesday, February 16, 2016 12:16 PM
> To: Mcnamara, John
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] x86_64-native-linuxapp-clang compilation broken?
> 
> On 16 February 2016 at 12:49, Mcnamara, John
> 
> wrote:
> 
> >
> >
> > > -Original Message-
> > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Marc
> > > Sent: Sunday, February 14, 2016 10:21 PM
> > > To: dev at dpdk.org
> > > Subject: [dpdk-dev] x86_64-native-linuxapp-clang compilation broken?
> > >
> > > It seems compilation for clang Linux target is broken:
> > >
> > >...
> > >
> > > marc at dpdk:~/dpdk$ clang --version
> > > Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM
> > > 3.5.0)
> > > Target: x86_64-pc-linux-gnu
> > > Thread model: posix
> > >
> > > Any ideas?
> >
> > Hi,
> >
> > I built clang 3.5.0 and built DPDK successfully with it on FC23:
> >
> > $ /tmp/llvm-3.5.0.src/Release+Asserts/bin/clang --version
> > clang version 3.5.0 (tags/RELEASE_350/final)
> > Target: x86_64-unknown-linux-gnu
> > Thread model: posix
> >
> > What OS version are you using?
> >
> 
> Debian 8, amd64

We suspect this might be an architecture dependent issue.
Could you tell us which CPU you are using?

Thanks,
Pablo

> 
> Regards
> Marc
> 
> 
> >
> > John
> >
> >


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

2016-02-16 Thread Matthew Hall
On Tue, Feb 16, 2016 at 12:57:24PM +, De Lara Guarch, Pablo wrote:
> We suspect this might be an architecture dependent issue.
> Could you tell us which CPU you are using?
> 
> Thanks,
> Pablo

When it happens to me I am using a Skylake Core i7-6700K.

Matthew.