* [PATCH 1/6] pmd_bond: add missing variable initialization
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2014-07-07 23:36 ` Bruce Richardson
2014-07-07 23:36 ` [PATCH 2/6] Makefiles: add clang to compiler if/else block Bruce Richardson
` (7 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2014-07-07 23:36 UTC (permalink / raw)
To: dev-VfR2kkLFssw
Variable "valid_slave" wasn't getting properly zero-initialized. This error is
flagged by clang on compile.
Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
lib/librte_pmd_bond/rte_eth_bond_pmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
index 048de7f..6ce4e57 100644
--- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c
+++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c
@@ -920,7 +920,7 @@ bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,
struct bond_dev_private *internals;
struct rte_eth_link link;
- int i, bonded_port_id, valid_slave, active_pos = -1;
+ int i, bonded_port_id, valid_slave = 0, active_pos = -1;
if (type != RTE_ETH_EVENT_INTR_LSC)
return;
--
1.9.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/6] Makefiles: add clang to compiler if/else block
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-07-07 23:36 ` [PATCH 1/6] pmd_bond: add missing variable initialization Bruce Richardson
@ 2014-07-07 23:36 ` Bruce Richardson
2014-07-07 23:36 ` [PATCH 3/6] mk: Ensure correct detection of SSE4.2 on FreeBSD Bruce Richardson
` (6 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2014-07-07 23:36 UTC (permalink / raw)
To: dev-VfR2kkLFssw
The makefiles for a number of drivers conditionally disable certain warnings
depending on the compiler and version used. Add in clang to the list of
compiler options.
Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
lib/librte_pmd_i40e/Makefile | 9 +++++++++
lib/librte_pmd_ixgbe/Makefile | 7 +++++++
lib/librte_pmd_vmxnet3/Makefile | 7 +++++++
3 files changed, 23 insertions(+)
diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
index 14bce71..4b31675 100644
--- a/lib/librte_pmd_i40e/Makefile
+++ b/lib/librte_pmd_i40e/Makefile
@@ -45,6 +45,15 @@ CFLAGS += $(WERROR_FLAGS)
#
ifeq ($(CC), icc)
CFLAGS_BASE_DRIVER = -wd593
+else ifeq ($(CC), clang)
+CFLAGS_BASE_DRIVER += -Wno-sign-compare
+CFLAGS_BASE_DRIVER += -Wno-unused-value
+CFLAGS_BASE_DRIVER += -Wno-unused-parameter
+CFLAGS_BASE_DRIVER += -Wno-strict-aliasing
+CFLAGS_BASE_DRIVER += -Wno-format
+CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
+CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast
+CFLAGS_BASE_DRIVER += -Wno-format-nonliteral
else
CFLAGS_BASE_DRIVER = -Wno-unused-but-set-variable
CFLAGS_BASE_DRIVER += -Wno-sign-compare
diff --git a/lib/librte_pmd_ixgbe/Makefile b/lib/librte_pmd_ixgbe/Makefile
index df47715..9278a17 100644
--- a/lib/librte_pmd_ixgbe/Makefile
+++ b/lib/librte_pmd_ixgbe/Makefile
@@ -44,6 +44,13 @@ ifeq ($(CC), icc)
# CFLAGS for icc
#
CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259
+else ifeq ($(CC), clang)
+#
+# CFLAGS for clang
+#
+CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value
+CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args
+
else
#
# CFLAGS for gcc
diff --git a/lib/librte_pmd_vmxnet3/Makefile b/lib/librte_pmd_vmxnet3/Makefile
index a44abe1..14726f9 100644
--- a/lib/librte_pmd_vmxnet3/Makefile
+++ b/lib/librte_pmd_vmxnet3/Makefile
@@ -44,6 +44,13 @@ ifeq ($(CC), icc)
# CFLAGS for icc
#
CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259
+else ifeq ($(CC), clang)
+#
+# CFLAGS for clang
+#
+CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value
+CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args
+
else
#
# CFLAGS for gcc
--
1.9.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/6] mk: Ensure correct detection of SSE4.2 on FreeBSD
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-07-07 23:36 ` [PATCH 1/6] pmd_bond: add missing variable initialization Bruce Richardson
2014-07-07 23:36 ` [PATCH 2/6] Makefiles: add clang to compiler if/else block Bruce Richardson
@ 2014-07-07 23:36 ` Bruce Richardson
[not found] ` <1404776219-6130-4-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-07-07 23:36 ` [PATCH 4/6] acl: add nmmintrin.h header to allow clang compilation Bruce Richardson
` (5 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Bruce Richardson @ 2014-07-07 23:36 UTC (permalink / raw)
To: dev-VfR2kkLFssw
Add a special case to the native target makefile, where we check if
-march=native shows SSE4.2 support. If it does not, then not everything may
build, so we check if the hardware supports SSE4.2, and use a corei7 target
explicitly to get the SSE4.2 support.
Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
mk/machine/native/rte.vars.mk | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/mk/machine/native/rte.vars.mk b/mk/machine/native/rte.vars.mk
index da9aa71..f495973 100644
--- a/mk/machine/native/rte.vars.mk
+++ b/mk/machine/native/rte.vars.mk
@@ -56,3 +56,15 @@
# CPU_ASFLAGS =
MACHINE_CFLAGS = -march=native
+
+# on FreeBSD systems, sometimes the correct cputype is not picked up.
+# To get everything to compile, we need SSE4.2 support, so check if that is
+# reported by compiler. If not, check if the CPU actually supports it, and if
+# so, set the compilation target to be a corei7, minimum target with SSE4.2
+SSE42_SUPPORT=$(shell $(CC) -march=native -dM -E - < /dev/null | grep SSE4_2)
+ifeq ($(SSE42_SUPPORT),)
+ CPU_SSE42_SUPPORT=$(shell if [ -f /var/run/dmesg.boot ] ; then grep SSE4\.2 /var/run/dmesg.boot ; fi)
+ ifneq ($(CPU_SSE42_SUPPORT),)
+ MACHINE_CFLAGS= -march=corei7
+ endif
+endif
--
1.9.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/6] acl: add nmmintrin.h header to allow clang compilation
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
` (2 preceding siblings ...)
2014-07-07 23:36 ` [PATCH 3/6] mk: Ensure correct detection of SSE4.2 on FreeBSD Bruce Richardson
@ 2014-07-07 23:36 ` Bruce Richardson
2014-07-07 23:36 ` [PATCH 5/6] mk: add toolchain for clang and linuxapp target Bruce Richardson
` (4 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2014-07-07 23:36 UTC (permalink / raw)
To: dev-VfR2kkLFssw
Clang compile fails without nmmintrin.h being explicitly included.
Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
lib/librte_acl/acl_bld.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c
index fe7b824..873447b 100644
--- a/lib/librte_acl/acl_bld.c
+++ b/lib/librte_acl/acl_bld.c
@@ -31,6 +31,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <nmmintrin.h>
#include <rte_acl.h>
#include "tb_mem.h"
#include "acl.h"
--
1.9.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/6] mk: add toolchain for clang and linuxapp target
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
` (3 preceding siblings ...)
2014-07-07 23:36 ` [PATCH 4/6] acl: add nmmintrin.h header to allow clang compilation Bruce Richardson
@ 2014-07-07 23:36 ` Bruce Richardson
[not found] ` <1404776219-6130-6-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-07-07 23:36 ` [PATCH 6/6] config: add compile target for clang on BSD Bruce Richardson
` (3 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Bruce Richardson @ 2014-07-07 23:36 UTC (permalink / raw)
To: dev-VfR2kkLFssw
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 8950 bytes --]
Add support for clang by adding a toolchain folder for it with the
appropriate files.
Add compilation support for clang on linux by adding a new target.
Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
config/defconfig_x86_64-native-linuxapp-clang | 63 ++++++++++++++++++++++
mk/toolchain/clang/rte.toolchain-compat.mk | 43 +++++++++++++++
mk/toolchain/clang/rte.vars.mk | 77 +++++++++++++++++++++++++++
3 files changed, 183 insertions(+)
create mode 100644 config/defconfig_x86_64-native-linuxapp-clang
create mode 100644 mk/toolchain/clang/rte.toolchain-compat.mk
create mode 100644 mk/toolchain/clang/rte.vars.mk
diff --git a/config/defconfig_x86_64-native-linuxapp-clang b/config/defconfig_x86_64-native-linuxapp-clang
new file mode 100644
index 0000000..31f2aa4
--- /dev/null
+++ b/config/defconfig_x86_64-native-linuxapp-clang
@@ -0,0 +1,63 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+#include "common_linuxapp"
+
+#
+# machine can define specific variables or action for a specific board
+# RTE_MACHINE can be:
+# default nothing specific
+# native current machine
+# atm Intel® Atom™ microarchitecture
+# nhm Intel® microarchitecture code name Nehalem
+# wsm Intel® microarchitecture code name Westmere
+# snb Intel® microarchitecture code name Sandy Bridge
+# ivb Intel® microarchitecture code name Ivy Bridge
+#
+# Note: if your compiler does not support the relevant -march options,
+# it will be compiled with whatever latest processor the compiler supports!
+#
+CONFIG_RTE_MACHINE="native"
+
+#
+# define the architecture we compile for.
+# CONFIG_RTE_ARCH can be i686, x86_64, x86_64_32
+#
+CONFIG_RTE_ARCH="x86_64"
+CONFIG_RTE_ARCH_X86_64=y
+
+#
+# The compiler we use.
+# Can be gcc or icc.
+#
+CONFIG_RTE_TOOLCHAIN="clang"
+CONFIG_RTE_TOOLCHAIN_CLANG=y
diff --git a/mk/toolchain/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk
new file mode 100644
index 0000000..862b7df
--- /dev/null
+++ b/mk/toolchain/clang/rte.toolchain-compat.mk
@@ -0,0 +1,43 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#
+# CPUID-related options
+#
+# This was added to support compiler versions which might not support all the
+# flags we need
+#
+
+#find out CLANG version
+
+CLANG_MAJOR_VERSION = $(shell $(CC) -dumpversion | cut -f1 -d.)
+
+CLANG_MINOR_VERSION = $(shell $(CC) -dumpversion | cut -f2 -d.)
diff --git a/mk/toolchain/clang/rte.vars.mk b/mk/toolchain/clang/rte.vars.mk
new file mode 100644
index 0000000..d4e6862
--- /dev/null
+++ b/mk/toolchain/clang/rte.vars.mk
@@ -0,0 +1,77 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#
+# toolchain:
+#
+# - define CC, LD, AR, AS, ... (overriden by cmdline value)
+# - define TOOLCHAIN_CFLAGS variable (overriden by cmdline value)
+# - define TOOLCHAIN_LDFLAGS variable (overriden by cmdline value)
+# - define TOOLCHAIN_ASFLAGS variable (overriden by cmdline value)
+#
+# examples for RTE_TOOLCHAIN: gcc, icc
+#
+
+ifeq ($(KERNELRELEASE),)
+CC = $(CROSS)clang
+else
+CC = $(CROSS)gcc
+endif
+CPP = $(CROSS)cpp
+# for now, we don't use as but nasm.
+# AS = $(CROSS)as
+AS = nasm
+AR = $(CROSS)ar
+LD = $(CROSS)ld
+OBJCOPY = $(CROSS)objcopy
+OBJDUMP = $(CROSS)objdump
+STRIP = $(CROSS)strip
+READELF = $(CROSS)readelf
+GCOV = $(CROSS)gcov
+
+HOSTCC = clang
+HOSTAS = as
+
+TOOLCHAIN_ASFLAGS =
+TOOLCHAIN_CFLAGS =
+TOOLCHAIN_LDFLAGS =
+
+WERROR_FLAGS := -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
+WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
+WERROR_FLAGS += -Wnested-externs -Wcast-qual
+WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
+WERROR_FLAGS += -Wundef -Wwrite-strings
+
+# process cpu flags
+include $(RTE_SDK)/mk/toolchain/$(RTE_TOOLCHAIN)/rte.toolchain-compat.mk
+
+export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
+export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
--
1.9.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 6/6] config: add compile target for clang on BSD
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
` (4 preceding siblings ...)
2014-07-07 23:36 ` [PATCH 5/6] mk: add toolchain for clang and linuxapp target Bruce Richardson
@ 2014-07-07 23:36 ` Bruce Richardson
2014-07-10 7:49 ` [PATCH 0/6] Clang compilation support on FreeBSD and Linux Zhan, Zhaochen
` (2 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2014-07-07 23:36 UTC (permalink / raw)
To: dev-VfR2kkLFssw
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3376 bytes --]
Add option to compile on FreeBSD using the clang compiler, now the
default compiler on FreeBSD 10.
Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
config/defconfig_x86_64-native-bsdapp-clang | 71 +++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
create mode 100644 config/defconfig_x86_64-native-bsdapp-clang
diff --git a/config/defconfig_x86_64-native-bsdapp-clang b/config/defconfig_x86_64-native-bsdapp-clang
new file mode 100644
index 0000000..55c7316
--- /dev/null
+++ b/config/defconfig_x86_64-native-bsdapp-clang
@@ -0,0 +1,71 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Intel Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+#include "common_bsdapp"
+
+#
+# define executive environment
+#
+# CONFIG_RTE_EXEC_ENV can be linuxapp, baremetal, bsdapp
+#
+CONFIG_RTE_EXEC_ENV="bsdapp"
+CONFIG_RTE_EXEC_ENV_BSDAPP=y
+
+#
+# machine can define specific variables or action for a specific board
+# RTE_MACHINE can be:
+# default nothing specific
+# native current machine
+# atm Intel® Atom™ microarchitecture
+# nhm Intel® microarchitecture code name Nehalem
+# wsm Intel® microarchitecture code name Westmere
+# snb Intel® microarchitecture code name Sandy Bridge
+# ivb Intel® microarchitecture code name Ivy Bridge
+#
+# Note: if your compiler does not support the relevant -march options,
+# it will be compiled with whatever latest processor the compiler supports!
+#
+CONFIG_RTE_MACHINE="native"
+
+#
+# define the architecture we compile for.
+# CONFIG_RTE_ARCH can be i686, x86_64, x86_64_32
+#
+CONFIG_RTE_ARCH="x86_64"
+CONFIG_RTE_ARCH_X86_64=y
+
+#
+# The compiler we use.
+# Can be gcc or icc.
+#
+CONFIG_RTE_TOOLCHAIN="clang"
+CONFIG_RTE_TOOLCHAIN_CLANG=y
--
1.9.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 0/6] Clang compilation support on FreeBSD and Linux
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
` (5 preceding siblings ...)
2014-07-07 23:36 ` [PATCH 6/6] config: add compile target for clang on BSD Bruce Richardson
@ 2014-07-10 7:49 ` Zhan, Zhaochen
2014-07-11 5:31 ` Zhan, Zhaochen
2014-07-18 23:58 ` Thomas Monjalon
8 siblings, 0 replies; 17+ messages in thread
From: Zhan, Zhaochen @ 2014-07-10 7:49 UTC (permalink / raw)
To: Richardson, Bruce, dev-VfR2kkLFssw@public.gmane.org
Tested by Zhan, Zhaochen <zhaochen.zhan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Applying these patches on the dpdk-1.7.0, we verified the compilation on FreeBSD10.0 with Clang 3.3 and Fedora20 with Clang 3.4.
We also verified some simple test case (pmd, cmdline, hello_world and timer) on FreeBSD with Clang 3.3.
> -----Original Message-----
> From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Bruce Richardson
> Sent: Tuesday, July 08, 2014 7:37 AM
> To: dev-VfR2kkLFssw@public.gmane.org
> Subject: [dpdk-dev] [PATCH 0/6] Clang compilation support on FreeBSD and
> Linux
>
> This patch set enables clang compilation on FreeBSD and Linux. It includes
> patches to fix a number of compilation errors thrown up by clang, and then
> adds in the appropriate toolchain makefiles and compile-time configurations.
>
> This set has been tested with clang v3.3 on FreeBSD 10 and clang v3.4 on
> Fedora linux 20. The example apps folder has not been tested at this time,
> this
> patch set only focuses on the core libraries and apps.
>
> Bruce Richardson (6):
> pmd_bond: add missing variable initialization
> Makefiles: add clang to compiler if/else block
> mk: Ensure correct detection of SSE4.2 on FreeBSD
> acl: add nmmintrin.h header to allow clang compilation
> mk: add toolchain for clang and linuxapp target
> config: add compile target for clang on BSD
>
> config/defconfig_x86_64-native-bsdapp-clang | 71
> ++++++++++++++++++++++++
> config/defconfig_x86_64-native-linuxapp-clang | 63
> ++++++++++++++++++++++
> lib/librte_acl/acl_bld.c | 1 +
> lib/librte_pmd_bond/rte_eth_bond_pmd.c | 2 +-
> lib/librte_pmd_i40e/Makefile | 9 ++++
> lib/librte_pmd_ixgbe/Makefile | 7 +++
> lib/librte_pmd_vmxnet3/Makefile | 7 +++
> mk/machine/native/rte.vars.mk | 12 +++++
> mk/toolchain/clang/rte.toolchain-compat.mk | 43 +++++++++++++++
> mk/toolchain/clang/rte.vars.mk | 77
> +++++++++++++++++++++++++++
> 10 files changed, 291 insertions(+), 1 deletion(-)
> create mode 100644 config/defconfig_x86_64-native-bsdapp-clang
> create mode 100644 config/defconfig_x86_64-native-linuxapp-clang
> create mode 100644 mk/toolchain/clang/rte.toolchain-compat.mk
> create mode 100644 mk/toolchain/clang/rte.vars.mk
>
> --
> 1.9.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 0/6] Clang compilation support on FreeBSD and Linux
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
` (6 preceding siblings ...)
2014-07-10 7:49 ` [PATCH 0/6] Clang compilation support on FreeBSD and Linux Zhan, Zhaochen
@ 2014-07-11 5:31 ` Zhan, Zhaochen
2014-07-18 23:58 ` Thomas Monjalon
8 siblings, 0 replies; 17+ messages in thread
From: Zhan, Zhaochen @ 2014-07-11 5:31 UTC (permalink / raw)
To: Richardson, Bruce, dev-VfR2kkLFssw@public.gmane.org
> > This patch set enables clang compilation on FreeBSD and Linux. It
> > includes patches to fix a number of compilation errors thrown up by
> > clang, and then adds in the appropriate toolchain makefiles and
> > compile-time configurations.
> >
> > This set has been tested with clang v3.3 on FreeBSD 10 and clang
> > v3.4 on Fedora linux 20. The example apps folder has not been tested
> > at this time, this patch set only focuses on the core libraries and apps.
> >
> > Bruce Richardson (6):
> > pmd_bond: add missing variable initialization
> > Makefiles: add clang to compiler if/else block
> > mk: Ensure correct detection of SSE4.2 on FreeBSD
> > acl: add nmmintrin.h header to allow clang compilation
> > mk: add toolchain for clang and linuxapp target
> > config: add compile target for clang on BSD
>
> Tested-by: Zhaochen Zhan <zhaochen.zhan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org<mailto:zhaochen.zhan@intel.com>>
>
> We verified the compilation on FreeBSD 10.0 with Clang 3.3 and Fedora
> 20 with Clang 3.4.
> We also verified some simple test cases (pmd, cmdline, hello_world and
> timer) on FreeBSD with Clang 3.3.
Acked-by: Zhaochen Zhan <zhaochen.zhan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org<mailto:zhaochen.zhan@intel.com>>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 0/6] Clang compilation support on FreeBSD and Linux
[not found] ` <1404776219-6130-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
` (7 preceding siblings ...)
2014-07-11 5:31 ` Zhan, Zhaochen
@ 2014-07-18 23:58 ` Thomas Monjalon
8 siblings, 0 replies; 17+ messages in thread
From: Thomas Monjalon @ 2014-07-18 23:58 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev-VfR2kkLFssw
2014-07-08 00:36, Bruce Richardson:
> This patch set enables clang compilation on FreeBSD and Linux. It includes
> patches to fix a number of compilation errors thrown up by clang, and then
> adds in the appropriate toolchain makefiles and compile-time configurations.
>
> This set has been tested with clang v3.3 on FreeBSD 10 and clang v3.4 on
> Fedora linux 20. The example apps folder has not been tested at this time, this
> patch set only focuses on the core libraries and apps.
>
> Bruce Richardson (6):
> pmd_bond: add missing variable initialization
> Makefiles: add clang to compiler if/else block
> mk: Ensure correct detection of SSE4.2 on FreeBSD
> acl: add nmmintrin.h header to allow clang compilation
> mk: add toolchain for clang and linuxapp target
> config: add compile target for clang on BSD
Tested-by: Zhaochen Zhan <zhaochen.zhan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Acked-by: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
Applied with some cleanups for version 1.7.1
Thanks
--
Thomas
^ permalink raw reply [flat|nested] 17+ messages in thread