From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C17A5A0548;
	Wed, 21 Apr 2021 10:51:01 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 27A1341A14;
	Wed, 21 Apr 2021 10:50:37 +0200 (CEST)
Received: from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20])
 by mails.dpdk.org (Postfix) with ESMTP id D2B54419FB
 for <dev@dpdk.org>; Wed, 21 Apr 2021 10:50:31 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by lb.pantheon.sk (Postfix) with ESMTP id 416FBC5675;
 Wed, 21 Apr 2021 10:50:31 +0200 (CEST)
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 zfaEJODlvHMK; Wed, 21 Apr 2021 10:50:29 +0200 (CEST)
Received: from service-node1.lab.pantheon.local (unknown [46.229.239.141])
 by lb.pantheon.sk (Postfix) with ESMTP id 70551C5F51;
 Wed, 21 Apr 2021 10:50:24 +0200 (CEST)
From: =?UTF-8?q?Juraj=20Linke=C5=A1?= <juraj.linkes@pantheon.tech>
To: thomas@monjalon.net, david.marchand@redhat.com, bruce.richardson@intel.com,
 aconole@redhat.com, maicolgabriel@hotmail.com
Cc: juraj.linkes@pantheon.tech,
	dev@dpdk.org
Date: Wed, 21 Apr 2021 10:50:17 +0200
Message-Id: <1618995020-4775-6-git-send-email-juraj.linkes@pantheon.tech>
X-Mailer: git-send-email 2.7.4
In-Reply-To: <1618995020-4775-1-git-send-email-juraj.linkes@pantheon.tech>
References: <1615988163-17371-1-git-send-email-juraj.linkes@pantheon.tech>
 <1618995020-4775-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 v16 5/8] build: add aarch32 meson build flags
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
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 | 32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 18b820d53e..f4e550ad01 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -69,7 +69,15 @@ part_number_config_arm = {
 			['RTE_MAX_LCORE', 64],
 			['RTE_MAX_NUMA_NODES', 1]
 		]
-	}
+	},
+	'aarch32': {
+		'machine_args': ['-march=armv8-a',
+				 '-mfpu=neon'],
+		'flags': [
+			['RTE_ARCH_ARM_NEON_MEMCPY', false],
+			['RTE_ARCH_STRICT_ALIGN', true],
+			['RTE_ARCH_ARMv8_AARCH32', true]
+		]}
 }
 implementer_arm = {
 	'description': 'Arm',
@@ -348,14 +356,25 @@ socs = {
 dpdk_conf.set('RTE_ARCH_ARM', 1)
 dpdk_conf.set('RTE_FORCE_INTRINSICS', 1)
 
+update_flags = false
+soc_flags = []
 if dpdk_conf.get('RTE_ARCH_32')
-	# armv7 build
+	# 32-bit build
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 64)
-	dpdk_conf.set('RTE_ARCH_ARMv7', 1)
-	# the minimum architecture supported, armv7-a, needs the following,
-	machine_args += '-mfpu=neon'
+	if meson.is_cross_build()
+		update_flags = true
+		implementer_id = meson.get_cross_property('implementer_id')
+		part_number = meson.get_cross_property('part_number')
+		flags_common = []
+	else
+		# armv7 build
+		dpdk_conf.set('RTE_ARCH_ARMv7', true)
+		# the minimum architecture supported, armv7-a, needs the following,
+		machine_args += '-mfpu=neon'
+	endif
 else
 	# aarch64 build
+	update_flags = true
 	soc = get_option('platform')
 	soc_config = {}
 	if not meson.is_cross_build()
@@ -393,7 +412,6 @@ else
 		soc_config = socs.get(soc, {'not_supported': true})
 	endif
 
-	soc_flags = []
 	if soc_config.has_key('not_supported')
 		error('SoC @0@ not supported.'.format(soc))
 	elif soc_config != {}
@@ -408,7 +426,9 @@ else
 		disable_drivers += ',' + soc_config.get('disable_drivers', '')
 		enable_drivers += ',' + soc_config.get('enable_drivers', '')
 	endif
+endif
 
+if update_flags
 	if implementers.has_key(implementer_id)
 		implementer_config = implementers[implementer_id]
 	else
-- 
2.20.1