On 8/31/21 12:07, Frans de Boer wrote:
On 8/30/21 22:35, Martin Wilck wrote:
On Mon, 2021-08-30 at 21:09 +0200, Frans de Boer wrote:
  On 8/30/21 09:28, Guillaume Gardet wrote:
  > Hi,
-----Original Message----- From: Frans de Boer <frans@fransdb.nl>
Sent: 26 August 2021 15:22 To: opensuse-factory@opensuse.org
Subject: qemu-aarch64-static

LS,

I can't find the qemu-aarch64-static with the available qemu
version. Where can I get it?
If you need 'qemu-aarch64', it is in 'qemu-linux-user' package.

Guillaume
I just found out that qemu-aarch64 is indeed statically linked. The
´qemu-aarch64-binfmt' is a soft link to qemu-binfm, which itself is
also statically linked. So, I guessed that I needed qemu-binfmt within
the chroot jail to deal with the different magic file numbers for
aarch64 executables.
Under openSUSE, qemu-binfmt is not a qemu executable. It is just a tiny
wrapper that mangles argv[0] and starts the actual emulator, qemu-
aarch64. qemu-binfmt's only purpose is to fix argv[0] to hide the
presence of the emulator and make the process look like a native one.
(see
https://build.opensuse.org/package/view_file/Virtualization/qemu/linux-user-add-binfmt-wrapper-for-argv-0.patch?expand=1)
AFAIK, this is a openSUSE peculiarity.

In your chroot, you need both these binaries.
I recently filed a bug about this, 1186256.

Regards
Martin
Ok, thnx. I also copied the TW supplied qemu-aarch64 into the jail and now it starts-up.

However, configure - from multiple packages - still complains about the outdated shell version, while previously compiled aarch64 programs are just running in the jail.
TW has no pre-compiled bash shell for aarch64, but from what I see in trace output, configure get the proper version data, but does not recognize it. But maybe someone with intimate knowledge about the inner workings of the configure script can decrypt the attached trace output? Command was 'bash -x ./configure 2>&1 | tee db.txt'

--- Frans
After I deleted a single 'if' statement in configure, almost all went well. Almost, because now there is an other issue, which I detailed in a new thread.

Original code within configure:
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
 IFS=$as_save_IFS
 test -z "$as_dir" && as_dir=.
 as_found=:
 case $as_dir in #(
        /*)
          for as_base in sh bash ksh sh5; do
            # Try only shells that exist, to save several forks.
            as_shell=$as_dir/$as_base
            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
 CONFIG_SHELL=$as_shell as_have_required=yes
                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
 break 2
fi
fi
          done;;
      esac
 as_found=false
done

Where the new code is:
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
 IFS=$as_save_IFS
 test -z "$as_dir" && as_dir=.
 as_found=:
 case $as_dir in #(
        /*)
          for as_base in sh bash ksh sh5; do
            # Try only shells that exist, to save several forks.
+           as_dir=/bin
            as_shell=$as_dir/$as_base
-            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
 CONFIG_SHELL=$as_shell as_have_required=yes
                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
 break 2
fi
- fi
          done;;
      esac
 as_found=false
done

The reason why the first one is not working, might be related somehow to the new issue (and thread).
Remember, this is all done under qemu-aarch64 and a chrooted filesystem.

Oh, maybe for maintainers of the configure scripts: try to code in a more understandable way using proper nesting and indentations. Unless of course obscurity is your aim.

--- Frans.




-- 
A: Yes, just like that                            A: Ja, net zo
Q: Oh, Just like reading a book backwards         Q: Oh, net als een boek achterstevoren lezen
A: Because it upsets the natural flow of a story  A: Omdat het de natuurlijke gang uit het verhaal haalt
Q: Why is top-posting annoying?                   Q: Waarom is Top-posting zo irritant?