Re: Request for help: slashem
Hi Josch,
On Wed, Mar 17, 2021 at 01:35:54AM +0100, Johannes Schauer Marin Rodrigues wrote:
> Hi Nilesh,
>
> TLDR: sudo apt remove qemu-user qemu-user-static
Thanks a lot!
> Quoting Nilesh Patra (2021-03-16 22:20:45)
> It is not. What you are seeing is the combination of using LD_PRELOAD via
> fakeroot with qemu-user via binfmt-misc. The error happens because when you run
> a foreign architecture binary on a system that can emulate that foreign
> architecture with qemu-user transparently with binfmt-misc under fakeroot, then
> foreign architecture shared libraries like libfakeroot-sysv.so will likely not
> be available. Foreign architecture LD_PRELOAD with fakeroot or fakechroot is
> possible but requires a number of hacks:
>
> https://sources.debian.org/src/mmdebstrap/0.7.5-2/mmdebstrap/#L2549
>
> But when cross building you do not want to run foreign architecture binaries.
> It just happens to work on systems that use qemu-user and binfmt-misc and will
> of course only work for architectures with qemu support. The easiest way to
> find these problems is to build on a system that doesn't have qemu-user
> installed, hence my TLDR suggestion from above.
Got it, I did not think qemu will mess here, thanks for explaining.
> If you remove them, then the build will fail very early:
>
> make[4]: Entering directory '/<<PKGBUILDDIR>>/util'
> ./makedefs -m
> ./makedefs: 1: Syntax error: word unexpected (expecting ")")
> make[4]: *** [Makefile:199: ../src/monstr.c] Error 2
> make[4]: Leaving directory '/<<PKGBUILDDIR>>/util'
> make[3]: *** [Makefile:658: monstr.c] Error 2
> make[3]: Leaving directory '/<<PKGBUILDDIR>>/src'
> make[2]: *** [Makefile:212: ../include/date.h] Error 2
> make[2]: Leaving directory '/<<PKGBUILDDIR>>/util'
> dh_auto_build: error: cd util && make -j1 "INSTALL=install --strip-program=true" PKG_CONFIG=aarch64-linux- gnu-pkg-config CXX=aarch64-linux-gnu-g\+\+ CC=aarch64-linux-gnu-gcc recover returned exit code 2
> make[1]: *** [debian/rules:26: override_dh_auto_build] Error 25
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> make: *** [debian/rules:6: build] Error 2
> dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
I can reproduce this
> This will be tricky to fix, because essentially you have to to adapt the
> upstream build system such that all utilities that are not installed but run
> during the build are compiled for the build architecture and not for the host
> architecture.
ACK.
> If there are utilities that are not only used during the build
> but also installed, then they need to be compiled twice: once native and once
> cross.
Hmm, I wish to confirm if I get you correctly here. When compiled
natively here, the binaries will be able to execute, thus not giving the
exec format or syntax error or something similar and we can then easily
cross compile once that does not cause any problems. Is that what you
mean?
I'm not sure of a way to implement this, would you have any examples, or
something similar?
Thanks!
Nilesh
Reply to: