blob: 041ec4675f1935a3b7f4a4cee25365db3e4e9936 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 4f9d736e0458ed33cd161cd164ad0acdac939f44 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 Bishop1a4b7ee2018-12-16 17:11:34 -080010 Source/JavaScriptCore/runtime/MachineContext.h | 18 +++++++++++++++++-
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011 Source/WTF/wtf/Platform.h | 2 +-
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080012 2 files changed, 18 insertions(+), 2 deletions(-)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013
14diff --git a/Source/JavaScriptCore/runtime/MachineContext.h b/Source/JavaScriptCore/runtime/MachineContext.h
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080015index bf0bdc7..84b8a8a 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016--- a/Source/JavaScriptCore/runtime/MachineContext.h
17+++ b/Source/JavaScriptCore/runtime/MachineContext.h
18@@ -146,7 +146,7 @@ inline void*& stackPointer(mcontext_t& machineContext)
19 #error Unknown Architecture
20 #endif
21
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022-#elif 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]);
27@@ -251,7 +251,7 @@ inline void*& framePointer(mcontext_t& machineContext)
28 #error Unknown Architecture
29 #endif
30
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080031-#elif 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)
36@@ -354,7 +354,7 @@ inline void*& instructionPointer(mcontext_t& machineContext)
37 #error Unknown Architecture
38 #endif
39
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040-#elif 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)
45@@ -466,7 +466,7 @@ inline void*& argumentPointer<1>(mcontext_t& machineContext)
46 #error Unknown Architecture
47 #endif
48
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080049-#elif 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)
54@@ -583,7 +583,7 @@ inline void*& llintInstructionPointer(mcontext_t& machineContext)
55 #error Unknown Architecture
56 #endif
57
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080058-#elif 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)
63diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080064index 551c047..e50b05a 100644
Brad Bishop6e60e8b2018-02-01 10:27:11 -050065--- a/Source/WTF/wtf/Platform.h
66+++ b/Source/WTF/wtf/Platform.h
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080067@@ -683,7 +683,7 @@
Brad Bishop6e60e8b2018-02-01 10:27:11 -050068 #define HAVE_CFNETWORK_STORAGE_PARTITIONING 1
69 #endif
70
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080071-#if OS(DARWIN) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
Brad Bishop6e60e8b2018-02-01 10:27:11 -050072+#if OS(DARWIN) || ((OS(FREEBSD) || defined(__linux__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
73 #define HAVE_MACHINE_CONTEXT 1
74 #endif
75