Skip to content
Permalink
Browse files
[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.


Canonical link: https://commits.webkit.org/238339@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aperezdc committed Jun 1, 2021
1 parent 72fbd99 commit 7c506de
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
@@ -1,3 +1,15 @@
2021-06-01 Adrian Perez de Castro <aperez@igalia.com>

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

Reviewed by Michael Catanzaro.

* 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.

2021-05-30 Chris Dumez <cdumez@apple.com>

Drop UncheckedCondition / UncheckedLock
@@ -34,7 +34,25 @@

#if OS(LINUX)
#include <asm/hwcap.h>
#if __has_include(<sys/auxv.h>)
#include <sys/auxv.h>
#else
#include <linux/auxvec.h>
// Provide an implementation for C libraries which do not ship one.
static unsigned long getauxval(unsigned long type)
{
char** env = environ;
while (*env++) { /* no-op */ }

for (auto* auxv = reinterpret_cast<unsigned long*>(env); *auxv != AT_NULL; auxv += 2) {
if (*auxv == type)
return auxv[1];
}

errno = ENOENT;
return 0;
}
#endif
#endif

namespace JSC {
@@ -1,3 +1,16 @@
2021-06-01 Adrian Perez de Castro <aperez@igalia.com>

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

Reviewed by Michael Catanzaro.

* 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.

2021-05-30 Chris Dumez <cdumez@apple.com>

Drop UncheckedCondition / UncheckedLock
@@ -35,7 +35,7 @@
#elif OS(WINDOWS)
#include <windows.h>
#else
#include <ucontext.h>
#include <sys/ucontext.h>
#endif

namespace WTF {

0 comments on commit 7c506de

Please sign in to comment.