Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 1 | From 828a500d5be62ba6fc94bd4fac3fe4bf1b1d4f6d Mon Sep 17 00:00:00 2001 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Fri, 6 Oct 2017 17:00:08 +0300 |
| 4 | Subject: [PATCH] Fix build with musl |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 8 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 9 | --- |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 10 | Source/JavaScriptCore/runtime/MachineContext.h | 10 +++++----- |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 11 | Source/WTF/wtf/PlatformHave.h | 2 +- |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 12 | 2 files changed, 6 insertions(+), 6 deletions(-) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 14 | --- a/Source/JavaScriptCore/runtime/MachineContext.h |
| 15 | +++ b/Source/JavaScriptCore/runtime/MachineContext.h |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 16 | @@ -196,7 +196,7 @@ static inline void*& stackPointerImpl(mc |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 17 | #error Unknown Architecture |
| 18 | #endif |
| 19 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 20 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 21 | +#elif defined(__linux__) |
| 22 | |
| 23 | #if CPU(X86) |
| 24 | return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]); |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 25 | @@ -347,7 +347,7 @@ static inline void*& framePointerImpl(mc |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 26 | #error Unknown Architecture |
| 27 | #endif |
| 28 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 29 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 30 | +#elif defined(__linux__) |
| 31 | |
| 32 | // The following sequence depends on glibc's sys/ucontext.h. |
| 33 | #if CPU(X86) |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 34 | @@ -498,7 +498,7 @@ static inline void*& instructionPointerI |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 35 | #error Unknown Architecture |
| 36 | #endif |
| 37 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 39 | +#elif defined(__linux__) |
| 40 | |
| 41 | // The following sequence depends on glibc's sys/ucontext.h. |
| 42 | #if CPU(X86) |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 43 | @@ -656,7 +656,7 @@ inline void*& argumentPointer<1>(mcontex |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 44 | #error Unknown Architecture |
| 45 | #endif |
| 46 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 47 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 48 | +#elif defined(__linux__) |
| 49 | |
| 50 | // The following sequence depends on glibc's sys/ucontext.h. |
| 51 | #if CPU(X86) |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 52 | @@ -773,7 +773,7 @@ inline void*& llintInstructionPointer(mc |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 53 | #error Unknown Architecture |
| 54 | #endif |
| 55 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 56 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 57 | +#elif defined(__linux__) |
| 58 | |
| 59 | // The following sequence depends on glibc's sys/ucontext.h. |
| 60 | #if CPU(X86) |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 61 | --- a/Source/WTF/wtf/PlatformHave.h |
| 62 | +++ b/Source/WTF/wtf/PlatformHave.h |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 63 | @@ -202,7 +202,7 @@ |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 64 | #define HAVE_HOSTED_CORE_ANIMATION 1 |
| 65 | #endif |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 66 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 67 | -#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS))) |
| 68 | +#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__linux__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS))) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 69 | #define HAVE_MACHINE_CONTEXT 1 |
| 70 | #endif |
| 71 | |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 72 | --- a/Source/WebCore/xml/XPathGrammar.cpp |
| 73 | +++ b/Source/WebCore/xml/XPathGrammar.cpp |
| 74 | @@ -966,7 +966,7 @@ int yydebug; |
| 75 | #if YYERROR_VERBOSE |
| 76 | |
| 77 | # ifndef yystrlen |
| 78 | -# if defined __GLIBC__ && defined _STRING_H |
| 79 | +# if defined __linux__ && defined _STRING_H |
| 80 | # define yystrlen strlen |
| 81 | # else |
| 82 | /* Return the length of YYSTR. */ |
| 83 | @@ -989,7 +989,7 @@ yystrlen (yystr) |
| 84 | # endif |
| 85 | |
| 86 | # ifndef yystpcpy |
| 87 | -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
| 88 | +# if defined __linux__ && defined _STRING_H && defined _GNU_SOURCE |
| 89 | # define yystpcpy stpcpy |
| 90 | # else |
| 91 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |