cross build fails due to "ntpd/keyword-gen" always cross compiled but executed anyway
Hello,
When I cross-compile the package,
ntpd/keyword-gen (to generate ntpd/keywordgen.h) is always called
and executed at build time. But ntpd/wscript cross-builds everything.
This always ends up in a build failure (file not executable).
My only work around, at the moment, is to have ntpd/keyword-gen.h pre-generated by
a previous native build, this is very annoying
cat ntpd/wscript
def build(ctx):
bldnode = ctx.bldnode.abspath()
if ctx.variant == "host": <--- this is always true, although I am cross-compiling (see down below)
bison_source = ["ntp_parser.y"]
[...]
ctx(
features="c cprogram",
includes=[ctx.bldnode.parent.abspath(), "../include", "."],
install_path=None,
source=keyword_gen_source,
target="keyword-gen", <-- keyword-gen will always be cross-compiled
)
I am not familiar with "waf". Is it normal that ctx.variant == "host" ?
For me, it looks like it's missing a HOST & TARGET definition like in autotools for instance.
We need to define both. Is it possible?
Here's how I cross compiled the package:
./waf configure --disable-doc \
--disable-manpage \
--enable-warnings \
--cross-compiler=arm-linux-gnueabihf-gcc \
--cross-cflags="$(CFLAGS) -I[..]/python3.9" \
--cross-ldflags="$(LDFLAGS) -L[...]/python3.9" \
--python=$(CROSS_DIR)/bin/python
How come the cross-build step in your CI works?
is it because it's always run after a native build?
If your CI passes I should be able to cross-compile too!