DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com,
	harry.van.haaren@intel.com
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH] build: add support for vendor specific ARM cross builds
Date: Fri, 19 Jan 2018 18:45:08 +0530	[thread overview]
Message-ID: <20180119131508.7768-1-pbhagavatula@caviumnetworks.com> (raw)

Add various vendor specific cross build targets.
This can be verified by using linaro toolchain and running

	meson build --cross-file config/arm/arch64_armv8_<cpu>_cross

In future more cross build targets can be added.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 config/arm/arch64_armv8_generic_cross  | 10 +++++++
 config/arm/arch64_armv8_thunderx_cross | 13 +++++++++
 config/arm/meson.build                 | 52 +++++++++++++++++++---------------
 3 files changed, 52 insertions(+), 23 deletions(-)
 create mode 100644 config/arm/arch64_armv8_generic_cross
 create mode 100644 config/arm/arch64_armv8_thunderx_cross

diff --git a/config/arm/arch64_armv8_generic_cross b/config/arm/arch64_armv8_generic_cross
new file mode 100644
index 000000000..3b4d3c469
--- /dev/null
+++ b/config/arm/arch64_armv8_generic_cross
@@ -0,0 +1,10 @@
+[binaries]
+c = 'aarch64-linux-gnu-gcc'
+cpp = 'aarch64-linux-gnu-cpp'
+ar = 'aarch64-linux-gnu-gcc-ar'
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
diff --git a/config/arm/arch64_armv8_thunderx_cross b/config/arm/arch64_armv8_thunderx_cross
new file mode 100644
index 000000000..7ff34af74
--- /dev/null
+++ b/config/arm/arch64_armv8_thunderx_cross
@@ -0,0 +1,13 @@
+[binaries]
+c = 'aarch64-linux-gnu-gcc'
+cpp = 'aarch64-linux-gnu-cpp'
+ar = 'aarch64-linux-gnu-gcc-ar'
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+implementor_id = '0x43'
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 62af5e68a..79e453997 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -34,6 +34,8 @@ else
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 	dpdk_conf.set('RTE_ARCH_64', 1)
 
+	machine = []
+	cmd_output = []
 	if not meson.is_cross_build()
 		# The script returns ['Implementor', 'Variant', 'Architecture',
 		# 'Primary Part number', 'Revision']
@@ -46,31 +48,35 @@ else
 			machine_args = [] # Clear previous machine args
 			cmd_output = cmd.stdout().strip().split(' ')
 			machine = get_variable('impl_' + cmd_output[0])
-			message('Implementor : ' + machine[0])
+		endif
+	else
+		impl_id = meson.get_cross_property('implementor_id', 'generic')
+		machine = get_variable('impl_' + impl_id, 'generic')
+	endif
 
-			foreach flag: machine[1]
-				dpdk_conf.set(flag[0], flag[1])
+	if machine != 'generic'
+		message('Implementor : ' + machine[0])
+		foreach flag: machine[1]
+			dpdk_conf.set(flag[0], flag[1])
+		endforeach
+		# Primary part number based mcpu flags are supported
+		# for gcc versions > 7
+		if cc.version().version_compare('<7.0') or cmd_output.length() == 0
+			foreach marg: machine[2]
+				if marg[0] == 'default'
+					foreach f: marg[1]
+						machine_args += f
+					endforeach
+				endif
+			endforeach
+		else
+			foreach marg: machine[2]
+				if marg[0] == cmd_output[3]
+					foreach f: marg[1]
+						machine_args += f
+					endforeach
+				endif
 			endforeach
-
-			# Primary part number based mcpu flags are supported
-			# for gcc versions > 7
-			if cc.version().version_compare('<7.0')
-				foreach marg: machine[2]
-					if marg[0] == 'default'
-						foreach f: marg[1]
-							machine_args += f
-						endforeach
-					endif
-				endforeach
-			else
-				foreach marg: machine[2]
-					if marg[0] == cmd_output[3]
-						foreach f: marg[1]
-							machine_args += f
-						endforeach
-					endif
-				endforeach
-			endif
 		endif
 	endif
 endif
-- 
2.14.1

             reply	other threads:[~2018-01-19 13:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 13:15 Pavan Nikhilesh [this message]
2018-01-19 16:41 ` Bruce Richardson
2018-01-19 17:26   ` Pavan Nikhilesh
2018-01-19 17:35     ` Bruce Richardson
2018-01-22 12:38       ` Jerin Jacob
2018-01-22 13:14 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh
2018-01-22 13:40   ` Jerin Jacob
2018-01-22 14:49     ` Pavan Nikhilesh
2018-01-22 14:12   ` Bruce Richardson
2018-01-22 14:26     ` Pavan Nikhilesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180119131508.7768-1-pbhagavatula@caviumnetworks.com \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).