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: Thomas Monjalon <hidden>
Date: 2021-01-20 10:21:57

20/01/2021 09:24, Juraj Linkeš:
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?

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