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

Thomas Monjalon thomas at monjalon.net
Wed Jan 20 11:21:50 CET 2021


20/01/2021 09:24, Juraj Linkeš:
> From: Thomas Monjalon <thomas at monjalon.net>
> > 19/01/2021 09:33, Juraj Linkeš:
> > > 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.
> > 
> > > 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?


> > [...]
> > > +c_args = ['-target', 'aarch64-linux-gnu', '--sysroot',
> > > +'/usr/aarch64-linux-gnu'] c_link_args = ['-target',
> > > +'aarch64-linux-gnu', '-fuse-ld=lld', '--gcc-toolchain=/usr']





More information about the dev mailing list