Hi Helmut,

> openttd fails to cross build from source for arm4, because it passes
> -mbranch-protection=standard to the native build pass. This is a common
> issue arising from architecture-specific build flags and commonly
> happens to native build passes. The typical solution is adding
> --reload-all-buildenv-variables to the debhelper invocation. I'm
> attaching a patch for your convenience.

Thanks for the report and the patch. I had a look today to include it,
but I am a little confused about it:

>  ifneq ($(TOOLS_DIR),)
> -     dpkg-architecture -a"$(DEB_BUILD_ARCH)" -f -c dh_auto_configure 
> -B"$(TOOLS_DIR)" -- -DOPTION_TOOLS_ONLY=ON
> +     dpkg-architecture -a"$(DEB_BUILD_ARCH)" -f -c dh_auto_configure 
> --reload-all-buildenv-variables -B"$(TOOLS_DIR)" -- -DOPTION_TOOLS_ONLY=ON
>  endif
>       dh_auto_configure -- $(CMAKE_CONFIG_ARGUMENTS)

Your patch adds --reload-all-buildenv-variables, but it adds it to the
*first* call to dh_auto_configure, not the second one. I would expect to
add this to the second one (assuming the first one fills the cache and
the second one uses the incorrectly cached value). Or does the option
also prevent *writing* to the cache?


Also, do you have a suggestion on how to reproduce this easily? I tried
instructions at 
https://wiki.debian.org/CrossCompiling#Build_in_a_build_environment_.28recommended.29
to cross-build with git-buildpackage / git-pbuilder, but I think this
just uses a full arm64 chroot with qemu instead of doing a proper split
host/build arch build, and some other attempts also failed. Maybe you
have some suggestion off the top of your head?

Gr.

Matthijs

Attachment: signature.asc
Description: PGP signature

Reply via email to