mbox series

[v5,00/20] linux-user: Implement VDSOs

Message ID 20230829220228.928506-1-richard.henderson@linaro.org
Headers show
Series linux-user: Implement VDSOs | expand

Message

Richard Henderson Aug. 29, 2023, 10:02 p.m. UTC
Changes for v5:
  * Integrated cross-compile, via new build-vdso.sh and meson rules.
    However, keep the binaries in the tree for hosts which do not
    have all of the cross-compile machinery.
  * Update our loongarch64 docker image to avoid a binutils bug.

Changes for v4:
  * Force all vdso to have a single load segment.
    This will prevent problems with varying host/guest page size.
  * Tidy some of the assembly with macros.
  * Implement loongarch, ppc, s390x.

Just in case the list eats a binary:
  https://gitlab.com/rth7680/qemu/-/tree/lu-vdso


r~


Richard Henderson (20):
  tests/docker: Update docker-loongarch-cross toolchain
  linux-user: Introduce imgsrc_read, imgsrc_read_alloc
  linux-user: Tidy loader_exec
  linux-user: Do not clobber bprm_buf swapping ehdr
  linux-user: Use ImageSource in load_elf_image
  linux-user: Use ImageSource in load_symbols
  linux-user: Replace bprm->fd with bprm->src.fd
  linux-user: Load vdso image if available
  linux-user: Add gen-vdso tool
  linux-user: Add build-vdso.sh tool
  linux-user/i386: Add vdso
  linux-user/x86_64: Add vdso
  linux-user/aarch64: Add vdso
  linux-user/arm: Add vdso
  linux-user/hppa: Add vdso
  linux-user/riscv: Add vdso
  linux-user/loongarch64: Add vdso
  linux-user/ppc: Add vdso
  linux-user/s390x: Rename __SIGNAL_FRAMESIZE to STACK_FRAME_OVERHEAD
  linux-user/s390x: Add vdso

 linux-user/hppa/vdso-asmoffset.h              |  12 +
 linux-user/i386/vdso-asmoffset.h              |   6 +
 linux-user/loader.h                           |  60 ++-
 linux-user/loongarch64/vdso-asmoffset.h       |   8 +
 linux-user/ppc/vdso-asmoffset.h               |  20 +
 linux-user/riscv/vdso-asmoffset.h             |   9 +
 linux-user/s390x/vdso-asmoffset.h             |   2 +
 linux-user/arm/signal.c                       |  28 +-
 linux-user/elfload.c                          | 361 +++++++++++-------
 linux-user/flatload.c                         |   8 +-
 linux-user/gen-vdso.c                         | 223 +++++++++++
 linux-user/hppa/signal.c                      |  24 +-
 linux-user/i386/signal.c                      |  11 +
 linux-user/linuxload.c                        | 137 +++++--
 linux-user/loongarch64/signal.c               |  17 +-
 linux-user/ppc/signal.c                       |  31 +-
 linux-user/riscv/signal.c                     |   8 +
 linux-user/s390x/signal.c                     |   7 +-
 linux-user/gen-vdso-elfn.c.inc                | 314 +++++++++++++++
 linux-user/aarch64/meson.build                |  33 ++
 linux-user/aarch64/vdso-be.so                 | Bin 0 -> 3216 bytes
 linux-user/aarch64/vdso-le.so                 | Bin 0 -> 3216 bytes
 linux-user/aarch64/vdso.S                     |  73 ++++
 linux-user/aarch64/vdso.ld                    |  72 ++++
 linux-user/arm/meson.build                    |  35 ++
 linux-user/arm/vdso-be.so                     | Bin 0 -> 2680 bytes
 linux-user/arm/vdso-le.so                     | Bin 0 -> 2680 bytes
 linux-user/arm/vdso.S                         | 177 +++++++++
 linux-user/arm/vdso.ld                        |  67 ++++
 linux-user/build-vdso.sh                      |  31 ++
 linux-user/hppa/meson.build                   |  23 ++
 linux-user/hppa/vdso.S                        | 165 ++++++++
 linux-user/hppa/vdso.ld                       |  77 ++++
 linux-user/hppa/vdso.so                       | Bin 0 -> 2104 bytes
 linux-user/i386/meson.build                   |  24 ++
 linux-user/i386/vdso.S                        | 143 +++++++
 linux-user/i386/vdso.ld                       |  76 ++++
 linux-user/i386/vdso.so                       | Bin 0 -> 2672 bytes
 linux-user/loongarch64/meson.build            |  21 +
 linux-user/loongarch64/vdso.S                 | 130 +++++++
 linux-user/loongarch64/vdso.ld                |  73 ++++
 linux-user/loongarch64/vdso.so                | Bin 0 -> 3560 bytes
 linux-user/meson.build                        |  10 +-
 linux-user/ppc/Makefile.vdso                  |  18 +
 linux-user/ppc/meson.build                    |  12 +
 linux-user/ppc/vdso-32.ld                     |  70 ++++
 linux-user/ppc/vdso-32.so                     | Bin 0 -> 3020 bytes
 linux-user/ppc/vdso-64.ld                     |  68 ++++
 linux-user/ppc/vdso-64.so                     | Bin 0 -> 3896 bytes
 linux-user/ppc/vdso-64le.so                   | Bin 0 -> 3896 bytes
 linux-user/ppc/vdso.S                         | 239 ++++++++++++
 linux-user/riscv/meson.build                  |  30 ++
 linux-user/riscv/vdso-32.so                   | Bin 0 -> 2888 bytes
 linux-user/riscv/vdso-64.so                   | Bin 0 -> 3840 bytes
 linux-user/riscv/vdso.S                       | 186 +++++++++
 linux-user/riscv/vdso.ld                      |  74 ++++
 linux-user/s390x/meson.build                  |  24 ++
 linux-user/s390x/vdso.S                       |  61 +++
 linux-user/s390x/vdso.ld                      |  69 ++++
 linux-user/s390x/vdso.so                      | Bin 0 -> 3464 bytes
 linux-user/x86_64/meson.build                 |  20 +
 linux-user/x86_64/vdso.S                      |  78 ++++
 linux-user/x86_64/vdso.ld                     |  73 ++++
 linux-user/x86_64/vdso.so                     | Bin 0 -> 2968 bytes
 .../dockerfiles/debian-loongarch-cross.docker |   2 +-
 65 files changed, 3329 insertions(+), 211 deletions(-)
 create mode 100644 linux-user/hppa/vdso-asmoffset.h
 create mode 100644 linux-user/i386/vdso-asmoffset.h
 create mode 100644 linux-user/loongarch64/vdso-asmoffset.h
 create mode 100644 linux-user/ppc/vdso-asmoffset.h
 create mode 100644 linux-user/riscv/vdso-asmoffset.h
 create mode 100644 linux-user/s390x/vdso-asmoffset.h
 create mode 100644 linux-user/gen-vdso.c
 create mode 100644 linux-user/gen-vdso-elfn.c.inc
 create mode 100644 linux-user/aarch64/meson.build
 create mode 100755 linux-user/aarch64/vdso-be.so
 create mode 100755 linux-user/aarch64/vdso-le.so
 create mode 100644 linux-user/aarch64/vdso.S
 create mode 100644 linux-user/aarch64/vdso.ld
 create mode 100755 linux-user/arm/vdso-be.so
 create mode 100755 linux-user/arm/vdso-le.so
 create mode 100644 linux-user/arm/vdso.S
 create mode 100644 linux-user/arm/vdso.ld
 create mode 100755 linux-user/build-vdso.sh
 create mode 100644 linux-user/hppa/vdso.S
 create mode 100644 linux-user/hppa/vdso.ld
 create mode 100755 linux-user/hppa/vdso.so
 create mode 100644 linux-user/i386/vdso.S
 create mode 100644 linux-user/i386/vdso.ld
 create mode 100755 linux-user/i386/vdso.so
 create mode 100644 linux-user/loongarch64/meson.build
 create mode 100644 linux-user/loongarch64/vdso.S
 create mode 100644 linux-user/loongarch64/vdso.ld
 create mode 100755 linux-user/loongarch64/vdso.so
 create mode 100644 linux-user/ppc/Makefile.vdso
 create mode 100644 linux-user/ppc/vdso-32.ld
 create mode 100755 linux-user/ppc/vdso-32.so
 create mode 100644 linux-user/ppc/vdso-64.ld
 create mode 100755 linux-user/ppc/vdso-64.so
 create mode 100755 linux-user/ppc/vdso-64le.so
 create mode 100644 linux-user/ppc/vdso.S
 create mode 100644 linux-user/riscv/meson.build
 create mode 100755 linux-user/riscv/vdso-32.so
 create mode 100755 linux-user/riscv/vdso-64.so
 create mode 100644 linux-user/riscv/vdso.S
 create mode 100644 linux-user/riscv/vdso.ld
 create mode 100644 linux-user/s390x/vdso.S
 create mode 100644 linux-user/s390x/vdso.ld
 create mode 100755 linux-user/s390x/vdso.so
 create mode 100644 linux-user/x86_64/vdso.S
 create mode 100644 linux-user/x86_64/vdso.ld
 create mode 100755 linux-user/x86_64/vdso.so

Comments

Helge Deller Aug. 30, 2023, 2:52 p.m. UTC | #1
On 8/30/23 00:02, Richard Henderson wrote:
> Changes for v5:
>    * Integrated cross-compile, via new build-vdso.sh and meson rules.
>      However, keep the binaries in the tree for hosts which do not
>      have all of the cross-compile machinery.
>    * Update our loongarch64 docker image to avoid a binutils bug.
>
> Just in case the list eats a binary:
>    https://gitlab.com/rth7680/qemu/-/tree/lu-vdso

I pulled that on top of git head, and ran into the build problem below.
Do I miss something?

Helge

[62/1742] Generating linux-user/aarch64/vdso-be.so with a custom command
FAILED: linux-user/aarch64/vdso-be.so
/home/cvs/qemu/qemu/linux-user/build-vdso.sh -B /srv/_build -C /home/cvs/qemu/qemu/linux-user/aarch64 -T aarch64-linux-user -o linux-user/aarch64/vdso-be.so -- -nostdlib -shared -Wl,-h,linux-vdso.so.1 -Wl,--build-id=sha1 -Wl,--hash-style=both -Wl,-T,../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.ld ../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.S -mbig-endian
Error: short-name resolution enforced but cannot prompt without a TTY
Traceback (most recent call last):
   File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 683, in <module>
     sys.exit(main())
              ^^^^^^
   File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 679, in main
     return args.cmdobj.run(args, argv)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 657, in run
     return Docker().run(cmd, False, quiet=args.quiet,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 370, in run
     ret = self._do_check(["run", "--rm", "--label",
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 247, in _do_check
     return subprocess.check_call(self._command + cmd, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib64/python3.11/subprocess.py", line 413, in check_call
     raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['podman', 'run', '--rm', '--label', 'com.qemu.instance.uuid=e746f7e345ed420088a9cc30e884a7e8', '--userns=keep-id', '-u', '1000', '-w', '/srv/_build', '-v', '/srv/_build:/srv/_build:rw', '-v', '/home/cvs/qemu/qemu:/home/cvs/qemu/qemu:ro,z', 'qemu/debian-arm64-cross', 'aarch64-linux-gnu-gcc-10', '-o', 'linux-user/aarch64/vdso-be.so', '-nostdlib', '-shared', '-Wl,-h,linux-vdso.so.1', '-Wl,--build-id=sha1', '-Wl,--hash-style=both', '-Wl,-T,../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.ld', '../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.S', '-mbig-endian']' returned non-zero exit status 125.
filter=--filter=label=com.qemu.instance.uuid=e746f7e345ed420088a9cc30e884a7e8
Richard Henderson Aug. 30, 2023, 4:20 p.m. UTC | #2
On 8/30/23 07:52, Helge Deller wrote:
> On 8/30/23 00:02, Richard Henderson wrote:
>> Changes for v5:
>>    * Integrated cross-compile, via new build-vdso.sh and meson rules.
>>      However, keep the binaries in the tree for hosts which do not
>>      have all of the cross-compile machinery.
>>    * Update our loongarch64 docker image to avoid a binutils bug.
>>
>> Just in case the list eats a binary:
>>    https://gitlab.com/rth7680/qemu/-/tree/lu-vdso
> 
> I pulled that on top of git head, and ran into the build problem below.
> Do I miss something?

No idea, since it worked for me.  Looks like some sort of docker.py problem.  Alex?

In the short term, use --disable-containers so that you only use the cross-compilers that 
you have locally installed.


r~

> 
> Helge
> 
> [62/1742] Generating linux-user/aarch64/vdso-be.so with a custom command
> FAILED: linux-user/aarch64/vdso-be.so
> /home/cvs/qemu/qemu/linux-user/build-vdso.sh -B /srv/_build -C 
> /home/cvs/qemu/qemu/linux-user/aarch64 -T aarch64-linux-user -o 
> linux-user/aarch64/vdso-be.so -- -nostdlib -shared -Wl,-h,linux-vdso.so.1 
> -Wl,--build-id=sha1 -Wl,--hash-style=both 
> -Wl,-T,../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.ld 
> ../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.S -mbig-endian
> Error: short-name resolution enforced but cannot prompt without a TTY
> Traceback (most recent call last):
>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 683, in <module>
>      sys.exit(main())
>               ^^^^^^
>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 679, in main
>      return args.cmdobj.run(args, argv)
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 657, in run
>      return Docker().run(cmd, False, quiet=args.quiet,
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 370, in run
>      ret = self._do_check(["run", "--rm", "--label",
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 247, in _do_check
>      return subprocess.check_call(self._command + cmd, **kwargs)
>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    File "/usr/lib64/python3.11/subprocess.py", line 413, in check_call
>      raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command '['podman', 'run', '--rm', '--label', 
> 'com.qemu.instance.uuid=e746f7e345ed420088a9cc30e884a7e8', '--userns=keep-id', '-u', 
> '1000', '-w', '/srv/_build', '-v', '/srv/_build:/srv/_build:rw', '-v', 
> '/home/cvs/qemu/qemu:/home/cvs/qemu/qemu:ro,z', 'qemu/debian-arm64-cross', 
> 'aarch64-linux-gnu-gcc-10', '-o', 'linux-user/aarch64/vdso-be.so', '-nostdlib', '-shared', 
> '-Wl,-h,linux-vdso.so.1', '-Wl,--build-id=sha1', '-Wl,--hash-style=both', 
> '-Wl,-T,../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.ld', 
> '../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.S', '-mbig-endian']' returned non-zero 
> exit status 125.
> filter=--filter=label=com.qemu.instance.uuid=e746f7e345ed420088a9cc30e884a7e8
>
Alex Bennée Aug. 31, 2023, 7:57 a.m. UTC | #3
Richard Henderson <richard.henderson@linaro.org> writes:

> On 8/30/23 07:52, Helge Deller wrote:
>> On 8/30/23 00:02, Richard Henderson wrote:
>>> Changes for v5:
>>>    * Integrated cross-compile, via new build-vdso.sh and meson rules.
>>>      However, keep the binaries in the tree for hosts which do not
>>>      have all of the cross-compile machinery.
>>>    * Update our loongarch64 docker image to avoid a binutils bug.
>>>
>>> Just in case the list eats a binary:
>>>    https://gitlab.com/rth7680/qemu/-/tree/lu-vdso
>> I pulled that on top of git head, and ran into the build problem
>> below.
>> Do I miss something?
>
> No idea, since it worked for me.  Looks like some sort of docker.py problem.  Alex?
>
> In the short term, use --disable-containers so that you only use the
> cross-compilers that you have locally installed.
>
>
> r~
>
>> Helge
>> [62/1742] Generating linux-user/aarch64/vdso-be.so with a custom
>> command
>> FAILED: linux-user/aarch64/vdso-be.so
>> /home/cvs/qemu/qemu/linux-user/build-vdso.sh -B /srv/_build -C
>> /home/cvs/qemu/qemu/linux-user/aarch64 -T aarch64-linux-user -o
>> linux-user/aarch64/vdso-be.so -- -nostdlib -shared
>> -Wl,-h,linux-vdso.so.1 -Wl,--build-id=sha1 -Wl,--hash-style=both
>> -Wl,-T,../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.ld
>> ../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.S -mbig-endian
>> Error: short-name resolution enforced but cannot prompt without a TTY
>> Traceback (most recent call last):
>>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 683, in <module>
>>      sys.exit(main())
>>               ^^^^^^
>>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 679, in main
>>      return args.cmdobj.run(args, argv)
>>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 657, in run
>>      return Docker().run(cmd, False, quiet=args.quiet,
>>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 370, in run
>>      ret = self._do_check(["run", "--rm", "--label",
>>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>    File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 247, in _do_check
>>      return subprocess.check_call(self._command + cmd, **kwargs)
>>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>    File "/usr/lib64/python3.11/subprocess.py", line 413, in check_call
>>      raise CalledProcessError(retcode, cmd)
>> subprocess.CalledProcessError: Command '['podman', 'run', '--rm',
>> '--label',

It looks like it detected podman on this setup. Can you invoke the
container from the command line?

>> 'com.qemu.instance.uuid=e746f7e345ed420088a9cc30e884a7e8',
>> '--userns=keep-id', '-u', '1000', '-w', '/srv/_build', '-v',
>> '/srv/_build:/srv/_build:rw', '-v',
>> '/home/cvs/qemu/qemu:/home/cvs/qemu/qemu:ro,z',
>> 'qemu/debian-arm64-cross', 'aarch64-linux-gnu-gcc-10', '-o',
>> 'linux-user/aarch64/vdso-be.so', '-nostdlib', '-shared',
>> '-Wl,-h,linux-vdso.so.1', '-Wl,--build-id=sha1',
>> '-Wl,--hash-style=both',
>> '-Wl,-T,../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.ld',
>> '../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.S',
>> '-mbig-endian']' returned non-zero exit status 125.
>> filter=--filter=label=com.qemu.instance.uuid=e746f7e345ed420088a9cc30e884a7e8
>>
Helge Deller Sept. 1, 2023, 2:21 p.m. UTC | #4
On 8/31/23 09:57, Alex Bennée wrote:
>
> Richard Henderson <richard.henderson@linaro.org> writes:
>
>> On 8/30/23 07:52, Helge Deller wrote:
>>> On 8/30/23 00:02, Richard Henderson wrote:
>>>> Changes for v5:
>>>>     * Integrated cross-compile, via new build-vdso.sh and meson rules.
>>>>       However, keep the binaries in the tree for hosts which do not
>>>>       have all of the cross-compile machinery.
>>>>     * Update our loongarch64 docker image to avoid a binutils bug.
>>>>
>>>> Just in case the list eats a binary:
>>>>     https://gitlab.com/rth7680/qemu/-/tree/lu-vdso
>>> I pulled that on top of git head, and ran into the build problem
>>> below.
>>> Do I miss something?
>>
>> No idea, since it worked for me.  Looks like some sort of docker.py problem.  Alex?
>>
>> In the short term, use --disable-containers so that you only use the
>> cross-compilers that you have locally installed.
>>
>>
>> r~
>>
>>> Helge
>>> [62/1742] Generating linux-user/aarch64/vdso-be.so with a custom
>>> command
>>> FAILED: linux-user/aarch64/vdso-be.so
>>> /home/cvs/qemu/qemu/linux-user/build-vdso.sh -B /srv/_build -C
>>> /home/cvs/qemu/qemu/linux-user/aarch64 -T aarch64-linux-user -o
>>> linux-user/aarch64/vdso-be.so -- -nostdlib -shared
>>> -Wl,-h,linux-vdso.so.1 -Wl,--build-id=sha1 -Wl,--hash-style=both
>>> -Wl,-T,../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.ld
>>> ../../home/cvs/qemu/qemu/linux-user/aarch64/vdso.S -mbig-endian
>>> Error: short-name resolution enforced but cannot prompt without a TTY
>>> Traceback (most recent call last):
>>>     File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 683, in <module>
>>>       sys.exit(main())
>>>                ^^^^^^
>>>     File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 679, in main
>>>       return args.cmdobj.run(args, argv)
>>>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>     File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 657, in run
>>>       return Docker().run(cmd, False, quiet=args.quiet,
>>>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>     File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 370, in run
>>>       ret = self._do_check(["run", "--rm", "--label",
>>>             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>     File "/home/cvs/qemu/qemu/tests/docker/docker.py", line 247, in _do_check
>>>       return subprocess.check_call(self._command + cmd, **kwargs)
>>>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>     File "/usr/lib64/python3.11/subprocess.py", line 413, in check_call
>>>       raise CalledProcessError(retcode, cmd)
>>> subprocess.CalledProcessError: Command '['podman', 'run', '--rm',
>>> '--label',
>
> It looks like it detected podman on this setup. Can you invoke the
> container from the command line?

Yes, if I run it on the command line:

[deller@p100 _build]$ 'podman' 'run' '--rm' '--label' 'com.qemu.instance.uuid=21e1c0332a2c44b6ae94a71392c57ccf' '--userns=keep-id' '-u' '1000' '-w' '/srv/_build' '-v' '/srv/_build:/srv/_build:rw' '-v' '/home/cvs/qemu/qemu:/home/cvs/qemu/qemu:ro,z' 'qemu/debian-armhf-cross' 'arm-linux-gnueabihf-gcc' '-o' 'linux-user/arm/vdso-le.so' '-nostdlib' '-shared' '-Wl,-use-blx' '-Wl,-h,linux-vdso.so.1' '-Wl,--build-id=sha1' '-Wl,--hash-style=both' '-Wl,-T,../../home/cvs/qemu/qemu/linux-user/arm/vdso.ld' '../../home/cvs/qemu/qemu/linux-user/arm/vdso.S' '-mlittle-endian'

I get this interactive(!!!) output where I can use the cursor keys to swith up/down:

? Please select an image:
   ▸ registry.fedoraproject.org/qemu/debian-armhf-cross:latest
     registry.access.redhat.com/qemu/debian-armhf-cross:latest
     docker.io/qemu/debian-armhf-cross:latest
     quay.io/qemu/debian-armhf-cross:latest

I assume the problem is, that we don't want interactive input at this stage?
Probably this is why I get the error message: "Error: short-name resolution enforced but cannot prompt without a TTY" ?

Helge
Alex Bennée Sept. 4, 2023, 12:51 p.m. UTC | #5
Helge Deller <deller@gmx.de> writes:

> On 8/31/23 09:57, Alex Bennée wrote:
>>
>> Richard Henderson <richard.henderson@linaro.org> writes:
>>
>>> On 8/30/23 07:52, Helge Deller wrote:
>>>> On 8/30/23 00:02, Richard Henderson wrote:
>>>>> Changes for v5:
>>>>>     * Integrated cross-compile, via new build-vdso.sh and meson rules.
>>>>>       However, keep the binaries in the tree for hosts which do not
>>>>>       have all of the cross-compile machinery.
>>>>>     * Update our loongarch64 docker image to avoid a binutils bug.
>>>>>
>>>>> Just in case the list eats a binary:
>>>>>     https://gitlab.com/rth7680/qemu/-/tree/lu-vdso
>>>> I pulled that on top of git head, and ran into the build problem
>>>> below.
>>>> Do I miss something?
>>>
>>> No idea, since it worked for me.  Looks like some sort of docker.py problem.  Alex?
>>>
>>> In the short term, use --disable-containers so that you only use the
>>> cross-compilers that you have locally installed.
<snip>
>>
>> It looks like it detected podman on this setup. Can you invoke the
>> container from the command line?
>
> Yes, if I run it on the command line:
>
> [deller@p100 _build]$ 'podman' 'run' '--rm' '--label' 'com.qemu.instance.uuid=21e1c0332a2c44b6ae94a71392c57ccf' '--userns=keep-id' '-u' '1000' '-w' '/srv/_build' '-v' '/srv/_build:/srv/_build:rw' '-v' '/home/cvs/qemu/qemu:/home/cvs/qemu/qemu:ro,z' 'qemu/debian-armhf-cross' 'arm-linux-gnueabihf-gcc' '-o' 'linux-user/arm/vdso-le.so' '-nostdlib' '-shared' '-Wl,-use-blx' '-Wl,-h,linux-vdso.so.1' '-Wl,--build-id=sha1' '-Wl,--hash-style=both' '-Wl,-T,../../home/cvs/qemu/qemu/linux-user/arm/vdso.ld' '../../home/cvs/qemu/qemu/linux-user/arm/vdso.S' '-mlittle-endian'
>
> I get this interactive(!!!) output where I can use the cursor keys to swith up/down:
>
> ? Please select an image:
>   ▸ registry.fedoraproject.org/qemu/debian-armhf-cross:latest
>     registry.access.redhat.com/qemu/debian-armhf-cross:latest
>     docker.io/qemu/debian-armhf-cross:latest
>     quay.io/qemu/debian-armhf-cross:latest
>
> I assume the problem is, that we don't want interactive input at this stage?
> Probably this is why I get the error message: "Error: short-name
> resolution enforced but cannot prompt without a TTY" ?

No I think the problem is we need to add dependencies to the target to
ensure the containers are built and available (if they are needed). It
looks like because qemu/debian-armhf-cross isn't available on your local
setup it fails and offers some guesses.

If you run:

  make docker-image-debian-armhf-cross

does the target work afterwards?