blob: 6dcb52956cda6c9b066bb9724aa5531e2ae3b7ab [file] [log] [blame]
Andrew Geissler4b740dc2020-05-05 08:54:39 -05001From 828a500d5be62ba6fc94bd4fac3fe4bf1b1d4f6d Mon Sep 17 00:00:00 2001
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 6 Oct 2017 17:00:08 +0300
4Subject: [PATCH] Fix build with musl
5
6Upstream-Status: Pending
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08008
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009---
Brad Bishop19323692019-04-05 15:28:33 -040010 Source/JavaScriptCore/runtime/MachineContext.h | 10 +++++-----
Andrew Geissler4b740dc2020-05-05 08:54:39 -050011 Source/WTF/wtf/PlatformHave.h | 2 +-
Brad Bishop19323692019-04-05 15:28:33 -040012 2 files changed, 6 insertions(+), 6 deletions(-)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013
14diff --git a/Source/JavaScriptCore/runtime/MachineContext.h b/Source/JavaScriptCore/runtime/MachineContext.h
Andrew Geissler4b740dc2020-05-05 08:54:39 -050015index c5052527..95ef98b5 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016--- a/Source/JavaScriptCore/runtime/MachineContext.h
17+++ b/Source/JavaScriptCore/runtime/MachineContext.h
Andrew Geissler4b740dc2020-05-05 08:54:39 -050018@@ -196,7 +196,7 @@ static inline void*& stackPointerImpl(mcontext_t& machineContext)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019 #error Unknown Architecture
20 #endif
21
Brad Bishop19323692019-04-05 15:28:33 -040022-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023+#elif defined(__linux__)
24
25 #if CPU(X86)
26 return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]);
Andrew Geissler4b740dc2020-05-05 08:54:39 -050027@@ -347,7 +347,7 @@ static inline void*& framePointerImpl(mcontext_t& machineContext)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050028 #error Unknown Architecture
29 #endif
30
Brad Bishop19323692019-04-05 15:28:33 -040031-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050032+#elif defined(__linux__)
33
34 // The following sequence depends on glibc's sys/ucontext.h.
35 #if CPU(X86)
Andrew Geissler4b740dc2020-05-05 08:54:39 -050036@@ -498,7 +498,7 @@ static inline void*& instructionPointerImpl(mcontext_t& machineContext)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037 #error Unknown Architecture
38 #endif
39
Brad Bishop19323692019-04-05 15:28:33 -040040-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050041+#elif defined(__linux__)
42
43 // The following sequence depends on glibc's sys/ucontext.h.
44 #if CPU(X86)
Andrew Geissler4b740dc2020-05-05 08:54:39 -050045@@ -656,7 +656,7 @@ inline void*& argumentPointer<1>(mcontext_t& machineContext)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050046 #error Unknown Architecture
47 #endif
48
Brad Bishop19323692019-04-05 15:28:33 -040049-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050050+#elif defined(__linux__)
51
52 // The following sequence depends on glibc's sys/ucontext.h.
53 #if CPU(X86)
Andrew Geissler4b740dc2020-05-05 08:54:39 -050054@@ -773,7 +773,7 @@ inline void*& llintInstructionPointer(mcontext_t& machineContext)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055 #error Unknown Architecture
56 #endif
57
Brad Bishop19323692019-04-05 15:28:33 -040058-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050059+#elif defined(__linux__)
60
61 // The following sequence depends on glibc's sys/ucontext.h.
62 #if CPU(X86)
Andrew Geissler4b740dc2020-05-05 08:54:39 -050063diff --git a/Source/WTF/wtf/PlatformHave.h b/Source/WTF/wtf/PlatformHave.h
64index daca20fe..53eae6ba 100644
65--- a/Source/WTF/wtf/PlatformHave.h
66+++ b/Source/WTF/wtf/PlatformHave.h
67@@ -222,7 +222,7 @@
68 #define HAVE_HOSTED_CORE_ANIMATION 1
69 #endif
Brad Bishop6e60e8b2018-02-01 10:27:11 -050070
Brad Bishop19323692019-04-05 15:28:33 -040071-#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 Bishop6e60e8b2018-02-01 10:27:11 -050073 #define HAVE_MACHINE_CONTEXT 1
74 #endif
75