Thread (35 messages) 35 messages, 5 authors, 2021-01-26

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

From: Juraj Linkeš <hidden>
Date: 2021-01-20 10:30:46

-----Original Message-----
From: Thomas Monjalon <redacted>
Sent: Wednesday, January 20, 2021 11:22 AM
To: Juraj Linkeš <redacted>
Cc: david.marchand@redhat.com; aconole@redhat.com;
maicolgabriel@hotmail.com; jerinjacobk@gmail.com; ferruh.yigit@intel.com;
Ruifeng.Wang@arm.com; dev@dpdk.org; bruce.richardson@intel.com
Subject: Re: [dpdk-dev] [PATCH v4 1/3] build: add aarch64 clang to meson cross-
compile

20/01/2021 09:24, Juraj Linkeš:
quoted
From: Thomas Monjalon <redacted>
quoted
19/01/2021 09:33, Juraj Linkeš:
quoted
Create meson cross-file arm64_armv8_linux_clang_ubuntu1804.
Why is it specific to Ubuntu 18.04?
I don't want to add specifc cross files per distributions.
quoted
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.
I don't understand the explanations above.
Please explain what is the bug and how it is fixed.
I guess the missing piece is that the sysroot path is the ubuntu specific part.
The explanations illustrate why we can't have a generic cross file with the
current meson version - there's no way to pass the paths to cross builds. Now
that I think about it, the commit message needs a rewrite - I should've
mentioned that clang/llvm doesn't provide it's own standard c lib, so that has to
come from elsewhere (such as gcc) and thus we have to provide the paths.

Can it be done with the option -Dc_args?
Not in Meson 0.47.1, it's explained in the commit msg:
* setting CFLAGS, LDFLAGS or -Dc_args, -Dc_link_args doesn't 
affect cross builds (only native builds). Support added in 0.51.0.
quoted
quoted
[...]
quoted
+c_args = ['-target', 'aarch64-linux-gnu', '--sysroot',
+'/usr/aarch64-linux-gnu'] c_link_args = ['-target',
+'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help