Skip to contentSkip to conversation

fix 32-bit meson builds

PATCH Superseded Bruce Richardson 6 participants 18 messages May 27, 2019 – Oct 3, 2019

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

cover fix 32-bit meson builds

This set fixes some issues seen on the automated CI system with building on 32-bit Linux distro's using meson and ninja. The fixes are to disable unsupported parts of the build, and switch the 32-bit builds to always having large file support, so that make and meson are consistent in that regard.

Bruce Richardson (3):
net/nfp: disable nfp for 32-bit meson builds
build: enable large file support on 32-bit
build: remove unnecessary large file support defines

 drivers/common/dpaax/dpaax_iova_table.c | 4 ++--
 drivers/net/nfp/meson.build             | 2 +-
 examples/vhost_crypto/meson.build       | 1 -
 examples/vhost_scsi/meson.build         | 1 -
 lib/librte_eal/linux/eal/eal_memalloc.c | 1 -
 lib/librte_eal/linux/eal/eal_memory.c   | 1 -
 lib/librte_vhost/Makefile               | 2 +-
 mk/arch/arm/rte.vars.mk                 | 2 +-
 mk/arch/i686/rte.vars.mk                | 2 +-
 9 files changed, 6 insertions(+), 10 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/3 net/nfp: disable nfp for 32-bit meson builds

From comment in the build config for the make build-system:

"NFP PMD is not supported on 32-bit"

Therefore disable NFP for 32-bit meson builds as well as for 32-bit make ones.

---
 drivers/net/nfp/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/nfp/meson.build +1 -1
index ea51ac3c3..cc68b4870 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if not is_linux
+if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
         build = false
 endif
 sources = files('nfpcore/nfp_cpp_pcie_ops.c',
Signature · 1 line
2.21.0
#2 lore raw

PATCH 2/3 build: enable large file support on 32-bit

In reply to Bruce Richardson

By default on 32-bit systems, file offsets are given as 32-bit values which prevents support for large files. While this is unlikely to be a problem, enabling large file support globally makes "make" and "meson" builds consistent, since meson always enables large file support, and without this change, the size of "struct stat" fields will be different between the two builds.

The only location where this appears to be significant is in the dpaax common code, where a printf needs to be updated for 32-bit builds.

---
 drivers/common/dpaax/dpaax_iova_table.c | 4 ++--
 mk/arch/arm/rte.vars.mk                 | 2 +-
 mk/arch/i686/rte.vars.mk                | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/common/dpaax/dpaax_iova_table.c +2 -2
index 2dd38a920..ae0af0919 100644
@@ -99,7 +99,7 @@ read_memory_node(unsigned int *count)
 		goto cleanup;
 	}
 
-	DPAAX_DEBUG("Size of device-tree mem node: %lu", statbuf.st_size);
+	DPAAX_DEBUG("Size of device-tree mem node: %" PRIu64, statbuf.st_size);
 	if (statbuf.st_size > MEM_NODE_FILE_LEN) {
 		DPAAX_DEBUG("More memory nodes available than assumed.");
 		DPAAX_DEBUG("System may not work properly!");
@@ -118,7 +118,7 @@ read_memory_node(unsigned int *count)
 	 */
 	*count = (statbuf.st_size / 16);
 	if ((*count) <= 0 || (statbuf.st_size % 16 != 0)) {
-		DPAAX_DEBUG("Invalid memory node values or count. (size=%lu)",
+		DPAAX_DEBUG("Invalid memory node values or count. (size=%" PRIu64 ")",
 			    statbuf.st_size);
 		goto cleanup;
 	}
mk/arch/arm/rte.vars.mk +1 -1
index 27b114761..dc8c10a24 100644
@@ -4,7 +4,7 @@
 ARCH  ?= arm
 CROSS ?=
 
-CPU_CFLAGS  ?= -marm -munaligned-access
+CPU_CFLAGS  ?= -marm -munaligned-access -D_FILE_OFFSET_BITS=64
 CPU_LDFLAGS ?=
 CPU_ASFLAGS ?= -felf
 
mk/arch/i686/rte.vars.mk +1 -1
index 3f48f6744..c867883f1 100644
@@ -24,7 +24,7 @@ ARCH  ?= i386
 ARCH_DIR := x86
 CROSS ?=
 
-CPU_CFLAGS  ?= -m32
+CPU_CFLAGS  ?= -m32 -D_FILE_OFFSET_BITS=64
 CPU_LDFLAGS ?= -melf_i386
 CPU_ASFLAGS ?= -felf
 
Signature · 1 line
2.21.0
#3 lore raw

PATCH 3/3 build: remove unnecessary large file support defines

In reply to Bruce Richardson

Since we now always use _FILE_OFFSET_BITS=64 flag when building DPDK, we can remove the Makefile and C-file #defines setting it individually for parts of the build.

---
 examples/vhost_crypto/meson.build       | 1 -
 examples/vhost_scsi/meson.build         | 1 -
 lib/librte_eal/linux/eal/eal_memalloc.c | 1 -
 lib/librte_eal/linux/eal/eal_memory.c   | 1 -
 lib/librte_vhost/Makefile               | 2 +-
 5 files changed, 1 insertion(+), 5 deletions(-)
examples/vhost_crypto/meson.build +0 -1
index 8e9860f03..2485f3bd1 100644
@@ -9,7 +9,6 @@
 build = dpdk_conf.has('RTE_LIBRTE_VHOST')
 allow_experimental_apis = true
 deps += ['vhost', 'cryptodev']
-cflags += ['-D_FILE_OFFSET_BITS=64']
 sources = files(
 	'main.c'
 )
examples/vhost_scsi/meson.build +0 -1
index 2972e4d61..77e5201bd 100644
@@ -15,7 +15,6 @@ if not cc.has_header('linux/virtio_scsi.h')
 endif
 
 deps += 'vhost'
-cflags += ['-D_FILE_OFFSET_BITS=64']
 sources = files(
 	'scsi.c', 'vhost_scsi.c'
 )
lib/librte_eal/linux/eal/eal_memalloc.c +0 -1
index 1e9ebb86d..b1849a28a 100644
@@ -2,7 +2,6 @@
  * Copyright(c) 2017-2018 Intel Corporation
  */
 
-#define _FILE_OFFSET_BITS 64
 #include <errno.h>
 #include <stdarg.h>
 #include <stdbool.h>
lib/librte_eal/linux/eal/eal_memory.c +0 -1
index 416dad898..40a0f687a 100644
@@ -3,7 +3,6 @@
  * Copyright(c) 2013 6WIND S.A.
  */
 
-#define _FILE_OFFSET_BITS 64
 #include <errno.h>
 #include <fcntl.h>
 #include <stdarg.h>
lib/librte_vhost/Makefile +1 -1
index 5dd318987..8623e91c0 100644
@@ -11,7 +11,7 @@ EXPORT_MAP := rte_vhost_version.map
 LIBABIVER := 4
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
-CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64
+CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
 CFLAGS += -I vhost_user
 CFLAGS += -fno-strict-aliasing
 LDLIBS += -lpthread
Signature · 1 line
2.21.0
#4 lore raw
In reply to Bruce Richardson
Quoted 15 lines · Bruce Richardson

This set fixes some issues seen on the automated CI system with building
on 32-bit Linux distro's using meson and ninja. The fixes are to disable
unsupported parts of the build, and switch the 32-bit builds to always
having large file support, so that make and meson are consistent in that
regard.

Bruce Richardson (3):
net/nfp: disable nfp for 32-bit meson builds
build: enable large file support on 32-bit
build: remove unnecessary large file support defines

Quoted 10 lines
 drivers/common/dpaax/dpaax_iova_table.c | 4 ++--
 drivers/net/nfp/meson.build             | 2 +-
 examples/vhost_crypto/meson.build       | 1 -
 examples/vhost_scsi/meson.build         | 1 -
 lib/librte_eal/linux/eal/eal_memalloc.c | 1 -
 lib/librte_eal/linux/eal/eal_memory.c   | 1 -
 lib/librte_vhost/Makefile               | 2 +-
 mk/arch/arm/rte.vars.mk                 | 2 +-
 mk/arch/i686/rte.vars.mk                | 2 +-
 9 files changed, 6 insertions(+), 10 deletions(-)
Signature · 2 lines
Kind regards,
Luca Boccassi
#5 lore raw

v2 cover fix 32-bit meson builds

In reply to Bruce Richardson

This set fixes some issues seen on the automated CI system with building on 32-bit Linux distro's using meson and ninja. The fixes are to disable unsupported parts of the build, and switch the 32-bit builds to always having large file support, so that make and meson are consistent in that regard.

V2: add two additional patches to fix clang builds. This allows the
test-meson-builds.sh script to run successfully on 32-bit Ubuntu 16.04 systems.

Bruce Richardson (5):
net/nfp: disable nfp for 32-bit meson builds
build: enable large file support on 32-bit
build: remove unnecessary large file support defines
eal: mark unused function in 32-bit builds
build: add libatomic dependency for 32-bit clang compile

 drivers/common/dpaax/dpaax_iova_table.c | 4 ++--
 drivers/event/octeontx/meson.build      | 5 +++++
 drivers/event/opdl/meson.build          | 5 +++++
 drivers/net/nfp/meson.build             | 2 +-
 examples/vhost_crypto/meson.build       | 1 -
 examples/vhost_scsi/meson.build         | 1 -
 lib/librte_eal/linux/eal/eal_memalloc.c | 1 -
 lib/librte_eal/linux/eal/eal_memory.c   | 2 +-
 lib/librte_rcu/meson.build              | 5 +++++
 lib/librte_vhost/Makefile               | 2 +-
 mk/arch/arm/rte.vars.mk                 | 2 +-
 mk/arch/i686/rte.vars.mk                | 2 +-
 12 files changed, 22 insertions(+), 10 deletions(-)
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 1/5 net/nfp: disable nfp for 32-bit meson builds

From comment in the build config for the make build-system:

"NFP PMD is not supported on 32-bit"

Therefore disable NFP for 32-bit meson builds as well as for 32-bit make ones.

---
 drivers/net/nfp/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/nfp/meson.build +1 -1
index ea51ac3..8c87c5b 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-if not is_linux
+if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
         build = false
 endif
 sources = files('nfpcore/nfp_cpp_pcie_ops.c',
Signature · 1 line
2.7.4
#7 lore raw

PATCH v2 2/5 build: enable large file support on 32-bit

In reply to Bruce Richardson

By default on 32-bit systems, file offsets are given as 32-bit values which prevents support for large files. While this is unlikely to be a problem, enabling large file support globally makes "make" and "meson" builds consistent, since meson always enables large file support, and without this change, the size of "struct stat" fields will be different between the two builds.

The only location where this appears to be significant is in the dpaax common code, where a printf needs to be updated for 32-bit builds.

---
 drivers/common/dpaax/dpaax_iova_table.c | 4 ++--
 mk/arch/arm/rte.vars.mk                 | 2 +-
 mk/arch/i686/rte.vars.mk                | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/common/dpaax/dpaax_iova_table.c +2 -2
index 2dd38a9..ae0af09 100644
@@ -99,7 +99,7 @@ read_memory_node(unsigned int *count)
 		goto cleanup;
 	}
 
-	DPAAX_DEBUG("Size of device-tree mem node: %lu", statbuf.st_size);
+	DPAAX_DEBUG("Size of device-tree mem node: %" PRIu64, statbuf.st_size);
 	if (statbuf.st_size > MEM_NODE_FILE_LEN) {
 		DPAAX_DEBUG("More memory nodes available than assumed.");
 		DPAAX_DEBUG("System may not work properly!");
@@ -118,7 +118,7 @@ read_memory_node(unsigned int *count)
 	 */
 	*count = (statbuf.st_size / 16);
 	if ((*count) <= 0 || (statbuf.st_size % 16 != 0)) {
-		DPAAX_DEBUG("Invalid memory node values or count. (size=%lu)",
+		DPAAX_DEBUG("Invalid memory node values or count. (size=%" PRIu64 ")",
 			    statbuf.st_size);
 		goto cleanup;
 	}
mk/arch/arm/rte.vars.mk +1 -1
index 27b1147..dc8c10a 100644
@@ -4,7 +4,7 @@
 ARCH  ?= arm
 CROSS ?=
 
-CPU_CFLAGS  ?= -marm -munaligned-access
+CPU_CFLAGS  ?= -marm -munaligned-access -D_FILE_OFFSET_BITS=64
 CPU_LDFLAGS ?=
 CPU_ASFLAGS ?= -felf
 
mk/arch/i686/rte.vars.mk +1 -1
index 3f48f67..c867883 100644
@@ -24,7 +24,7 @@ ARCH  ?= i386
 ARCH_DIR := x86
 CROSS ?=
 
-CPU_CFLAGS  ?= -m32
+CPU_CFLAGS  ?= -m32 -D_FILE_OFFSET_BITS=64
 CPU_LDFLAGS ?= -melf_i386
 CPU_ASFLAGS ?= -felf
 
Signature · 1 line
2.7.4
Acked-by on v2 2/5
#8 lore raw

Re: [dpdk-dev] [PATCH v2 2/5] build: enable large file support on 32-bit

Quoted 20 lines

-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Tuesday, May 28, 2019 4:38 PM
To: [email protected]
Cc: Shreyansh Jain <[email protected]>; Alejandro Lucero <[email protected]>; Anatoly Burakov <[email protected]>; [email protected]; Maxime Coquelin <[email protected]>; Zhihong Wang <[email protected]>; Luca Boccassi <[email protected]>; Zhang XuemingX <[email protected]>; Bruce Richardson <[email protected]>
Subject: [PATCH v2 2/5] build: enable large file support on 32-bit

By default on 32-bit systems, file offsets are given as 32-bit values which prevents support for large files. While this is unlikely to be a problem, enabling large file support globally makes "make" and "meson" builds consistent, since meson always enables large file support, and without this change, the size of "struct stat" fields will be different between the two builds.

Quoted 3 lines

The only location where this appears to be significant is in the dpaax common code, where a printf needs to be updated for 32-bit builds.

From DPAAX perspective, I am not worried about 32bit and dependency of large file support. So, this 'don't care' from my side.

Quoted 9 lines
---
 drivers/common/dpaax/dpaax_iova_table.c | 4 ++--
 mk/arch/arm/rte.vars.mk                 | 2 +-
 mk/arch/i686/rte.vars.mk                | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

If this patch is merged, please ignore [1]

[1] http://patches.dpdk.org/patch/53798/

#9 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH v2 2/5] build: enable large file support on 32-bit

In reply to Bruce Richardson
Quoted 59 lines · Bruce Richardson

By default on 32-bit systems, file offsets are given as 32-bit values which prevents support for large files. While this is unlikely to be a problem, enabling large file support globally makes "make" and "meson" builds consistent, since meson always enables large file support, and without this change, the size of "struct stat" fields will be different between the two builds.

The only location where this appears to be significant is in the dpaax common code, where a printf needs to be updated for 32-bit builds.

---
 drivers/common/dpaax/dpaax_iova_table.c | 4 ++--
 mk/arch/arm/rte.vars.mk                 | 2 +-
 mk/arch/i686/rte.vars.mk                | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/common/dpaax/dpaax_iova_table.c +2 -2
index 2dd38a9..ae0af09 100644
@@ -99,7 +99,7 @@ read_memory_node(unsigned int *count)
 		goto cleanup;
 	}
 
-	DPAAX_DEBUG("Size of device-tree mem node: %lu", statbuf.st_size);
+	DPAAX_DEBUG("Size of device-tree mem node: %" PRIu64, statbuf.st_size);
 	if (statbuf.st_size > MEM_NODE_FILE_LEN) {
 		DPAAX_DEBUG("More memory nodes available than assumed.");
 		DPAAX_DEBUG("System may not work properly!");
@@ -118,7 +118,7 @@ read_memory_node(unsigned int *count)
 	 */
 	*count = (statbuf.st_size / 16);
 	if ((*count) <= 0 || (statbuf.st_size % 16 != 0)) {
-		DPAAX_DEBUG("Invalid memory node values or count. (size=%lu)",
+		DPAAX_DEBUG("Invalid memory node values or count. (size=%" PRIu64 ")",
 			    statbuf.st_size);
 		goto cleanup;
 	}
mk/arch/arm/rte.vars.mk +1 -1
index 27b1147..dc8c10a 100644
@@ -4,7 +4,7 @@
 ARCH  ?= arm
 CROSS ?=
 
-CPU_CFLAGS  ?= -marm -munaligned-access
+CPU_CFLAGS  ?= -marm -munaligned-access -D_FILE_OFFSET_BITS=64
 CPU_LDFLAGS ?=
 CPU_ASFLAGS ?= -felf
 
mk/arch/i686/rte.vars.mk +0 -0
index 3f48f67..c867883 100644

mk/arch/i686/rte.vars.mk ARCH ?= i386 · line 27

Quoted 5 lines
mk/arch/i686/rte.vars.mk +1 -1
@@ -24,7 +24,7 @@ ARCH  ?= i386
 ARCH_DIR := x86
 CROSS ?=
 
-CPU_CFLAGS  ?= -m32
+CPU_CFLAGS  ?= -m32 -D_FILE_OFFSET_BITS=64

Previously, 'off_t' was "long int" both for 32-bit or 64-bit, so in the printf using "%ld" was OK.
But with this change 'off_t' becomes 'uint64_t' and just using '%ld' in the format will cause error, as it is happening in 'mlx5' [1].

All 'off_t' usage should be checked for this change.

Shahaf, Yongseok,
Can you please send a fix for below build error?

Thanks,
ferruh

[1]
In file included from .../dpdk/i686-native-linuxapp-gcc/include/rte_compat.h:8,

                 from .../dpdk/i686-native-linuxapp-gcc/include/rte_mbuf.h:35,
                 from .../dpdk/drivers/net/mlx5/mlx5_txq.c:24:

.../dpdk/drivers/net/mlx5/mlx5_txq.c: In function ‘mlx5_txq_ibv_new’:
.../dpdk/drivers/net/mlx5/mlx5_defs.h:14:26: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘off_t’ {aka ‘long long int’} [-Werror=format=]
14 | #define MLX5_DRIVER_NAME "net_mlx5"

      |                          ^~~~~~~~~~

.../dpdk/i686-native-linuxapp-gcc/include/rte_common.h:642:27: note: in definition of macro ‘RTE_FMT’
642 | #define RTE_FMT(fmt, ...) fmt "%.0s", __VA_ARGS__ ""
| ^~~
.../dpdk/drivers/net/mlx5/mlx5_utils.h:79:11: note: in expansion of macro ‘MLX5_DRIVER_NAME’

   79 |   RTE_FMT(MLX5_DRIVER_NAME ": " \
      |           ^~~~~~~~~~~~~~~~
.../dpdk/drivers/net/mlx5/mlx5_utils.h:101:2: note: in expansion of macro
‘PMD_DRV_LOG___’
  101 |  PMD_DRV_LOG___(level, __VA_ARGS__)
      |  ^~~~~~~~~~~~~~
.../dpdk/drivers/net/mlx5/mlx5_utils.h:103:2: note: in expansion of macro
‘PMD_DRV_LOG__’
  103 |  PMD_DRV_LOG__(level, s "\n", __VA_ARGS__)
      |  ^~~~~~~~~~~~~
.../dpdk/drivers/net/mlx5/mlx5_utils.h:109:2: note: in expansion of macro
‘PMD_DRV_LOG_’
  109 |  PMD_DRV_LOG_(level, \
      |  ^~~~~~~~~~~~
.../dpdk/drivers/net/mlx5/mlx5_txq.c:569:3: note: in expansion of macro ‘DRV_LOG’
  569 |   DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%lx",
      |   ^~~~~~~
.../dpdk/drivers/net/mlx5/mlx5_txq.c:569:48: note: format string is defined here
  569 |   DRV_LOG(DEBUG, "port %u: uar_mmap_offset 0x%lx",
      |                                              ~~^
      |                                                |
      |                                                long unsigned int
      |                                              %llx

cc1: all warnings being treated as errors

#10 lore raw

PATCH v2 3/5 build: remove unnecessary large file support defines

In reply to Bruce Richardson

Since we now always use _FILE_OFFSET_BITS=64 flag when building DPDK, we can remove the Makefile and C-file #defines setting it individually for parts of the build.

---
 examples/vhost_crypto/meson.build       | 1 -
 examples/vhost_scsi/meson.build         | 1 -
 lib/librte_eal/linux/eal/eal_memalloc.c | 1 -
 lib/librte_eal/linux/eal/eal_memory.c   | 1 -
 lib/librte_vhost/Makefile               | 2 +-
 5 files changed, 1 insertion(+), 5 deletions(-)
examples/vhost_crypto/meson.build +0 -1
index 8e9860f..2485f3b 100644
@@ -9,7 +9,6 @@
 build = dpdk_conf.has('RTE_LIBRTE_VHOST')
 allow_experimental_apis = true
 deps += ['vhost', 'cryptodev']
-cflags += ['-D_FILE_OFFSET_BITS=64']
 sources = files(
 	'main.c'
 )
examples/vhost_scsi/meson.build +0 -1
index 2972e4d..77e5201 100644
@@ -15,7 +15,6 @@ if not cc.has_header('linux/virtio_scsi.h')
 endif
 
 deps += 'vhost'
-cflags += ['-D_FILE_OFFSET_BITS=64']
 sources = files(
 	'scsi.c', 'vhost_scsi.c'
 )
lib/librte_eal/linux/eal/eal_memalloc.c +0 -1
index 1e9ebb8..b1849a2 100644
@@ -2,7 +2,6 @@
  * Copyright(c) 2017-2018 Intel Corporation
  */
 
-#define _FILE_OFFSET_BITS 64
 #include <errno.h>
 #include <stdarg.h>
 #include <stdbool.h>
lib/librte_eal/linux/eal/eal_memory.c +0 -1
index 416dad8..40a0f68 100644
@@ -3,7 +3,6 @@
  * Copyright(c) 2013 6WIND S.A.
  */
 
-#define _FILE_OFFSET_BITS 64
 #include <errno.h>
 #include <fcntl.h>
 #include <stdarg.h>
lib/librte_vhost/Makefile +1 -1
index 5dd3189..8623e91 100644
@@ -11,7 +11,7 @@ EXPORT_MAP := rte_vhost_version.map
 LIBABIVER := 4
 
 CFLAGS += -DALLOW_EXPERIMENTAL_API
-CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64
+CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
 CFLAGS += -I vhost_user
 CFLAGS += -fno-strict-aliasing
 LDLIBS += -lpthread
Signature · 1 line
2.7.4
#11 lore raw

PATCH v2 4/5 eal: mark unused function in 32-bit builds

In reply to Bruce Richardson

The get_socket_mem_size() function is only used in 64-bit builds, causing clang to warn about it for 32-bit builds. Add the __rte_unused attribute to the function to silence the warning.

---
 lib/librte_eal/linux/eal/eal_memory.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_eal/linux/eal/eal_memory.c +1 -0
index 40a0f68..1853ace 100644
@@ -1088,6 +1088,7 @@ remap_needed_hugepages(struct hugepage_file *hugepages, int n_pages)
 	return 0;
 }
 
+__rte_unused /* function is unused on 32-bit builds */
 static inline uint64_t
 get_socket_mem_size(int socket)
 {
Signature · 1 line
2.7.4
Acked-by on v2 4/5
#12 lore raw

Re: [dpdk-dev] [PATCH v2 4/5] eal: mark unused function in 32-bit builds

Quoted 25 lines · Bruce Richardson

The get_socket_mem_size() function is only used in 64-bit builds, causing clang to warn about it for 32-bit builds. Add the __rte_unused
attribute to the function to silence the warning.

Signed-off-by: Bruce Richardson <
[email protected]

Quoted 1 line
---
 lib/librte_eal/linux/eal/eal_memory.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_eal/linux/eal/eal_memory.c +1 -0
index 40a0f68..1853ace 100644
@@ -1088,6 +1088,7 @@ remap_needed_hugepages(struct hugepage_file
 *hugepages, int n_pages)
 	return 0;
 }
 
+__rte_unused /* function is unused on 32-bit builds */
 static inline uint64_t
 get_socket_mem_size(int socket)
Quoted 1 line

{

Signature · 2 lines
Kind regards,
Luca Boccassi
#13 lore raw

PATCH v2 5/5 build: add libatomic dependency for 32-bit clang compile

In reply to Bruce Richardson

When compiling with clang on 32-bit platforms, we are missing copies of 64-bit atomic functions. We can solve this by linking against libatomic for the drivers and libs which need those atomic ops.

---
 drivers/event/octeontx/meson.build | 5 +++++
 drivers/event/opdl/meson.build     | 5 +++++
 lib/librte_rcu/meson.build         | 5 +++++
 3 files changed, 15 insertions(+)
drivers/event/octeontx/meson.build +5 -0
index 2b74bb6..3f83be6 100644
@@ -11,3 +11,8 @@ sources = files('ssovf_worker.c',
 )
 
 deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev', 'pmd_octeontx']
+
+# for clang 32-bit compiles we need libatomic for 64-bit atomic ops
+if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false
+	ext_deps += cc.find_library('atomic')
+endif
drivers/event/opdl/meson.build +5 -0
index cc6029c..e1cfb2d 100644
@@ -9,3 +9,8 @@ sources = files(
 	'opdl_test.c',
 )
 deps += ['bus_vdev']
+
+# for clang 32-bit compiles we need libatomic for 64-bit atomic ops
+if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false
+	ext_deps += cc.find_library('atomic')
+endif
lib/librte_rcu/meson.build +5 -0
index 0c2d5a2..43edb87 100644
@@ -5,3 +5,8 @@ allow_experimental_apis = true
 
 sources = files('rte_rcu_qsbr.c')
 headers = files('rte_rcu_qsbr.h')
+
+# for clang 32-bit compiles we need libatomic for 64-bit atomic ops
+if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false
+	ext_deps += cc.find_library('atomic')
+endif
Signature · 1 line
2.7.4
Acked-by on v2 5/5
#14 lore raw

Re: [dpdk-dev] [PATCH v2 5/5] build: add libatomic dependency for 32-bit clang compile

Quoted 47 lines · Bruce Richardson

When compiling with clang on 32-bit platforms, we are missing copies of 64-bit atomic functions. We can solve this by linking against libatomic for the drivers and libs which need those atomic ops.

Signed-off-by: Bruce Richardson <
[email protected]

Quoted 1 line
---
 drivers/event/octeontx/meson.build | 5 +++++
 drivers/event/opdl/meson.build     | 5 +++++
 lib/librte_rcu/meson.build         | 5 +++++
 3 files changed, 15 insertions(+)
drivers/event/octeontx/meson.build +0 -0
index 2b74bb6..3f83be6 100644
@@ -11,3 +11,8 @@ sources = files('ssovf_worker.c',
 )
 
 deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev',

'pmd_octeontx']

drivers/event/octeontx/meson.build +5 -0
+
+# for clang 32-bit compiles we need libatomic for 64-bit atomic ops
+if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false
+	ext_deps += cc.find_library('atomic')
+endif
drivers/event/opdl/meson.build +5 -0
index cc6029c..e1cfb2d 100644
@@ -9,3 +9,8 @@ sources = files(
 	'opdl_test.c',
 )
 deps += ['bus_vdev']
+
+# for clang 32-bit compiles we need libatomic for 64-bit atomic ops
+if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false
+	ext_deps += cc.find_library('atomic')
+endif
lib/librte_rcu/meson.build +0 -0
index 0c2d5a2..43edb87 100644

lib/librte_rcu/meson.build allow_experimental_apis = true · line 12

Quoted 8 lines
lib/librte_rcu/meson.build +5 -0
@@ -5,3 +5,8 @@ allow_experimental_apis = true
 
 sources = files('rte_rcu_qsbr.c')
 headers = files('rte_rcu_qsbr.h')
+
+# for clang 32-bit compiles we need libatomic for 64-bit atomic ops
+if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false
+	ext_deps += cc.find_library('atomic')
+endif
Signature · 2 lines
Kind regards,
Luca Boccassi
#15 lore raw
In reply to Bruce Richardson

28/05/2019 13:07, Bruce Richardson:

Quoted 10 lines

This set fixes some issues seen on the automated CI system with building on 32-bit Linux distro's using meson and ninja. The fixes are to disable unsupported parts of the build, and switch the 32-bit builds to always having large file support, so that make and meson are consistent in that regard.

V2: add two additional patches to fix clang builds. This allows the
test-meson-builds.sh script to run successfully on 32-bit Ubuntu 16.04 systems.

Quoted 6 lines

Bruce Richardson (5):
net/nfp: disable nfp for 32-bit meson builds
build: enable large file support on 32-bit
build: remove unnecessary large file support defines
eal: mark unused function in 32-bit builds
build: add libatomic dependency for 32-bit clang compile

Applied, thanks

#16 lore raw
In reply to Bruce Richardson
Quoted 10 lines · Bruce Richardson

This set fixes some issues seen on the automated CI system with building on 32-bit Linux distro's using meson and ninja. The fixes are to disable unsupported parts of the build, and switch the 32-bit builds to always having large file support, so that make and meson are consistent in that regard.

V2: add two additional patches to fix clang builds. This allows the
test-meson-builds.sh script to run successfully on 32-bit Ubuntu 16.04 systems.

Quoted 7 lines

Bruce Richardson (5):
net/nfp: disable nfp for 32-bit meson builds
build: enable large file support on 32-bit
build: remove unnecessary large file support defines
eal: mark unused function in 32-bit builds
build: add libatomic dependency for 32-bit clang compile

Hi Bruce, Intel validation team reported failures with some 32-bit builds with meson on 18.11.3-rc1. I've tested with these patches and it fixes the problems.

I also took d23e141ffa52 ("build: set RTE_ARCH_64 based on pointer size"), to avoid rebasing the other patches to check 'void *' size multiple times.

Any objection to applying for 18.11 branch?

Kevin.

Quoted 14 lines
 drivers/common/dpaax/dpaax_iova_table.c | 4 ++--
 drivers/event/octeontx/meson.build      | 5 +++++
 drivers/event/opdl/meson.build          | 5 +++++
 drivers/net/nfp/meson.build             | 2 +-
 examples/vhost_crypto/meson.build       | 1 -
 examples/vhost_scsi/meson.build         | 1 -
 lib/librte_eal/linux/eal/eal_memalloc.c | 1 -
 lib/librte_eal/linux/eal/eal_memory.c   | 2 +-
 lib/librte_rcu/meson.build              | 5 +++++
 lib/librte_vhost/Makefile               | 2 +-
 mk/arch/arm/rte.vars.mk                 | 2 +-
 mk/arch/i686/rte.vars.mk                | 2 +-
 12 files changed, 22 insertions(+), 10 deletions(-)
#17 lore raw
Quoted 23 lines · Kevin Traynor
Quoted 10 lines · Bruce Richardson

This set fixes some issues seen on the automated CI system with building on 32-bit Linux distro's using meson and ninja. The fixes are to disable unsupported parts of the build, and switch the 32-bit builds to always having large file support, so that make and meson are consistent in that regard.

V2: add two additional patches to fix clang builds. This allows the
test-meson-builds.sh script to run successfully on 32-bit Ubuntu 16.04 systems.

Quoted 7 lines

Bruce Richardson (5):
net/nfp: disable nfp for 32-bit meson builds
build: enable large file support on 32-bit
build: remove unnecessary large file support defines
eal: mark unused function in 32-bit builds
build: add libatomic dependency for 32-bit clang compile

Hi Bruce, Intel validation team reported failures with some 32-bit builds with meson on 18.11.3-rc1. I've tested with these patches and it fixes the problems.

Quoted 8 lines

I also took d23e141ffa52 ("build: set RTE_ARCH_64 based on pointer size"), to avoid rebasing the other patches to check 'void *' size multiple times.

Any objection to applying for 18.11 branch?

Kevin.

Nope, no objections.

Thanks.