From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B2BD4A04DB;
	Fri, 11 Dec 2020 09:28:03 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 4C744C9A4;
	Fri, 11 Dec 2020 09:27:07 +0100 (CET)
Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20])
 by dpdk.org (Postfix) with ESMTP id 1EFFBAC9C
 for <dev@dpdk.org>; Fri, 11 Dec 2020 09:27:01 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by lb.pantheon.sk (Postfix) with ESMTP id 90BF9BD2B8;
 Fri, 11 Dec 2020 09:26:59 +0100 (CET)
X-Virus-Scanned: amavisd-new at siecit.sk
Received: from lb.pantheon.sk ([127.0.0.1])
 by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id gGnjAalROwBG; Fri, 11 Dec 2020 09:26:58 +0100 (CET)
Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141])
 by lb.pantheon.sk (Postfix) with ESMTP id 3EA2DBD2B9;
 Fri, 11 Dec 2020 09:26:56 +0100 (CET)
From: =?UTF-8?q?Juraj=20Linke=C5=A1?= <juraj.linkes@pantheon.tech>
To: thomas@monjalon.net, bruce.richardson@intel.com, aconole@redhat.com,
 maicolgabriel@hotmail.com
Cc: dev@dpdk.org,
	juraj.linkes@pantheon.tech
Date: Fri, 11 Dec 2020 09:26:50 +0100
Message-Id: <1607675213-12061-4-git-send-email-juraj.linkes@pantheon.tech>
X-Mailer: git-send-email 2.7.4
In-Reply-To: <1607675213-12061-1-git-send-email-juraj.linkes@pantheon.tech>
References: <1607518771-7564-1-git-send-email-juraj.linkes@pantheon.tech>
 <1607675213-12061-1-git-send-email-juraj.linkes@pantheon.tech>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v12 3/6] build: add aarch32 meson build flags
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Add aarch32 extra build flags and aarch32 machine flags to generic
machine args.
Also modify how arm flags are updated in meson build - for 32-bit build,
update only if cross-compiling.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/meson.build | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 42b4e43c7..19a7ea194 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -62,6 +62,11 @@ flags_armada = [
 	['RTE_MAX_LCORE', 16]]
 
 flags_default_extra = []
+flags_aarch32_extra = [
+        ['RTE_ARCH_ARM_NEON_MEMCPY', false],
+        ['RTE_ARCH_STRICT_ALIGN', true],
+        ['RTE_EAL_NUMA_AWARE_HUGEPAGES', false],
+        ['RTE_MAX_LCORE', 256]]
 flags_thunderx_extra = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -93,6 +98,7 @@ flags_n1generic_extra = [
 machine_args_generic = [
 	['default', ['-march=armv8-a+crc', '-moutline-atomics']],
 	['native', ['-march=native']],
+	['aarch32', ['-march=armv8-a', '-mfpu=neon'], flags_aarch32_extra],
 	['0xd03', ['-mcpu=cortex-a53']],
 	['0xd04', ['-mcpu=cortex-a35']],
 	['0xd07', ['-mcpu=cortex-a57']],
@@ -133,21 +139,28 @@ impl_dpaa = ['NXP DPAA', flags_dpaa, machine_args_generic]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
-
+update_flags = false
 if dpdk_conf.get('RTE_ARCH_32')
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
 	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
 	# the minimum architecture supported, armv7-a, needs the following,
 	# mk/machine/armv7a/rte.vars.mk sets it too
-	machine_args += '-mfpu=neon'
+	if meson.is_cross_build()
+		update_flags = true
+		impl_id = meson.get_cross_property('implementor_id', 'aarch32')
+		impl_pn = meson.get_cross_property('implementor_pn', 'default')
+		machine = get_variable('impl_' + impl_id)
+	else
+		machine_args += '-mfpu=neon'
+	endif
 else
+	update_flags = true
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
 	machine = []
 	cmd_generic = ['generic', '', '', 'default', '']
 	cmd_output = cmd_generic # Set generic by default
-	machine_args = [] # Clear previous machine args
 	if arm_force_default_march and not meson.is_cross_build()
 		machine = impl_generic
 		impl_pn = 'default'
@@ -175,7 +188,10 @@ else
 		impl_pn = meson.get_cross_property('implementor_pn', 'default')
 		machine = get_variable('impl_' + impl_id)
 	endif
+endif
 
+if update_flags == true
+	machine_args = [] # Clear previous machine args
 	# Apply Common Defaults. These settings may be overwritten by machine
 	# settings later.
 	foreach flag: flags_common_default
-- 
2.20.1