Build GMP as a fat library to support older CPUs

--enable-fat selects the optimized code at run time, so the static
library also works on x86_64 CPUs without AVX, BMI2 or ADX. It is
ignored on architectures that do not support it, such as aarch64.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GuofangandClaude Sonnet 5.5 committed 2026-10-28 12:45:17 +08:00
1 parent 729ada5769
commit 7f5012dd94
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -461,7 +461,7 @@ RUN --mount=type=bind,from=sources,source=gmp-6.3.0.tar.xz,target=/tmp/gmp.tar.x
mkdir src \
&& tar --extract --xz --file=/tmp/gmp.tar.xz --directory=src --strip-components=1 \
&& cd src \
&& CFLAGS="-fPIC -std=gnu17" ./configure --prefix=/usr/local --disable-shared --enable-static \
&& CFLAGS="-fPIC -std=gnu17" ./configure --prefix=/usr/local --disable-shared --enable-static --enable-fat \
&& make --jobs="$(nproc)" \
&& make install \
&& cd .. \