Re: Meson build leaks host 'sh' path to target build when cross-compiled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Junio,

On Mon, 10 Feb 2025 11:54:25 -0800, Junio C Hamano <gitster@xxxxxxxxx> wrote:

> Peter Seiderer <ps.report@xxxxxxx> writes:
>
> > Maybe all doing (autoconf) cross builds where happy with the defaults
> > from the Makefile (SHELL_PATH = /bin/sh, PERL_PATH = /usr/bin/perl)
> > on host and target (as the buildroot autoconf package since 2013) and
> > only users doing native builds fiddled around with non-default values?
>
> I somehow doubt it.
>
> The problem I see is that there is no distinction between "this is
> the path for the shell on the target system" vs "this is the shell
> we run on the host while building the package" in the Makefile.  Use
> of autoconf would not magically change it; the Makefile that
> includes the config.mak.autogen needs to be aware of the
> distinction.

Found no problem/special-handling in buildroot ([1]) or yocto ([2]) for
SHELL_PATH, but you are right regarding the PERL_PATH in yocto using

  38 EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \

and

  49 EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"

and a fixup for the resulting files

  76 perl_native_fixup () {
  77 	sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
  78 	       -e 's#${libdir}/perl-native/#${libdir}/#' \
  79 	    ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}

Yes, doing a distinct handling for host/target path for sh/perl for
meson/autoconf is for sure the right thing ;-)

Regards,
Peter

[1] https://gitlab.com/buildroot.org/buildroot/-/blob/master/package/git/git.mk
[2] https://git.yoctoproject.org/poky/tree/meta/recipes-devtools/git/git_2.48.1.bb





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux