0

Removed AVX from mozjs

86eea22ac7
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282471
This commit is contained in:
0x1def 2024-12-29 12:37:21 +03:00
parent ee98706b77
commit a83ac363e2
Signed by: 0x1def
GPG Key ID: D7D7D9B5E72B6AA2
4 changed files with 38 additions and 4 deletions

View File

@ -1,8 +1,6 @@
# patch < 0001-Compile-without-debug-symbols.patch
--- a/SConstruct
+++ b/SConstruct
@@ -3037,7 +3037,6 @@ if env.TargetOSIs('posix'):
@@ -3020,7 +3020,6 @@
env.Append(
CCFLAGS=[
"-fasynchronous-unwind-tables",

View File

@ -0,0 +1,13 @@
--- a/src/third_party/mozjs/SConscript
+++ b/src/third_party/mozjs/SConscript
@@ -144,10 +143,6 @@
"extract/js/src/wasm/WasmCode-platform.cpp",
]
-if env['TARGET_ARCH'] == 'x86_64' and not env.TargetOSIs('windows'):
- env.Append(CCFLAGS=['-mavx2'])
- sources.extend(["extract/mozglue/misc/SIMD_avx2.cpp", "extract/mozglue/misc/SSE.cpp"])
-
if env.TargetOSIs('windows'):
sources.extend([
"extract/mozglue/misc/ConditionVariable_windows.cpp",

View File

@ -0,0 +1,19 @@
--- a/src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp
+++ b/src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp
@@ -448,16 +448,8 @@
// assertion failure. Accordingly, we just don't allow that to happen. We
// are not particularly concerned about ensuring that newer 32 bit processors
// get access to the AVX2 functions exposed here.
-# if defined(MOZILLA_MAY_SUPPORT_AVX2) && defined(__x86_64__)
-
-bool SupportsAVX2() { return supports_avx2(); }
-
-# else
-
bool SupportsAVX2() { return false; }
-# endif
-
const char* SIMD::memchr8(const char* ptr, char value, size_t length) {
if (SupportsAVX2()) {
return memchr8AVX2(ptr, value, length);

View File

@ -15,7 +15,11 @@ cd mongo
apt install -y wget
wget https://gitea.flakybit.net/flakybit/mongodb-docker/raw/branch/main/0001-Compile-without-debug-symbols.patch
patch < 0001-Compile-without-debug-symbols.patch
patch SConstruct 0001-Compile-without-debug-symbols.patch
wget https://gitea.flakybit.net/flakybit/mongodb-docker/raw/branch/main/0002-Removed_AVX-2_CCFLAG_from_mozjs.patch
patch src/third_party/mozjs/SConscript 0002-Removed_AVX-2_CCFLAG_from_mozjs.patch
wget https://gitea.flakybit.net/flakybit/mongodb-docker/raw/branch/main/0003-Disabled_AVX_in_mozjs_SIMD.patch
patch src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp 0003-Disabled_AVX_in_mozjs_SIMD.patch
python3 -m venv .venv --prompt mongo
source .venv/bin/activate