blob: 1ccef1fdc8e2a63c46e97bf960df5fbc29a766ff [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
Andrew Geisslerc926e172021-05-07 16:11:35 -05006Upstream-Status: Accepted
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007Signed-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
Brad Bishop6e60e8b2018-02-01 10:27:11 -050014--- a/Source/JavaScriptCore/runtime/MachineContext.h
15+++ b/Source/JavaScriptCore/runtime/MachineContext.h
Andrew Geissler95ac1b82021-03-31 14:34:31 -050016@@ -196,7 +196,7 @@ static inline void*& stackPointerImpl(mc
Brad Bishop6e60e8b2018-02-01 10:27:11 -050017 #error Unknown Architecture
18 #endif
19
Brad Bishop19323692019-04-05 15:28:33 -040020-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021+#elif defined(__linux__)
22
23 #if CPU(X86)
24 return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]);
Andrew Geissler95ac1b82021-03-31 14:34:31 -050025@@ -347,7 +347,7 @@ static inline void*& framePointerImpl(mc
Brad Bishop6e60e8b2018-02-01 10:27:11 -050026 #error Unknown Architecture
27 #endif
28
Brad Bishop19323692019-04-05 15:28:33 -040029-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050030+#elif defined(__linux__)
31
32 // The following sequence depends on glibc's sys/ucontext.h.
33 #if CPU(X86)
Andrew Geissler95ac1b82021-03-31 14:34:31 -050034@@ -498,7 +498,7 @@ static inline void*& instructionPointerI
Brad Bishop6e60e8b2018-02-01 10:27:11 -050035 #error Unknown Architecture
36 #endif
37
Brad Bishop19323692019-04-05 15:28:33 -040038-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050039+#elif defined(__linux__)
40
41 // The following sequence depends on glibc's sys/ucontext.h.
42 #if CPU(X86)
Andrew Geissler95ac1b82021-03-31 14:34:31 -050043@@ -656,7 +656,7 @@ inline void*& argumentPointer<1>(mcontex
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044 #error Unknown Architecture
45 #endif
46
Brad Bishop19323692019-04-05 15:28:33 -040047-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050048+#elif defined(__linux__)
49
50 // The following sequence depends on glibc's sys/ucontext.h.
51 #if CPU(X86)
Andrew Geissler95ac1b82021-03-31 14:34:31 -050052@@ -773,7 +773,7 @@ inline void*& llintInstructionPointer(mc
Brad Bishop6e60e8b2018-02-01 10:27:11 -050053 #error Unknown Architecture
54 #endif
55
Brad Bishop19323692019-04-05 15:28:33 -040056-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
Brad Bishop6e60e8b2018-02-01 10:27:11 -050057+#elif defined(__linux__)
58
59 // The following sequence depends on glibc's sys/ucontext.h.
60 #if CPU(X86)
Andrew Geissler4b740dc2020-05-05 08:54:39 -050061--- a/Source/WTF/wtf/PlatformHave.h
62+++ b/Source/WTF/wtf/PlatformHave.h
Andrew Geissler95ac1b82021-03-31 14:34:31 -050063@@ -202,7 +202,7 @@
Andrew Geissler4b740dc2020-05-05 08:54:39 -050064 #define HAVE_HOSTED_CORE_ANIMATION 1
65 #endif
Brad Bishop6e60e8b2018-02-01 10:27:11 -050066
Brad Bishop19323692019-04-05 15:28:33 -040067-#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 Bishop6e60e8b2018-02-01 10:27:11 -050069 #define HAVE_MACHINE_CONTEXT 1
70 #endif
71
Andrew Geissler95ac1b82021-03-31 14:34:31 -050072--- 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