Log Message
[WPE] Build fixes for musl C library on Linux https://bugs.webkit.org/show_bug.cgi?id=210068
Patch by Khem Raj <[email protected]> on 2021-04-08 Reviewed by Carlos Alberto Lopez Perez. Source/_javascript_Core: Use OS(LINUX) to include musl in platform test for linux and consolidate all linux platfrom under same test. Use smaller limits for JSC stack size per thread and reserved zone size. * runtime/MachineContext.h: (JSC::MachineContext::stackPointerImpl): (JSC::MachineContext::framePointerImpl): (JSC::MachineContext::instructionPointerImpl): (JSC::MachineContext::argumentPointer<1>): (JSC::MachineContext::llintInstructionPointer): * runtime/OptionsList.h: Source/WTF: Define 128KB DEFAULT_THREAD_STACK_SIZE_IN_KB for musl Use OS(LINUX) check to include musl when building for Linux based platforms. * wtf/PlatformHave.h: * wtf/Threading.cpp:
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (275669 => 275670)
--- trunk/Source/_javascript_Core/ChangeLog 2021-04-08 18:47:57 UTC (rev 275669)
+++ trunk/Source/_javascript_Core/ChangeLog 2021-04-08 19:05:31 UTC (rev 275670)
@@ -1,3 +1,23 @@
+2021-04-08 Khem Raj <[email protected]>
+
+ [WPE] Build fixes for musl C library on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=210068
+
+ Reviewed by Carlos Alberto Lopez Perez.
+
+ Use OS(LINUX) to include musl in platform test
+ for linux and consolidate all linux platfrom
+ under same test. Use smaller limits for JSC
+ stack size per thread and reserved zone size.
+
+ * runtime/MachineContext.h:
+ (JSC::MachineContext::stackPointerImpl):
+ (JSC::MachineContext::framePointerImpl):
+ (JSC::MachineContext::instructionPointerImpl):
+ (JSC::MachineContext::argumentPointer<1>):
+ (JSC::MachineContext::llintInstructionPointer):
+ * runtime/OptionsList.h:
+
2021-04-07 Yusuke Suzuki <[email protected]>
[JSC] DUCET level-1 weighs are equal if characters are alphabets
Modified: trunk/Source/_javascript_Core/runtime/MachineContext.h (275669 => 275670)
--- trunk/Source/_javascript_Core/runtime/MachineContext.h 2021-04-08 18:47:57 UTC (rev 275669)
+++ trunk/Source/_javascript_Core/runtime/MachineContext.h 2021-04-08 19:05:31 UTC (rev 275670)
@@ -196,7 +196,7 @@
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
#if CPU(X86)
return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]);
@@ -347,7 +347,7 @@
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
@@ -498,7 +498,7 @@
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
@@ -656,7 +656,7 @@
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
@@ -773,7 +773,7 @@
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
Modified: trunk/Source/_javascript_Core/runtime/OptionsList.h (275669 => 275670)
--- trunk/Source/_javascript_Core/runtime/OptionsList.h 2021-04-08 18:47:57 UTC (rev 275669)
+++ trunk/Source/_javascript_Core/runtime/OptionsList.h 2021-04-08 19:05:31 UTC (rev 275670)
@@ -71,6 +71,18 @@
// On instantiation of the first VM instance, the Options will be write protected
// and cannot be modified thereafter.
+#if OS(LINUX) && !defined(__BIONIC__) && !defined(__GLIBC__)
+// non-glibc/non-android options on linux ( musl )
+constexpr unsigned jscMaxPerThreadStack = 128 * KB;
+constexpr unsigned jscSoftReservedZoneSize = 32 * KB;
+constexpr unsigned jscReservedZoneSize = 16 * KB;
+#else
+// default
+constexpr unsigned jscMaxPerThreadStack = 5 * MB;
+constexpr unsigned jscSoftReservedZoneSize = 128 * KB;
+constexpr unsigned jscReservedZoneSize = 64 * KB;
+#endif
+
#define FOR_EACH_JSC_OPTION(v) \
v(Bool, useKernTCSM, defaultTCSMValue(), Normal, "Note: this needs to go before other options since they depend on this value.") \
v(Bool, validateOptions, false, Normal, "crashes if mis-typed JSC options were passed to the VM") \
@@ -86,9 +98,9 @@
\
v(Bool, reportMustSucceedExecutableAllocations, false, Normal, nullptr) \
\
- v(Unsigned, maxPerThreadStackUsage, 5 * MB, Normal, "Max allowed stack usage by the VM") \
- v(Unsigned, softReservedZoneSize, 128 * KB, Normal, "A buffer greater than reservedZoneSize that reserves space for stringifying exceptions.") \
- v(Unsigned, reservedZoneSize, 64 * KB, Normal, "The amount of stack space we guarantee to our clients (and to interal VM code that does not call out to clients).") \
+ v(Unsigned, maxPerThreadStackUsage, jscMaxPerThreadStack, Normal, "Max allowed stack usage by the VM") \
+ v(Unsigned, softReservedZoneSize, jscSoftReservedZoneSize, Normal, "A buffer greater than reservedZoneSize that reserves space for stringifying exceptions.") \
+ v(Unsigned, reservedZoneSize, jscReservedZoneSize, Normal, "The amount of stack space we guarantee to our clients (and to interal VM code that does not call out to clients).") \
\
v(Bool, crashOnDisallowedVMEntry, ASSERT_ENABLED, Normal, "Forces a crash if we attempt to enter the VM when disallowed") \
v(Bool, crashIfCantAllocateJITMemory, false, Normal, nullptr) \
@@ -611,7 +623,7 @@
bool init(const char*);
bool isInRange(unsigned);
const char* rangeString() const { return (m_state > InitError) ? m_rangeString : s_nullRangeStr; }
-
+
void dump(PrintStream& out) const;
private:
Modified: trunk/Source/WTF/ChangeLog (275669 => 275670)
--- trunk/Source/WTF/ChangeLog 2021-04-08 18:47:57 UTC (rev 275669)
+++ trunk/Source/WTF/ChangeLog 2021-04-08 19:05:31 UTC (rev 275670)
@@ -1,3 +1,17 @@
+2021-04-08 Khem Raj <[email protected]>
+
+ [WPE] Build fixes for musl C library on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=210068
+
+ Reviewed by Carlos Alberto Lopez Perez.
+
+ Define 128KB DEFAULT_THREAD_STACK_SIZE_IN_KB for musl
+ Use OS(LINUX) check to include musl when building for
+ Linux based platforms.
+
+ * wtf/PlatformHave.h:
+ * wtf/Threading.cpp:
+
2021-04-08 Chris Dumez <[email protected]>
OfflineAudioContext objects are leaking
Modified: trunk/Source/WTF/wtf/PlatformHave.h (275669 => 275670)
--- trunk/Source/WTF/wtf/PlatformHave.h 2021-04-08 18:47:57 UTC (rev 275669)
+++ trunk/Source/WTF/wtf/PlatformHave.h 2021-04-08 19:05:31 UTC (rev 275670)
@@ -206,7 +206,7 @@
#define HAVE_HOSTED_CORE_ANIMATION 1
#endif
-#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
+#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || OS(LINUX)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
#define HAVE_MACHINE_CONTEXT 1
#endif
Modified: trunk/Source/WTF/wtf/Threading.cpp (275669 => 275670)
--- trunk/Source/WTF/wtf/Threading.cpp 2021-04-08 18:47:57 UTC (rev 275669)
+++ trunk/Source/WTF/wtf/Threading.cpp 2021-04-08 19:05:31 UTC (rev 275670)
@@ -52,6 +52,8 @@
#elif OS(DARWIN) && ASAN_ENABLED
if (threadType == ThreadType::Compiler)
return 1 * MB; // ASan needs more stack space (especially on Debug builds).
+#elif OS(LINUX) && !defined(__BIONIC__) && !defined(__GLIBC__) // MUSL default thread stack size.
+ return 128 * KB;
#else
UNUSED_PARAM(threadType);
#endif
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
