qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] Fix for Haiku


From: Richard Zak
Subject: Re: [PATCH 1/2] Fix for Haiku
Date: Sun, 4 Jul 2021 10:20:34 -0400

Exactly. One of the developers on the Haiku forum shared with me the patch that Haiku uses for qemu, and it has a few lines concerning error codes. I'll look into this.
https://github.com/haikuports/haikuports/blob/14c2cab5428145b93232cb69683a67bbe68a9f06/app-emulation/qemu/patches/qemu-3.1.1.1.patchset

This is a stopper for the configure script changes? I was thinking that smaller changes would be best to keep the review more manageable. I'm also still new around here :)

În dum., 4 iul. 2021 la 05:30, Philippe Mathieu-Daudé <f4bug@amsat.org> a scris:
On 7/4/21 11:27 AM, Philippe Mathieu-Daudé wrote:
> On 7/4/21 11:03 AM, Philippe Mathieu-Daudé wrote:
>> On 7/4/21 12:06 AM, Richard Zak wrote:
>>> For MIPS (all sub-targets, 64-bit and EL) & xtensa(eb), the compiler
>>> complains about running out of memory. Best I can see, that's not what
>>> actually happens, but that's the error message. I was going to
>>> investigate this later, but this was the error which was causing the
>>> test with the Haiku VM with that corresponding make target. My desktop &
>>> laptop have 64 GB, and I'm pretty sure it didn't get to that point.
>>>
>>>
> /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld:
>>> final link failed: memory exhausted
>
>> See how Haiku handles POSIX errno:
>>
>> https://github.com/haiku/haiku/blob/master/headers/os/support/Errors.h
>>
>> #define B_GENERAL_ERROR_BASE   INT_MIN
>>
>> #define B_POSIX_ERROR_BASE     (B_GENERAL_ERROR_BASE + 0x7000)
>>
>> #define B_POSIX_ENOMEM  B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 0)
>> #define E2BIG           B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 1)
>> #define ECHILD          B_TO_POSIX_ERROR(B_POSIX_ERROR_BASE + 2)
>> ...
>>
>
> Same problem with Xtensa:
>
> static uint32_t errno_h2g(int host_errno)
> {
>     static const uint32_t guest_errno[] = {
>         [EPERM]         = TARGET_EPERM,
>         [ENOENT]        = TARGET_ENOENT,
>         [ESRCH]         = TARGET_ESRCH,
>         [EINTR]         = TARGET_EINTR,
>         [EIO]           = TARGET_EIO,
>         [ENXIO]         = TARGET_ENXIO,
>         [E2BIG]         = TARGET_E2BIG,
>         [ENOEXEC]       = TARGET_ENOEXEC,
> ...

Annoyingly enough this is also how linux-user/syscall.c does
(thinking about code re-use):

/*
 * This list is the union of errno values overridden in asm-<arch>/errno.h
 * minus the errnos that are not actually generic to all archs.
 */
static uint16_t host_to_target_errno_table[ERRNO_TABLE_SIZE] = {
    [EAGAIN]            = TARGET_EAGAIN,
    [EIDRM]             = TARGET_EIDRM,
    [ECHRNG]            = TARGET_ECHRNG,
    [EL2NSYNC]          = TARGET_EL2NSYNC,
    [EL3HLT]            = TARGET_EL3HLT,
    [EL3RST]            = TARGET_EL3RST,
...


--
Regards,

Richard J. Zak
Professional Genius

reply via email to

[Prev in Thread] Current Thread [Next in Thread]