Skip to contentSkip to conversation

build system improvements

PATCH Applied Thomas Monjalon 4 participants 16 messages Aug 12, 2019 – Sep 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover build system improvements

While testing compilation of mlx drivers,
I hit some issues and misses.
The result is 6 patches of cleanup, fixes and test improvements.

Thomas Monjalon (6):
build: remove redundant libs from pkgconfig
drivers: add some reasons for meson disabling net/mlx: fix meson build with custom dependency path net/mlx: fix build with make and recent gcc
devtools: test compiler availability only once
devtools: load target-specific compilation environment

 devtools/test-meson-builds.sh         | 52 +++++++++++++++++----------
 drivers/baseband/turbo_sw/meson.build |  1 +
 drivers/compress/isal/meson.build     |  1 -
 drivers/net/af_xdp/meson.build        |  1 -
 drivers/net/memif/meson.build         |  5 +--
 drivers/net/mlx4/Makefile             |  3 +-
 drivers/net/mlx4/meson.build          |  9 ++---
 drivers/net/mlx5/Makefile             |  3 +-
 drivers/net/mlx5/meson.build          |  7 ++--
 drivers/raw/ioat/meson.build          |  1 +
 10 files changed, 52 insertions(+), 31 deletions(-)
Signature · 1 line
2.22.0
#1 lore raw

PATCH 1/6 build: remove redundant libs from pkgconfig

As explained in drivers/meson.build,
"
For the find_library() case (but not with dependency()) we also need to specify the "-l" flags in pkgconfig_extra_libs variable too, so that it can be reflected in the pkgconfig output for static builds.
"

The commit e30b4e566f47 ("build: improve dependency handling") must be followed up with this one in order to remove more occurences of pkgconfig_extra_libs redundant with use of dependency().

Fixes f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
Fixes 3c32e89f68e1 ("compress/isal: add skeleton ISA-L compression PMD")
---
 drivers/compress/isal/meson.build | 1 -
 drivers/net/af_xdp/meson.build    | 1 -
 2 files changed, 2 deletions(-)
drivers/compress/isal/meson.build +0 -1
index 67b5c4aae..25578880d 100644
@@ -10,6 +10,5 @@ endif
 deps += 'bus_vdev'
 sources = files('isal_compress_pmd.c', 'isal_compress_pmd_ops.c')
 ext_deps += dep
-pkgconfig_extra_libs += '-lisal'
 
 allow_experimental_apis = true
drivers/net/af_xdp/meson.build +0 -1
index ac679b92b..307aa0e38 100644
@@ -10,7 +10,6 @@ endif
 
 if bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('linux/if_xdp.h')
 	ext_deps += bpf_dep
-	pkgconfig_extra_libs += '-lbpf'
 else
 	build = false
 	reason = 'missing dependency, "libbpf"'
Signature · 1 line
2.22.0
#3 lore raw

PATCH 2/6 drivers: add some reasons for meson disabling

In reply to Thomas Monjalon

Some drivers were missing reasons text for their disabling in meson.

---
 drivers/baseband/turbo_sw/meson.build | 1 +
 drivers/net/memif/meson.build         | 5 +++--
 drivers/raw/ioat/meson.build          | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)
drivers/baseband/turbo_sw/meson.build +1 -0
index 33345aa01..1a1f7c9a9 100644
@@ -7,6 +7,7 @@ if dpdk_conf.has('RTE_BBDEV_SDK_AVX2')
 	lib = cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: false)
 	if not lib.found()
 		build = false
+		reason = 'missing dependency, "libturbo"'
 	else
 		ext_deps += cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: true)
 		ext_deps += cc.find_library('libcrc', dirs: [path + '/lib_crc'], required: true)
drivers/net/memif/meson.build +3 -2
index bedc97311..a44d82535 100644
@@ -1,8 +1,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018-2019 Cisco Systems, Inc.  All rights reserved.
 
-if host_machine.system() != 'linux'
-        build = false
+if not is_linux
+	build = false
+	reason = 'only supported on Linux'
 endif
 
 sources = files('rte_eth_memif.c',
drivers/raw/ioat/meson.build +1 -0
index 247ff88bf..0878418ae 100644
@@ -2,6 +2,7 @@
 # Copyright 2019 Intel Corporation
 
 build = dpdk_conf.has('RTE_ARCH_X86')
+reason = 'only supported on x86'
 sources = files('ioat_rawdev.c',
 		'ioat_rawdev_test.c')
 deps += ['rawdev', 'bus_pci', 'mbuf']
Signature · 1 line
2.22.0
#5 lore raw

PATCH 3/6 net/mlx: fix meson build with custom dependency path

In reply to Thomas Monjalon

If rdma-core is not installed in a standard directory of the system, it is possible to specify the location of the pkgconfig file via an environment variable:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:~/rdma-core/build/lib/pkgconfig

In this case, the dependency may become mandatory to specify for the configuration tests (checking dependency symbols or fields).

Some spacing is also fixed around.

Fixes 8e4937640022 ("net/mlx4: add external allocator for Verbs object")
Fixes 1dd7c7e38c19 ("net/mlx4: support meson build")
Fixes 96d7c62a70c7 ("net/mlx5: support meson build")
---
 drivers/net/mlx4/meson.build | 9 +++++----
 drivers/net/mlx5/meson.build | 7 ++++---
 2 files changed, 9 insertions(+), 7 deletions(-)
drivers/net/mlx4/meson.build +5 -4
index 028cd97fa..efee45776 100644
@@ -76,7 +76,7 @@ if build
 	# mlx4_autoconf.h file is still generated.
 	# input array for meson member search:
 	# [ "MACRO to define if found", "header for the search",
-	#   "symbol to search","struct member to search" ]
+	#   "symbol to search", "struct member to search" ]
 	#
 	has_member_args = [
 		[ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h',
@@ -93,12 +93,13 @@ if build
 	]
 	config = configuration_data()
 	foreach arg:has_sym_args
-		config.set(arg[0], cc.has_header_symbol(arg[1], arg[2]))
+		config.set(arg[0], cc.has_header_symbol(arg[1], arg[2],
+			dependencies: libs))
 	endforeach
 	foreach arg:has_member_args
-		file_prefix = '#include<' + arg[1] + '>'
+		file_prefix = '#include <' + arg[1] + '>'
 		config.set(arg[0], cc.has_member(arg[2], arg[3],
-			prefix : file_prefix))
+			prefix: file_prefix, dependencies: libs))
 	endforeach
 	configure_file(output : 'mlx4_autoconf.h', configuration : config)
 endif
drivers/net/mlx5/meson.build +4 -3
index 62b41caf1..3c5144c9b 100644
@@ -177,12 +177,13 @@ if build
 	]
 	config = configuration_data()
 	foreach arg:has_sym_args
-		config.set(arg[0], cc.has_header_symbol(arg[1], arg[2]))
+		config.set(arg[0], cc.has_header_symbol(arg[1], arg[2],
+			dependencies: libs))
 	endforeach
 	foreach arg:has_member_args
-		file_prefix = '#include<' + arg[1] + '>'
+		file_prefix = '#include <' + arg[1] + '>'
 		config.set(arg[0], cc.has_member(arg[2], arg[3],
-			prefix : file_prefix))
+			prefix : file_prefix, dependencies: libs))
 	endforeach
 	configure_file(output : 'mlx5_autoconf.h', configuration : config)
 endif
Signature · 1 line
2.22.0
#8 lore raw

PATCH 4/6 net/mlx: fix build with make and recent gcc

In reply to Thomas Monjalon

With VERBOSE=1, this error was seen in debug mode with gcc 9.1:

In file included from /tmp/dpdk.auto-config-h.sh.c.w0VWMi:1:
In file included from rdma-core/build/include/infiniband/mlx5dv.h:47:
In file included from rdma-core/build/include/infiniband/verbs.h:46:
In file included from rdma-core/build/include/infiniband/verbs_api.h:66:
In file included from rdma-core/build/include/infiniband/ib_user_ioctl_verbs.h:38:
include/rdma/ib_user_verbs.h:161:28: fatal error:
zero size arrays are an extension [-Wzero-length-array]
__aligned_u64 driver_data0;
^
1 error generated.

As a result, buildtools/auto-config-h.sh was not generating a correct autoconf file, so the compilation was generating such error:

fatal error: redefinition of 'mlx5_ib_uapi_flow_action_packet_reformat_type'

It is fixed by disabling -pedantic option when calling auto-config-h.sh from the makefile-based system.

---
 drivers/net/mlx4/Makefile | 3 ++-
 drivers/net/mlx5/Makefile | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/mlx4/Makefile +2 -1
index 8126b0dfc..25d7c7555 100644
@@ -68,6 +68,7 @@ endif
 # User-defined CFLAGS.
 ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DEBUG),y)
 CFLAGS += -pedantic -UNDEBUG -DPEDANTIC
+AUTO_CONFIG_CFLAGS += -Wno-pedantic
 else
 CFLAGS += -DNDEBUG -UPEDANTIC
 endif
@@ -77,7 +78,7 @@ include $(RTE_SDK)/mk/rte.lib.mk
 # Generate and clean-up mlx4_autoconf.h.
 
 export CC CFLAGS CPPFLAGS EXTRA_CFLAGS EXTRA_CPPFLAGS
-export AUTO_CONFIG_CFLAGS = -Wno-error
+export AUTO_CONFIG_CFLAGS += -Wno-error
 
 ifndef V
 AUTOCONF_OUTPUT := >/dev/null
drivers/net/mlx5/Makefile +2 -1
index dbb2a4e80..299cf3afe 100644
@@ -83,6 +83,7 @@ endif
 # User-defined CFLAGS.
 ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DEBUG),y)
 CFLAGS += -pedantic -UNDEBUG -DPEDANTIC
+AUTO_CONFIG_CFLAGS += -Wno-pedantic
 else
 CFLAGS += -DNDEBUG -UPEDANTIC
 endif
@@ -92,7 +93,7 @@ include $(RTE_SDK)/mk/rte.lib.mk
 # Generate and clean-up mlx5_autoconf.h.
 
 export CC CFLAGS CPPFLAGS EXTRA_CFLAGS EXTRA_CPPFLAGS
-export AUTO_CONFIG_CFLAGS = -Wno-error
+export AUTO_CONFIG_CFLAGS += -Wno-error
 
 ifndef V
 AUTOCONF_OUTPUT := >/dev/null
Signature · 1 line
2.22.0
#11 lore raw

PATCH 5/6 devtools: test compiler availability only once

In reply to Thomas Monjalon

The compilation test is skipped if the compiler is not available. In the case of gcc/arm, it was tested both in the generic function "build" and in the cross-compilation section.

By passing the compiler as argument of the generic function, the test with "command" is done only once.

This small clean-up has the benefit of introducing the compiler parameter to be used later in another improvement.

---
 devtools/test-meson-builds.sh | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)
devtools/test-meson-builds.sh +16 -17
index 9fe0a04c9..f2b0b347b 100755
@@ -29,11 +29,13 @@ else
 	exit 1
 fi
 
-build () # <directory> <meson options>
+build () # <directory> <target compiler> <meson options>
 {
 	builddir=$1
 	shift
-	if command -v $CC >/dev/null 2>&1 ; then
+	targetcc=$1
+	shift
+	if command -v $CC $targetcc >/dev/null 2>&1 ; then
 		if [ ! -f "$builddir/build.ninja" ] ; then
 			options="--werror -Dexamples=all $*"
 			echo "$MESON $options $srcdir $builddir"
@@ -71,7 +73,7 @@ for c in gcc clang ; do
 	command -v $c >/dev/null 2>&1 || continue
 	for s in static shared ; do
 		export CC="ccache $c"
-		build build-$c-$s --default-library=$s
+		build build-$c-$s $c --default-library=$s
 	done
 done
 
@@ -83,22 +85,19 @@ ok=$(cc -march=$default_machine -E - < /dev/null > /dev/null 2>&1 || echo false)
 if [ "$ok" = "false" ] ; then
 	default_machine='corei7'
 fi
-build build-x86-default -Dlibdir=lib -Dmachine=$default_machine $use_shared
+build build-x86-default cc -Dlibdir=lib -Dmachine=$default_machine $use_shared
 
-# enable cross compilation if gcc cross-compiler is found
 c=aarch64-linux-gnu-gcc
-if command -v $c >/dev/null 2>&1 ; then
-	# compile the general v8a also for clang to increase coverage
-	export CC="clang"
-	build build-arm64-host-clang $use_shared \
-		--cross-file $srcdir/config/arm/arm64_armv8_linux_gcc
-
-	for f in $srcdir/config/arm/arm*gcc ; do
-		export CC="ccache gcc"
-		build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) \
-			$use_shared --cross-file $f
-	done
-fi
+# generic armv8a with clang as host compiler
+export CC="clang"
+build build-arm64-host-clang $c $use_shared \
+	--cross-file $srcdir/config/arm/arm64_armv8_linux_gcc
+# all gcc/arm configurations
+for f in $srcdir/config/arm/arm*gcc ; do
+	export CC="ccache gcc"
+	build build-$(basename $f | tr '_' '-' | cut -d'-' -f-2) $c \
+		$use_shared --cross-file $f
+done
 
 # Test installation of the x86-default target, to be used for checking
 # the sample apps build using the pkg-config file for cflags and libs
Signature · 1 line
2.22.0
#13 lore raw

PATCH 6/6 devtools: load target-specific compilation environment

In reply to Thomas Monjalon

In order to re-use the same test environment as with test-build.sh, the configuration file is loaded at each build, after adjusting the variable DPDK_TARGET.

This is especially useful to set the variable PKG_CONFIG_PATH, or define some meson options (without -D) in DPDK_MESON_OPTIONS.

The DPDK_TARGET values can be

	aarch64-*, powerpc64-*, x86_64-*.
The matching DPDK_TARGET values for test-build.sh are
	arm64-*, ppc_64-*, x86_64-*.
The advised expressions to use in the common configuration file are:
	if echo $DPDK_TARGET | grep -q '^a.*64-' ; then
	elif echo $DPDK_TARGET | grep -q '^p.*pc.*64' ; then
	elif echo $DPDK_TARGET | grep -q '^x86_64' ; then
	fi
---
 devtools/test-meson-builds.sh | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
devtools/test-meson-builds.sh +18 -1
index f2b0b347b..a51a04d5a 100755
@@ -29,15 +29,32 @@ else
 	exit 1
 fi
 
+default_path=$PATH
+default_pkgpath=$PKG_CONFIG_PATH
+
+reset_env ()
+{
+	export PATH=$default_path
+	export PKG_CONFIG_PATH=$default_pkgpath
+	unset DPDK_MESON_OPTIONS
+}
+
 build () # <directory> <target compiler> <meson options>
 {
 	builddir=$1
 	shift
 	targetcc=$1
 	shift
+	reset_env
+	DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
+	. $srcdir/devtools/load-devel-config
 	if command -v $CC $targetcc >/dev/null 2>&1 ; then
 		if [ ! -f "$builddir/build.ninja" ] ; then
-			options="--werror -Dexamples=all $*"
+			options="--werror -Dexamples=all"
+			for option in $DPDK_MESON_OPTIONS ; do
+				options="$options -D$option"
+			done
+			options="$options $*"
 			echo "$MESON $options $srcdir $builddir"
 			$MESON $options $srcdir $builddir
 			unset CC
Signature · 1 line
2.22.0
Acked-by on v1 1/6
#2 lore raw

Re: [dpdk-dev] [PATCH 1/6] build: remove redundant libs from pkgconfig

In reply to Thomas Monjalon
Quoted 62 lines · Thomas Monjalon

As explained in drivers/meson.build,
"
For the find_library() case (but not with dependency()) we also need to specify the "-l" flags in pkgconfig_extra_libs variable too, so that it can be reflected in the pkgconfig output for static builds.
"

The commit e30b4e566f47 ("build: improve dependency handling") must be followed up with this one in order to remove more occurences of pkgconfig_extra_libs redundant with use of dependency().

Fixes f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Cc:
[email protected]

Fixes 3c32e89f68e1 ("compress/isal: add skeleton ISA-L compression

PMD")
Cc:
[email protected]

Cc:
[email protected]

Cc:
[email protected]

Signed-off-by: Thomas Monjalon <
[email protected]

Quoted 1 line
---
 drivers/compress/isal/meson.build | 1 -
 drivers/net/af_xdp/meson.build    | 1 -
 2 files changed, 2 deletions(-)
drivers/compress/isal/meson.build +0 -1
index 67b5c4aae..25578880d 100644
@@ -10,6 +10,5 @@ endif
 deps += 'bus_vdev'
 sources = files('isal_compress_pmd.c', 'isal_compress_pmd_ops.c')
 ext_deps += dep
-pkgconfig_extra_libs += '-lisal'
 
 allow_experimental_apis = true
drivers/net/af_xdp/meson.build +0 -1
index ac679b92b..307aa0e38 100644
@@ -10,7 +10,6 @@ endif
 
 if bpf_dep.found() and cc.has_header('bpf/xsk.h') and
 cc.has_header('linux/if_xdp.h')
 	ext_deps += bpf_dep
-	pkgconfig_extra_libs += '-lbpf'
 else
 	build = false
Quoted 2 lines

reason = 'missing dependency, "libbpf"'

Signature · 2 lines
Kind regards,
Luca Boccassi
Acked-by on v1 2/6
#4 lore raw

Re: [dpdk-dev] [PATCH 2/6] drivers: add some reasons for meson disabling

In reply to Thomas Monjalon
Quoted 11 lines · Thomas Monjalon

Some drivers were missing reasons text for their disabling in meson.

Signed-off-by: Thomas Monjalon <
[email protected]

Quoted 1 line
---
 drivers/baseband/turbo_sw/meson.build | 1 +
 drivers/net/memif/meson.build         | 5 +++--
 drivers/raw/ioat/meson.build          | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)
Signature · 2 lines
Kind regards,
Luca Boccassi
Acked-by on v1 3/6
#6 lore raw

Re: [dpdk-dev] [PATCH 3/6] net/mlx: fix meson build with custom dependency path

In reply to Thomas Monjalon
Quoted 21 lines · Thomas Monjalon

If rdma-core is not installed in a standard directory of the system, it is possible to specify the location of the pkgconfig file via an environment variable:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:~/rdma-core/build/lib/pkgconfig

In this case, the dependency may become mandatory to specify for the configuration tests (checking dependency symbols or fields).

Some spacing is also fixed around.

Fixes 8e4937640022 ("net/mlx4: add external allocator for Verbs

object")

Fixes 1dd7c7e38c19 ("net/mlx4: support meson build")
Fixes 96d7c62a70c7 ("net/mlx5: support meson build")

Cc:
[email protected]

Suggested-by: Luca Boccassi <
[email protected]

Quoted 1 line
Quoted 7 lines

Signed-off-by: Thomas Monjalon <
[email protected]

Quoted 1 line
---
 drivers/net/mlx4/meson.build | 9 +++++----
 drivers/net/mlx5/meson.build | 7 ++++---
 2 files changed, 9 insertions(+), 7 deletions(-)
Signature · 2 lines
Kind regards,
Luca Boccassi
Acked-by on v1 4/6
#9 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH 4/6] net/mlx: fix build with make and recent gcc

In reply to Thomas Monjalon
Quoted 29 lines · Thomas Monjalon

With VERBOSE=1, this error was seen in debug mode with gcc 9.1:

In file included from /tmp/dpdk.auto-config-h.sh.c.w0VWMi:1:
In file included from rdma-core/build/include/infiniband/mlx5dv.h:47:
In file included from rdma-core/build/include/infiniband/verbs.h:46:
In file included from rdma- core/build/include/infiniband/verbs_api.h:66:
In file included from rdma- core/build/include/infiniband/ib_user_ioctl_verbs.h:38:
include/rdma/ib_user_verbs.h:161:28: fatal error:
zero size arrays are an extension [-Wzero-length-array] __aligned_u64 driver_data0;
^
1 error generated.

As a result, buildtools/auto-config-h.sh was not generating a correct autoconf file, so the compilation was generating such error:

fatal error: redefinition of
'mlx5_ib_uapi_flow_action_packet_reformat_type'

It is fixed by disabling -pedantic option when calling auto-config- h.sh
from the makefile-based system.

Cc:
[email protected]

Quoted 7 lines

Cc:
[email protected]

Signed-off-by: Thomas Monjalon <
[email protected]

Quoted 1 line
Signature · 2 lines
Kind regards,
Luca Boccassi
Acked-by on v1 5/6
#12 lore raw

Re: [dpdk-dev] [PATCH 5/6] devtools: test compiler availability only once

In reply to Thomas Monjalon
Quoted 10 lines · Thomas Monjalon

The compilation test is skipped if the compiler is not available. In the case of gcc/arm, it was tested both in the generic function "build" and in the cross-compilation section.

By passing the compiler as argument of the generic function, the test with "command" is done only once.

This small clean-up has the benefit of introducing the compiler parameter to be used later in another improvement.

Quoted 6 lines

Signed-off-by: Thomas Monjalon <
[email protected]

Quoted 1 line
---
 devtools/test-meson-builds.sh | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)
Signature · 2 lines
Kind regards,
Luca Boccassi
Acked-by on v1 6/6
#14 lore raw

Re: [dpdk-dev] [PATCH 6/6] devtools: load target-specific compilation environment

In reply to Thomas Monjalon
Quoted 17 lines · Thomas Monjalon

In order to re-use the same test environment as with test-build.sh, the configuration file is loaded at each build, after adjusting the variable DPDK_TARGET.

This is especially useful to set the variable PKG_CONFIG_PATH, or define some meson options (without -D) in DPDK_MESON_OPTIONS.

The DPDK_TARGET values can be

        aarch64-*, powerpc64-*, x86_64-*.
The matching DPDK_TARGET values for test-build.sh are
        arm64-*, ppc_64-*, x86_64-*.
The advised expressions to use in the common configuration file are:
        if echo $DPDK_TARGET | grep -q '^a.*64-' ; then
        elif echo $DPDK_TARGET | grep -q '^p.*pc.*64' ; then
        elif echo $DPDK_TARGET | grep -q '^x86_64' ; then
        fi
Quoted 6 lines

Signed-off-by: Thomas Monjalon <
[email protected]

Quoted 1 line
---
 devtools/test-meson-builds.sh | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
Signature · 2 lines
Kind regards,
Luca Boccassi
Acked-by on v1 3/6
#7 lore raw

Re: [dpdk-dev] [PATCH 3/6] net/mlx: fix meson build with custom dependency path

In reply to Thomas Monjalon

From: Thomas Monjalon <[email protected]>

Quoted 10 lines

If rdma-core is not installed in a standard directory of the system, it is possible to specify the location of the pkgconfig file via an environment variable:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:~/rdma-core/build/lib/pkgconfig

In this case, the dependency may become mandatory to specify for the configuration tests (checking dependency symbols or fields).

Some spacing is also fixed around.

Quoted 7 lines
Fixes 8e4937640022 ("net/mlx4: add external allocator for Verbs object")
Fixes 1dd7c7e38c19 ("net/mlx4: support meson build")
Fixes 96d7c62a70c7 ("net/mlx5: support meson build")
Acked-by on v1 4/6
#10 lore raw

Re: [dpdk-dev] [PATCH 4/6] net/mlx: fix build with make and recent gcc

In reply to Thomas Monjalon

From: Thomas Monjalon <[email protected]>

Quoted 20 lines

With VERBOSE=1, this error was seen in debug mode with gcc 9.1:

In file included from /tmp/dpdk.auto-config-h.sh.c.w0VWMi:1:
In file included from rdma-core/build/include/infiniband/mlx5dv.h:47:
In file included from rdma-core/build/include/infiniband/verbs.h:46:
In file included from rdma-core/build/include/infiniband/verbs_api.h:66:
In file included from rdma- core/build/include/infiniband/ib_user_ioctl_verbs.h:38:
include/rdma/ib_user_verbs.h:161:28: fatal error:
zero size arrays are an extension [-Wzero-length-array] __aligned_u64 driver_data0;
^
1 error generated.

As a result, buildtools/auto-config-h.sh was not generating a correct autoconf file, so the compilation was generating such error:

fatal error: redefinition of
'mlx5_ib_uapi_flow_action_packet_reformat_type'

Quoted 7 lines

It is fixed by disabling -pedantic option when calling auto-config-h.sh from the makefile-based system.

Consider to create more patches to cleanup the compiler commands to ignore pedantic in the code.

Matan

author Applied
#15 lore raw
In reply to Thomas Monjalon

13/08/2019 01:03, Thomas Monjalon:

Quoted 12 lines

While testing compilation of mlx drivers,
I hit some issues and misses.
The result is 6 patches of cleanup, fixes and test improvements.

Thomas Monjalon (6):
build: remove redundant libs from pkgconfig
drivers: add some reasons for meson disabling net/mlx: fix meson build with custom dependency path net/mlx: fix build with make and recent gcc
devtools: test compiler availability only once
devtools: load target-specific compilation environment

Quoted 11 lines
 devtools/test-meson-builds.sh         | 52 +++++++++++++++++----------
 drivers/baseband/turbo_sw/meson.build |  1 +
 drivers/compress/isal/meson.build     |  1 -
 drivers/net/af_xdp/meson.build        |  1 -
 drivers/net/memif/meson.build         |  5 +--
 drivers/net/mlx4/Makefile             |  3 +-
 drivers/net/mlx4/meson.build          |  9 ++---
 drivers/net/mlx5/Makefile             |  3 +-
 drivers/net/mlx5/meson.build          |  7 ++--
 drivers/raw/ioat/meson.build          |  1 +
 10 files changed, 52 insertions(+), 31 deletions(-)

Applied