> > 3) We need to build kni against the aarch64 kernel headers, but it
> > fails. It appears that kernel/linux/kni/meson.build doesn’t pass any
> > cross-compile flags in the make command it creates. The diff below
> > shows how I hardcoded it to get it to work for now. Thoughts on how to
> > do this right? meson has the path (in
> > $PATH) and the binary prefixs (in ‘[binaries]’ in the cross file). It
> > must know the arch, too.
> >
> > --- a/kernel/linux/kni/meson.build
> > +++ b/kernel/linux/kni/meson.build
> > @@ -14,6 +14,8 @@ custom_target('rte_kni',
> >         input: kni_sources,
> >         output: 'rte_kni.ko',
> >         command: ['make', '-j4', '-C', kernel_dir + '/build',
> > +
> > + 'CROSS_COMPILE=/tool/toolchain/aarch64-1.1/bin/aarch64-linux-
> > gnu-',
> > +               'ARCH=aarch64',
> >                 'M=' + meson.current_build_dir(),
> >                 'src=' + meson.current_source_dir(),
> >                 'MODULE_CFLAGS=-include ' + meson.source_root() +
> > '/config/rte_config.h' +
> >
> 
> Yes, Meson should know these. I'll submit this separately (in a new series), 
> as
> this series is getting pretty big and this fix is actually unrelated.
> 

I tried to figure out how to implement this and I've ran into a brick wall - 
there's no way to figure out the full name of the cross-compiler. I found only 
one way to get the cross compiler:
meson.get_compiler('c', native:false).get_id()

But that only retuns 'gcc', not the full binary name (c = 
'aarch64-linux-gnu-gcc' in cross file).

Bruce, any ideas on how to get the full name? If I understand the sources 
right, we aren't able to access arbitrary object attributes, just those, which 
are specifically exposed.

Maybe we could do a workaround? Either if cross compiling and the compiler is 
gcc, use the 'aarch64-linux-gnu-' prefix or just put the prefix into the cross 
file as an additional property?

> > I will try to get to a full review soon.
> >
> > Thank you,
> > Andrew

Reply via email to