⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278302 in webkit


Ignore:
Timestamp:
Jun 1, 2021, 6:01:01 AM (5 years ago)
Author:
Adrian Perez de Castro
Message:

[WPE][GTK] Support building against uClibc
https://bugs.webkit.org/show_bug.cgi?id=226244

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

  • assembler/MacroAssemblerARM64.cpp:

(getauxval): Provide a fallback implementation of getauxval() for
systems which do not provide <sys/auxv.h>, like those using uClibc
as their C library.

Source/WTF:

  • wtf/PlatformRegisters.h: Use the <sys/ucontext.h> header instead of

<ucontext.h>, which is enough to gain access to the type definitions
for CPU registers and is available on every libc. On the other hand,
uClibc does not have <ucontext.h>, so this fixes the build in that
case.

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r278257 r278302  
     12021-06-01  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [WPE][GTK] Support building against uClibc
     4        https://bugs.webkit.org/show_bug.cgi?id=226244
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * assembler/MacroAssemblerARM64.cpp:
     9        (getauxval): Provide a fallback implementation of getauxval() for
     10        systems which do not provide <sys/auxv.h>, like those using uClibc
     11        as their C library.
     12
    1132021-05-30  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.cpp

    r277936 r278302  
    3535#if OS(LINUX)
    3636#include <asm/hwcap.h>
     37#if __has_include(<sys/auxv.h>)
    3738#include <sys/auxv.h>
     39#else
     40#include <linux/auxvec.h>
     41// Provide an implementation for C libraries which do not ship one.
     42static unsigned long getauxval(unsigned long type)
     43{
     44    char** env = environ;
     45    while (*env++) { /* no-op */ }
     46
     47    for (auto* auxv = reinterpret_cast<unsigned long*>(env); *auxv != AT_NULL; auxv += 2) {
     48        if (*auxv == type)
     49            return auxv[1];
     50    }
     51
     52    errno = ENOENT;
     53    return 0;
     54}
     55#endif
    3856#endif
    3957
  • trunk/Source/WTF/ChangeLog

    r278257 r278302  
     12021-06-01  Adrian Perez de Castro  <aperez@igalia.com>
     2
     3        [WPE][GTK] Support building against uClibc
     4        https://bugs.webkit.org/show_bug.cgi?id=226244
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * wtf/PlatformRegisters.h: Use the <sys/ucontext.h> header instead of
     9        <ucontext.h>, which is enough to gain access to the type definitions
     10        for CPU registers and is available on every libc. On the other hand,
     11        uClibc does not have <ucontext.h>, so this fixes the build in that
     12        case.
     13
    1142021-05-30  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WTF/wtf/PlatformRegisters.h

    r243254 r278302  
    3636#include <windows.h>
    3737#else
    38 #include <ucontext.h>
     38#include <sys/ucontext.h>
    3939#endif
    4040
Note: See TracChangeset for help on using the changeset viewer.