From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 5B2DFA046A
	for <public@inbox.dpdk.org>; Tue, 28 May 2019 13:08:13 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 35C211B94E;
	Tue, 28 May 2019 13:08:12 +0200 (CEST)
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by dpdk.org (Postfix) with ESMTP id 0BEB64C8B;
 Tue, 28 May 2019 13:08:06 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga007.jf.intel.com ([10.7.209.58])
 by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 28 May 2019 04:08:06 -0700
X-ExtLoop1: 1
Received: from silpixa00399126.ir.intel.com (HELO
 silpixa00399126.ger.corp.intel.com) ([10.237.223.2])
 by orsmga007.jf.intel.com with ESMTP; 28 May 2019 04:08:04 -0700
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Shreyansh Jain <shreyansh.jain@nxp.com>,
 Alejandro Lucero <alejandro.lucero@netronome.com>,
 Anatoly Burakov <anatoly.burakov@intel.com>, stable@dpdk.org,
 Maxime Coquelin <maxime.coquelin@redhat.com>,
 Zhihong Wang <zhihong.wang@intel.com>, Luca Boccassi <bluca@debian.org>,
 Zhang XuemingX <xuemingx.zhang@intel.com>,
 Bruce Richardson <bruce.richardson@intel.com>
Date: Tue, 28 May 2019 12:07:45 +0100
Message-Id: <20190528110748.10772-3-bruce.richardson@intel.com>
X-Mailer: git-send-email 2.21.0
In-Reply-To: <20190528110748.10772-1-bruce.richardson@intel.com>
References: <20190527161509.50252-1-bruce.richardson@intel.com>
 <20190528110748.10772-1-bruce.richardson@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-stable] [PATCH v2 2/5] build: enable large file support on
	32-bit
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

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.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
---
 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(-)

diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax/dpaax_iova_table.c
index 2dd38a9..ae0af09 100644
--- a/drivers/common/dpaax/dpaax_iova_table.c
+++ b/drivers/common/dpaax/dpaax_iova_table.c
@@ -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;
 	}
diff --git a/mk/arch/arm/rte.vars.mk b/mk/arch/arm/rte.vars.mk
index 27b1147..dc8c10a 100644
--- a/mk/arch/arm/rte.vars.mk
+++ b/mk/arch/arm/rte.vars.mk
@@ -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
 
diff --git a/mk/arch/i686/rte.vars.mk b/mk/arch/i686/rte.vars.mk
index 3f48f67..c867883 100644
--- a/mk/arch/i686/rte.vars.mk
+++ b/mk/arch/i686/rte.vars.mk
@@ -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
 
-- 
2.7.4