File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ SKIP_GMP=no
2020SKIP_MPFR=no
2121PATCH_GMP_C23=no
2222PATCH_LDD=no
23+ PATCH_IMMINTRIN=no
2324GMP_FAT_ARG=" --enable-fat"
2425HOST_ARG=
2526
4445 echo " --skip-mpfr - skip building MPFR"
4546 echo " --disable-fat - disable building fat binaries"
4647 echo " --patch-ldd - patch flint shared linking for mingw on arm64"
48+ echo " --patch-immintrin - patch flint arm64 msvc header to avoid immintrin.h"
4749 echo
4850 echo " Legacy options:"
4951 echo " --gmp gmp - build based on GMP (default)"
111113 PATCH_LDD=yes
112114 shift
113115 ;;
116+ --patch-immintrin)
117+ # Needed only for the FLINT headers consumed by MSVC on Windows arm64.
118+ PATCH_IMMINTRIN=yes
119+ shift
120+ ;;
114121 --use-gmp-github-mirror)
115122 USE_GMP_GITHUB_MIRROR=yes
116123 shift
@@ -333,6 +340,13 @@ cd flint-$FLINTVER
333340 echo --------------------------------------------
334341 patch -N -Z -p1 < ../../../bin/patch-flint-windows-arm64-link.diff
335342 fi
343+ if [ " $PATCH_IMMINTRIN " = " yes" ]; then
344+ echo
345+ echo --------------------------------------------
346+ echo " patching FLINT"
347+ echo --------------------------------------------
348+ patch -N -Z -p1 < ../../../bin/patch-flint-windows-arm64-immintrin.diff
349+ fi
336350 ./bootstrap.sh
337351 ./configure --prefix=$PREFIX \
338352 --host=$HOST_ARG \
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ bin/build_dependencies_unix.sh \
2121 --host aarch64-w64-mingw32\
2222 --patch-C23\
2323 --patch-ldd\
24+ --patch-immintrin\
2425 #
2526
2627mkdir -p .local/lib
Original file line number Diff line number Diff line change 1+ diff --git a/src/longlong_msc_arm64.h b/src/longlong_msc_arm64.h
2+ index 44d96f03f..6ade48289 100644
3+ --- a/src/longlong_msc_arm64.h
4+ +++ b/src/longlong_msc_arm64.h
5+ @@ -14,7 +14,6 @@
6+
7+ #include <stdlib.h>
8+ #include <intrin.h>
9+ - #include <immintrin.h>
10+
11+ /* Trailing and leading zeros */
12+ # define flint_clz _CountLeadingZeros64
You can’t perform that action at this time.
0 commit comments