Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | From c4d4d9f1aa74addefdad40294cf16d9e0b3dd6ec 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 +++++----- |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 11 | Source/WTF/wtf/Platform.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 | |
| 14 | diff --git a/Source/JavaScriptCore/runtime/MachineContext.h b/Source/JavaScriptCore/runtime/MachineContext.h |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 15 | index 823964c2..00841146 100644 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 16 | --- a/Source/JavaScriptCore/runtime/MachineContext.h |
| 17 | +++ b/Source/JavaScriptCore/runtime/MachineContext.h |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | @@ -188,7 +188,7 @@ static inline void*& stackPointerImpl(mcontext_t& machineContext) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 19 | #error Unknown Architecture |
| 20 | #endif |
| 21 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 22 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 23 | +#elif defined(__linux__) |
| 24 | |
| 25 | #if CPU(X86) |
| 26 | return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]); |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 27 | @@ -335,7 +335,7 @@ static inline void*& framePointerImpl(mcontext_t& machineContext) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 28 | #error Unknown Architecture |
| 29 | #endif |
| 30 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 31 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 32 | +#elif defined(__linux__) |
| 33 | |
| 34 | // The following sequence depends on glibc's sys/ucontext.h. |
| 35 | #if CPU(X86) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 36 | @@ -482,7 +482,7 @@ static inline void*& instructionPointerImpl(mcontext_t& machineContext) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 37 | #error Unknown Architecture |
| 38 | #endif |
| 39 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 40 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 41 | +#elif defined(__linux__) |
| 42 | |
| 43 | // The following sequence depends on glibc's sys/ucontext.h. |
| 44 | #if CPU(X86) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 45 | @@ -639,7 +639,7 @@ inline void*& argumentPointer<1>(mcontext_t& machineContext) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 46 | #error Unknown Architecture |
| 47 | #endif |
| 48 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 50 | +#elif defined(__linux__) |
| 51 | |
| 52 | // The following sequence depends on glibc's sys/ucontext.h. |
| 53 | #if CPU(X86) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 54 | @@ -756,7 +756,7 @@ inline void*& llintInstructionPointer(mcontext_t& machineContext) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 55 | #error Unknown Architecture |
| 56 | #endif |
| 57 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 58 | -#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__) |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 59 | +#elif defined(__linux__) |
| 60 | |
| 61 | // The following sequence depends on glibc's sys/ucontext.h. |
| 62 | #if CPU(X86) |
| 63 | diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 64 | index 34f7cb14..32ad9150 100644 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 65 | --- a/Source/WTF/wtf/Platform.h |
| 66 | +++ b/Source/WTF/wtf/Platform.h |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 67 | @@ -714,7 +714,7 @@ |
| 68 | |
| 69 | #endif /* OS(DARWIN) */ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 70 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 71 | -#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS))) |
| 72 | +#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] | 73 | #define HAVE_MACHINE_CONTEXT 1 |
| 74 | #endif |
| 75 | |