[dpdk-dev] [PATCH v4 1/3] build: add aarch64 clang to meson cross-compile

Juraj Linkeš juraj.linkes at pantheon.tech
Tue Jan 19 09:33:05 CET 2021


Create meson cross-file arm64_armv8_linux_clang_ubuntu1804.
Use clang/LLVM toolchain with sysroot pointing to gcc cross stdlib.

The sysroot path must be in the cross-file so that Clang can find the
proper headers:
* setting CFLAGS, LDFLAGS or -Dc_args, -Dc_link_args doesn't affect
cross builds (only native builds). Support added in 0.51.0.
* setting pkg-config vars only affects lib searching, not includes
* splitting the cross-file into two (one with clang info, one with
paths) doesn't work. Support added in 0.52.0.

Signed-off-by: Juraj Linkeš <juraj.linkes at pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
---
 config/arm/arm64_armv8_linux_clang_ubuntu1804 | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 config/arm/arm64_armv8_linux_clang_ubuntu1804

diff --git a/config/arm/arm64_armv8_linux_clang_ubuntu1804 b/config/arm/arm64_armv8_linux_clang_ubuntu1804
new file mode 100644
index 000000000..aa5ee0132
--- /dev/null
+++ b/config/arm/arm64_armv8_linux_clang_ubuntu1804
@@ -0,0 +1,20 @@
+[binaries]
+c = 'clang'
+cpp = 'clang++'
+ar = 'llvm-ar'
+strip = 'llvm-strip'
+llvm-config = 'llvm-config'
+pcap-config = 'llvm-config'
+pkgconfig = 'aarch64-linux-gnu-pkg-config'
+
+[host_machine]
+system = 'linux'
+cpu_family = 'aarch64'
+cpu = 'armv8-a'
+endian = 'little'
+
+[properties]
+implementor_id = 'generic'
+implementor_pn = 'default'
+c_args = ['-target', 'aarch64-linux-gnu', '--sysroot', '/usr/aarch64-linux-gnu']
+c_link_args = ['-target', 'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']
-- 
2.20.1



More information about the dev mailing list