DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel
@ 2014-09-22  9:36 Richardson, Bruce
  2014-09-22 13:18 ` Neil Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Richardson, Bruce @ 2014-09-22  9:36 UTC (permalink / raw)
  To: dev

Hi all,

just looking to see if anyone has any suggestions to help me debug an issue I'm seeing here. Basically, the clang target is no longer working for me on Fedora 20 -due to errors when compiling up the kernel modules. The interesting thing is that the gcc target works fine, while the clang target doesn't - despite the fact that gcc is used as the compiler for the kernel modules in both builds. Something else about the clang target is affecting the kernel compile.

>From my investigation, it looks like the compiler flags used in both cases are different, but I'm not sure why. The output of compiling up the first of the kni files is shown below, first for a regular gcc target and secondly for the clang target. From what I read, some initial support for clang compiler went into the 3.15 kernels - is it possible that clang is being incorrectly detected as the kernel compiler by the kernel build system in the second case?

Regards,
/Bruce

#### GCC TARGET COMPILE
== Build lib/librte_eal/linuxapp/kni
make -C /usr/src/kernels/3.15.10-201.fc20.x86_64 \
KBUILD_SRC=/usr/src/kernels/3.15.10-201.fc20.x86_64 \
KBUILD_EXTMOD="/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni" -f /usr/src/kernels/3.15.10-201.fc20.x86_64/Makefile \

test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)
mkdir -p /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.tmp_versions ; rm -f /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.tmp_versions/*
make -f /usr/src/kernels/3.15.10-201.fc20.x86_64/scripts/Makefile.build obj=/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni
  gcc -Wp,-MD,/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.ixgbe_main.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include -I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include -Iarch/x86/include/generated  -I/usr/src/kernels/3.15.10-201.fc20.x86_64/include -Iinclude -I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/kernels/3.15.10-201.fc20.x86_64/include/uapi -Iinclude/generated/uapi -include /usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/kconfig.h   -I/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni --param max-inline-insns-single=50   -I/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/include   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/ixgbe   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/igb -include /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/include/rte_config.h -Wall -Werror  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(ixgbe_main)"  -D"KBUILD_MODNAME=KBUILD_STR(rte_kni)" -c -o /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c

#### CLANG TARGET COMPILE (MODULE COMPILED USING GCC)
== Build lib/librte_eal/linuxapp/kni
make -C /usr/src/kernels/3.15.10-201.fc20.x86_64 \
KBUILD_SRC=/usr/src/kernels/3.15.10-201.fc20.x86_64 \
KBUILD_EXTMOD="/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni" -f /usr/src/kernels/3.15.10-201.fc20.x86_64/Makefile \

test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)
mkdir -p /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.tmp_versions ; rm -f /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.tmp_versions/*
make -f /usr/src/kernels/3.15.10-201.fc20.x86_64/scripts/Makefile.build obj=/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni
  gcc -Wp,-MD,/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.ixgbe_main.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include -I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include -Iarch/x86/include/generated  -I/usr/src/kernels/3.15.10-201.fc20.x86_64/include -Iinclude -I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/kernels/3.15.10-201.fc20.x86_64/include/uapi -Iinclude/generated/uapi -include /usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/kconfig.h   -I/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni -D__KERNEL__ -Wno-unknown-warning-option -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni --param max-inline-insns-single=50   -I/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/include   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/ixgbe   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/igb -include /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/include/rte_config.h -Wall -Werror  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(ixgbe_main)"  -D"KBUILD_MODNAME=KBUILD_STR(rte_kni)" -c -o /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c
In file included from /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:34:0:
/usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/netdevice.h: In function 'netif_addr_lock_nested':
/usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/netdevice.h:2954:6: error: variable 'subclass' set but not used [-Werror=unused-but-set-variable]
  int subclass = SINGLE_DEPTH_NESTING;
      ^
/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c: At top level:
cc1: error: unrecognized command line option "-Wno-unknown-warning-option" [-Werror]
cc1: all warnings being treated as errors
make[10]: *** [/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o] Error 1
make[9]: *** [_module_/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni] Error 2
make[8]: *** [sub-make] Error 2
make[7]: *** [rte_kni.ko] Error 2
make[6]: *** [kni] Error 2
make[5]: *** [linuxapp] Error 2
make[4]: *** [librte_eal] Error 2
make[3]: *** [lib] Error 2
make[2]: *** [all] Error 2
make[1]: *** [x86_64-native-linuxapp-clang_install] Error 2
make: *** [install] Error 2

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel
  2014-09-22  9:36 [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel Richardson, Bruce
@ 2014-09-22 13:18 ` Neil Horman
  2014-09-22 19:23   ` Matthew Hall
  0 siblings, 1 reply; 7+ messages in thread
From: Neil Horman @ 2014-09-22 13:18 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev

On Mon, Sep 22, 2014 at 09:36:33AM +0000, Richardson, Bruce wrote:
> Hi all,
> 
> just looking to see if anyone has any suggestions to help me debug an issue I'm seeing here. Basically, the clang target is no longer working for me on Fedora 20 -due to errors when compiling up the kernel modules. The interesting thing is that the gcc target works fine, while the clang target doesn't - despite the fact that gcc is used as the compiler for the kernel modules in both builds. Something else about the clang target is affecting the kernel compile.
> 
> From my investigation, it looks like the compiler flags used in both cases are different, but I'm not sure why. The output of compiling up the first of the kni files is shown below, first for a regular gcc target and secondly for the clang target. From what I read, some initial support for clang compiler went into the 3.15 kernels - is it possible that clang is being incorrectly detected as the kernel compiler by the kernel build system in the second case?
> 
> Regards,
> /Bruce
> 
> #### GCC TARGET COMPILE
> == Build lib/librte_eal/linuxapp/kni
> make -C /usr/src/kernels/3.15.10-201.fc20.x86_64 \
> KBUILD_SRC=/usr/src/kernels/3.15.10-201.fc20.x86_64 \
> KBUILD_EXTMOD="/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni" -f /usr/src/kernels/3.15.10-201.fc20.x86_64/Makefile \
> 
> test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
> echo >&2;                                                       \
> echo >&2 "  ERROR: Kernel configuration is invalid.";           \
> echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
> echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
> echo >&2 ;                                                      \
> /bin/false)
> mkdir -p /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.tmp_versions ; rm -f /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.tmp_versions/*
> make -f /usr/src/kernels/3.15.10-201.fc20.x86_64/scripts/Makefile.build obj=/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni
>   gcc -Wp,-MD,/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.ixgbe_main.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include -I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include -Iarch/x86/include/generated  -I/usr/src/kernels/3.15.10-201.fc20.x86_64/include -Iinclude -I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/kernels/3.15.10-201.fc20.x86_64/include/uapi -Iinclude/generated/uapi -include /usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/kconfig.h   -I/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni --param max-inline-insns-single=50   -I/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/include   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/ixgbe   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/igb -include /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/include/rte_config.h -Wall -Werror  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(ixgbe_main)"  -D"KBUILD_MODNAME=KBUILD_STR(rte_kni)" -c -o /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o /home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c
> 
> #### CLANG TARGET COMPILE (MODULE COMPILED USING GCC)
> == Build lib/librte_eal/linuxapp/kni
> make -C /usr/src/kernels/3.15.10-201.fc20.x86_64 \
> KBUILD_SRC=/usr/src/kernels/3.15.10-201.fc20.x86_64 \
> KBUILD_EXTMOD="/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni" -f /usr/src/kernels/3.15.10-201.fc20.x86_64/Makefile \
> 
> test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
> echo >&2;                                                       \
> echo >&2 "  ERROR: Kernel configuration is invalid.";           \
> echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
> echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
> echo >&2 ;                                                      \
> /bin/false)
> mkdir -p /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.tmp_versions ; rm -f /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.tmp_versions/*
> make -f /usr/src/kernels/3.15.10-201.fc20.x86_64/scripts/Makefile.build obj=/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni
>   gcc -Wp,-MD,/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.ixgbe_main.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include -I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include -Iarch/x86/include/generated  -I/usr/src/kernels/3.15.10-201.fc20.x86_64/include -Iinclude -I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/kernels/3.15.10-201.fc20.x86_64/include/uapi -Iinclude/generated/uapi -include /usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/kconfig.h   -I/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni -D__KERNEL__ -Wno-unknown-warning-option -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni --param max-inline-insns-single=50   -I/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/include   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/ixgbe   -I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/igb -include /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/include/rte_config.h -Wall -Werror  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(ixgbe_main)"  -D"KBUILD_MODNAME=KBUILD_STR(rte_kni)" -c -o /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c
> In file included from /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:34:0:
> /usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/netdevice.h: In function 'netif_addr_lock_nested':
> /usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/netdevice.h:2954:6: error: variable 'subclass' set but not used [-Werror=unused-but-set-variable]
>   int subclass = SINGLE_DEPTH_NESTING;
>       ^
> /home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c: At top level:
> cc1: error: unrecognized command line option "-Wno-unknown-warning-option" [-Werror]
> cc1: all warnings being treated as errors
> make[10]: *** [/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o] Error 1
> make[9]: *** [_module_/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni] Error 2
> make[8]: *** [sub-make] Error 2
> make[7]: *** [rte_kni.ko] Error 2
> make[6]: *** [kni] Error 2
> make[5]: *** [linuxapp] Error 2
> make[4]: *** [librte_eal] Error 2
> make[3]: *** [lib] Error 2
> make[2]: *** [all] Error 2
> make[1]: *** [x86_64-native-linuxapp-clang_install] Error 2
> make: *** [install] Error 2
> 


FWIW, gcc documents the -Wno-unknown-warning option, not the
-Wno-unknown-warning-option option, so it seems that, when using the clang
config something about it is slipping in an extra option that gcc is choking on,
though I can't see what that might be from my git tree

Neil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel
  2014-09-22 13:18 ` Neil Horman
@ 2014-09-22 19:23   ` Matthew Hall
  2014-09-22 20:05     ` Neil Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Hall @ 2014-09-22 19:23 UTC (permalink / raw)
  To: Neil Horman, Richardson, Bruce; +Cc: dev

I fixed some of the clang errors a few weeks ago. But some of my patches got sent back due to issues seen by others and I didn't have time to fix them yet.
-- 
Sent from my mobile device.

On September 22, 2014 6:18:51 AM PDT, Neil Horman <nhorman@tuxdriver.com> wrote:
>On Mon, Sep 22, 2014 at 09:36:33AM +0000, Richardson, Bruce wrote:
>> Hi all,
>> 
>> just looking to see if anyone has any suggestions to help me debug an
>issue I'm seeing here. Basically, the clang target is no longer working
>for me on Fedora 20 -due to errors when compiling up the kernel
>modules. The interesting thing is that the gcc target works fine, while
>the clang target doesn't - despite the fact that gcc is used as the
>compiler for the kernel modules in both builds. Something else about
>the clang target is affecting the kernel compile.
>> 
>> From my investigation, it looks like the compiler flags used in both
>cases are different, but I'm not sure why. The output of compiling up
>the first of the kni files is shown below, first for a regular gcc
>target and secondly for the clang target. From what I read, some
>initial support for clang compiler went into the 3.15 kernels - is it
>possible that clang is being incorrectly detected as the kernel
>compiler by the kernel build system in the second case?
>> 
>> Regards,
>> /Bruce
>> 
>> #### GCC TARGET COMPILE
>> == Build lib/librte_eal/linuxapp/kni
>> make -C /usr/src/kernels/3.15.10-201.fc20.x86_64 \
>> KBUILD_SRC=/usr/src/kernels/3.15.10-201.fc20.x86_64 \
>>
>KBUILD_EXTMOD="/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni"
>-f /usr/src/kernels/3.15.10-201.fc20.x86_64/Makefile \
>> 
>> test -e include/generated/autoconf.h -a -e include/config/auto.conf
>|| (                \
>> echo >&2;                                                       \
>> echo >&2 "  ERROR: Kernel configuration is invalid.";           \
>> echo >&2 "         include/generated/autoconf.h or
>include/config/auto.conf are missing.";\
>> echo >&2 "         Run 'make oldconfig && make prepare' on kernel src
>to fix it.";      \
>> echo >&2 ;                                                      \
>> /bin/false)
>> mkdir -p
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.tmp_versions
>; rm -f
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.tmp_versions/*
>> make -f
>/usr/src/kernels/3.15.10-201.fc20.x86_64/scripts/Makefile.build
>obj=/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni
>>   gcc
>-Wp,-MD,/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/.ixgbe_main.o.d
>-nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
>-I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include
>-Iarch/x86/include/generated 
>-I/usr/src/kernels/3.15.10-201.fc20.x86_64/include -Iinclude
>-I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include/uapi
>-Iarch/x86/include/generated/uapi
>-I/usr/src/kernels/3.15.10-201.fc20.x86_64/include/uapi
>-Iinclude/generated/uapi -include
>/usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/kconfig.h  
>-I/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni
>-D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs
>-fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
>-Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mno-mmx
>-mno-sse -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3
>-mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time
>-maccumulate-outgoing-args -DCONFIG_AS_CFI=1
>-DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1
>-DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1
>-DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare
>-fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
>-mno-avx -Wframe-larger-than=2048 -fstack-protector-strong
>-Wno-unused-but-set-variable -fno-omit-frame-pointer
>-fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg
>-mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement
>-Wno-pointer-sign -fno-strict-overflow -fconserve-stack
>-Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO  
>-I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni --param
>max-inline-insns-single=50  
>-I/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/include  
>-I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/ixgbe  
>-I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/igb
>-include
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/include/rte_config.h
>-Wall -Werror  -DMODULE  -D"KBUILD_STR(s)=#s"
>-D"KBUILD_BASENAME=KBUILD_STR(ixgbe_main)" 
>-D"KBUILD_MODNAME=KBUILD_STR(rte_kni)" -c -o
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c
>> 
>> #### CLANG TARGET COMPILE (MODULE COMPILED USING GCC)
>> == Build lib/librte_eal/linuxapp/kni
>> make -C /usr/src/kernels/3.15.10-201.fc20.x86_64 \
>> KBUILD_SRC=/usr/src/kernels/3.15.10-201.fc20.x86_64 \
>>
>KBUILD_EXTMOD="/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni"
>-f /usr/src/kernels/3.15.10-201.fc20.x86_64/Makefile \
>> 
>> test -e include/generated/autoconf.h -a -e include/config/auto.conf
>|| (                \
>> echo >&2;                                                       \
>> echo >&2 "  ERROR: Kernel configuration is invalid.";           \
>> echo >&2 "         include/generated/autoconf.h or
>include/config/auto.conf are missing.";\
>> echo >&2 "         Run 'make oldconfig && make prepare' on kernel src
>to fix it.";      \
>> echo >&2 ;                                                      \
>> /bin/false)
>> mkdir -p
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.tmp_versions
>; rm -f
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.tmp_versions/*
>> make -f
>/usr/src/kernels/3.15.10-201.fc20.x86_64/scripts/Makefile.build
>obj=/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni
>>   gcc
>-Wp,-MD,/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/.ixgbe_main.o.d
>-nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.8.3/include
>-I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include
>-Iarch/x86/include/generated 
>-I/usr/src/kernels/3.15.10-201.fc20.x86_64/include -Iinclude
>-I/usr/src/kernels/3.15.10-201.fc20.x86_64/arch/x86/include/uapi
>-Iarch/x86/include/generated/uapi
>-I/usr/src/kernels/3.15.10-201.fc20.x86_64/include/uapi
>-Iinclude/generated/uapi -include
>/usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/kconfig.h  
>-I/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni
>-D__KERNEL__ -Wno-unknown-warning-option -Wall -Wundef
>-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
>-Werror-implicit-function-declaration -Wno-format-security
>-fno-delete-null-pointer-checks -O2 -m64 -mno-mmx -mno-sse -mno-80387
>-mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mtune=generic
>-mno-red-zone -mcmodel=kernel -funit-at-a-time
>-maccumulate-outgoing-args -DCONFIG_AS_CFI=1
>-DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1
>-DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1
>-DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare
>-fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
>-mno-avx -Wframe-larger-than=2048 -fstack-protector-strong
>-Wno-unused-variable -fno-omit-frame-pointer
>-fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg
>-mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement
>-Wno-pointer-sign -fno-strict-overflow -fconserve-stack
>-Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO  
>-I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni --param
>max-inline-insns-single=50  
>-I/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/include  
>-I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/ixgbe  
>-I/home/bruce/mbuf_rework/lib/librte_eal/linuxapp/kni/ethtool/igb
>-include
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/include/rte_config.h
>-Wall -Werror  -DMODULE  -D"KBUILD_STR(s)=#s"
>-D"KBUILD_BASENAME=KBUILD_STR(ixgbe_main)" 
>-D"KBUILD_MODNAME=KBUILD_STR(rte_kni)" -c -o
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c
>> In file included from
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:34:0:
>> /usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/netdevice.h:
>In function 'netif_addr_lock_nested':
>>
>/usr/src/kernels/3.15.10-201.fc20.x86_64/include/linux/netdevice.h:2954:6:
>error: variable 'subclass' set but not used
>[-Werror=unused-but-set-variable]
>>   int subclass = SINGLE_DEPTH_NESTING;
>>       ^
>>
>/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.c:
>At top level:
>> cc1: error: unrecognized command line option
>"-Wno-unknown-warning-option" [-Werror]
>> cc1: all warnings being treated as errors
>> make[10]: ***
>[/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni/ixgbe_main.o]
>Error 1
>> make[9]: ***
>[_module_/home/bruce/mbuf_rework/x86_64-native-linuxapp-clang/build/lib/librte_eal/linuxapp/kni]
>Error 2
>> make[8]: *** [sub-make] Error 2
>> make[7]: *** [rte_kni.ko] Error 2
>> make[6]: *** [kni] Error 2
>> make[5]: *** [linuxapp] Error 2
>> make[4]: *** [librte_eal] Error 2
>> make[3]: *** [lib] Error 2
>> make[2]: *** [all] Error 2
>> make[1]: *** [x86_64-native-linuxapp-clang_install] Error 2
>> make: *** [install] Error 2
>> 
>
>
>FWIW, gcc documents the -Wno-unknown-warning option, not the
>-Wno-unknown-warning-option option, so it seems that, when using the
>clang
>config something about it is slipping in an extra option that gcc is
>choking on,
>though I can

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel
  2014-09-22 19:23   ` Matthew Hall
@ 2014-09-22 20:05     ` Neil Horman
  2014-09-22 22:12       ` Matthew Hall
  0 siblings, 1 reply; 7+ messages in thread
From: Neil Horman @ 2014-09-22 20:05 UTC (permalink / raw)
  To: Matthew Hall; +Cc: dev

On Mon, Sep 22, 2014 at 12:23:36PM -0700, Matthew Hall wrote:
> I fixed some of the clang errors a few weeks ago. But some of my patches got sent back due to issues seen by others and I didn't have time to fix them yet.
Can you elaborate on the specific issue here?
Neil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel
  2014-09-22 20:05     ` Neil Horman
@ 2014-09-22 22:12       ` Matthew Hall
  2014-09-23  9:59         ` Bruce Richardson
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Hall @ 2014-09-22 22:12 UTC (permalink / raw)
  To: Neil Horman; +Cc: dev

On Mon, Sep 22, 2014 at 04:05:29PM -0400, Neil Horman wrote:
> On Mon, Sep 22, 2014 at 12:23:36PM -0700, Matthew Hall wrote:
> > I fixed some of the clang errors a few weeks ago. But some of my patches got sent back due to issues seen by others and I didn't have time to fix them yet.
> Can you elaborate on the specific issue here?
> Neil

Sure...

Have a look at this thread. With this, I got it compiling fine with Clang on 
Ubuntu 14.04 LTS.

Some of your stuff was funky kernel problems... I probably didn't get that as 
I was using an earlier kernel release.

One of the patches was merged as it was trivial but the others involved 
disabling some warnings on certain examples... but people said they preferred 
using ifdef's instead to fix them, which I didn't get a chance to do yet.

Maybe we could try and make all of these clang fixes happen together. I really 
value the better error messages, I can fix bugs much quicker with all of 
those.

Matthew.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel
  2014-09-22 22:12       ` Matthew Hall
@ 2014-09-23  9:59         ` Bruce Richardson
  2014-09-23 17:08           ` Matthew Hall
  0 siblings, 1 reply; 7+ messages in thread
From: Bruce Richardson @ 2014-09-23  9:59 UTC (permalink / raw)
  To: Matthew Hall; +Cc: dev

On Mon, Sep 22, 2014 at 03:12:43PM -0700, Matthew Hall wrote:
> On Mon, Sep 22, 2014 at 04:05:29PM -0400, Neil Horman wrote:
> > On Mon, Sep 22, 2014 at 12:23:36PM -0700, Matthew Hall wrote:
> > > I fixed some of the clang errors a few weeks ago. But some of my patches got sent back due to issues seen by others and I didn't have time to fix them yet.
> > Can you elaborate on the specific issue here?
> > Neil
> 
> Sure...
> 
> Have a look at this thread. With this, I got it compiling fine with Clang on 
> Ubuntu 14.04 LTS.
> 
> Some of your stuff was funky kernel problems... I probably didn't get that as 
> I was using an earlier kernel release.
> 
> One of the patches was merged as it was trivial but the others involved 
> disabling some warnings on certain examples... but people said they preferred 
> using ifdef's instead to fix them, which I didn't get a chance to do yet.
> 
> Maybe we could try and make all of these clang fixes happen together. I really 
> value the better error messages, I can fix bugs much quicker with all of 
> those.
> 
> Matthew.

"make examples" on all the examples has failed for some time, but the 
compilation of the main libs used to work. I've pulled down a 3.14 kernel 
for fedora from koji and confirmed that building with 
"RTE_KERNELDIR=/usr/src/kernels/3.14.9-200.fc20.x86_64/" works fine. It's 
something that has changed in 3.15 and beyond that is causing clang flags to 
get passed in to gcc. I've confirmed that 3.16 also doesn't work.

/Bruce

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel
  2014-09-23  9:59         ` Bruce Richardson
@ 2014-09-23 17:08           ` Matthew Hall
  0 siblings, 0 replies; 7+ messages in thread
From: Matthew Hall @ 2014-09-23 17:08 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

I fixed one main libs bug which blocked compile that was trivial and got it applied. I had examples working too but using an impolite method of doing so.

As for the latest kernel stuff, it sounds like we have to get a hand from LKML or a sublist to figure it out, eh? Doesn't seem like it's in the DPDK code.

Matthew.
-- 
Sent from my mobile device.

On September 23, 2014 2:59:47 AM PDT, Bruce Richardson <bruce.richardson@intel.com> wrote:
>On Mon, Sep 22, 2014 at 03:12:43PM -0700, Matthew Hall wrote:
>> On Mon, Sep 22, 2014 at 04:05:29PM -0400, Neil Horman wrote:
>> > On Mon, Sep 22, 2014 at 12:23:36PM -0700, Matthew Hall wrote:
>> > > I fixed some of the clang errors a few weeks ago. But some of my
>patches got sent back due to issues seen by others and I didn't have
>time to fix them yet.
>> > Can you elaborate on the specific issue here?
>> > Neil
>> 
>> Sure...
>> 
>> Have a look at this thread. With this, I got it compiling fine with
>Clang on 
>> Ubuntu 14.04 LTS.
>> 
>> Some of your stuff was funky kernel problems... I probably didn't get
>that as 
>> I was using an earlier kernel release.
>> 
>> One of the patches was merged as it was trivial but the others
>involved 
>> disabling some warnings on certain examples... but people said they
>preferred 
>> using ifdef's instead to fix them, which I didn't get a chance to do
>yet.
>> 
>> Maybe we could try and make all of these clang fixes happen together.
>I really 
>> value the better error messages, I can fix bugs much quicker with all
>of 
>> those.
>> 
>> Matthew.
>
>"make examples" on all the examples has failed for some time, but the 
>compilation of the main libs used to work. I've pulled down a 3.14
>kernel 
>for fedora from koji and confirmed that building with 
>"RTE_KERNELDIR=/usr/src/kernels/3.14.9-200.fc20.x86_64/" works fine.
>It's 
>something that has changed in 3.15 and beyond that is causing clang
>flags to 
>get passed in to gcc. I've confirmed that 3.16 also doesn't work.
>
>/Bruce

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-23 17:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-22  9:36 [dpdk-dev] compile error with linuxapp-clang target on Fedora 20 with 3.15.10 kernel Richardson, Bruce
2014-09-22 13:18 ` Neil Horman
2014-09-22 19:23   ` Matthew Hall
2014-09-22 20:05     ` Neil Horman
2014-09-22 22:12       ` Matthew Hall
2014-09-23  9:59         ` Bruce Richardson
2014-09-23 17:08           ` Matthew Hall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).