From 27a2114617b057dcd949a10d2cd9a5007496a3a7 Mon Sep 17 00:00:00 2001 From: "vincent.pichon" Date: Thu, 12 Sep 2024 17:22:08 +0200 Subject: [PATCH] add patch from ondrej-zary : https://github.com/GermanAizek/mongodb-without-avx/issues/16#issue-2397281663 --- debian12-mongod.dockerfile | 17 +++++++++++++++++ mozjs-noavx.patch | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 debian12-mongod.dockerfile create mode 100644 mozjs-noavx.patch diff --git a/debian12-mongod.dockerfile b/debian12-mongod.dockerfile new file mode 100644 index 0000000..3d3cad2 --- /dev/null +++ b/debian12-mongod.dockerfile @@ -0,0 +1,17 @@ +FROM debian:bookworm + +RUN apt update -y && \ + apt install -y libcurl4 && \ + apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY bin/mongod /usr/local/bin/ + +RUN mkdir -p /data/db && \ + chmod -R 750 /data && \ + chown -R 999:999 /data + +USER 999 + +EXPOSE 27017/tcp +CMD [ "/usr/local/bin/mongod" ] diff --git a/mozjs-noavx.patch b/mozjs-noavx.patch new file mode 100644 index 0000000..a8f85b4 --- /dev/null +++ b/mozjs-noavx.patch @@ -0,0 +1,25 @@ +--- a/src/third_party/mozjs/SConscript ++++ b/src/third_party/mozjs/SConscript +@@ -145,8 +145,7 @@ sources = [ + ] + + 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"]) ++ sources.extend(["extract/mozglue/misc/SSE.cpp"]) + + if env.TargetOSIs('windows'): + sources.extend([ +diff --git a/src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp b/src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp +index 3893de57b32..4ea0a657fbb 100644 +--- a/src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp ++++ b/src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp +@@ -448,7 +448,7 @@ const char* SIMD::memchr8SSE2(const char* ptr, char value, size_t length) { + // 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__) ++# if 0 + + bool SupportsAVX2() { return supports_avx2(); } +