From f48af06d664b9d4f48755833e764c916ec561f68 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 7 Feb 2022 14:42:11 +0000 Subject: Fix [bae42b3d24]: [d86e92fb33] et.al. eliminates cpuid when cross compiling for win32 --- win/configure | 14 ++++++++++++-- win/configure.in | 2 +- win/makefile.vc | 4 ++-- win/tcl.m4 | 12 +++++++++++- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/win/configure b/win/configure index 8abb3d3..1701b6f 100755 --- a/win/configure +++ b/win/configure @@ -3279,7 +3279,7 @@ fi SHLIB_SUFFIX=".dll" # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. + # which requires x86|amd64|arm64|ia64. MACHINE="X86" if test "$GCC" = "yes"; then @@ -3352,6 +3352,13 @@ echo "${ECHO_T}$ac_cv_cross" >&6 RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; + arm64) + CC="arm64-w64-mingw32-${CC}" + LD="arm64-w64-mingw32-ld" + AR="arm64-w64-mingw32-ar" + RANLIB="arm64-w64-mingw32-ranlib" + RC="arm64-w64-mingw32-windres" + ;; *) CC="i686-w64-mingw32-${CC}" LD="i686-w64-mingw32-ld" @@ -3470,6 +3477,9 @@ echo "${ECHO_T}$ac_cv_win32" >&6 echo "$as_me: error: ${CC} cannot produce win32 executables." >&2;} { (exit 1); exit 1; }; } fi + if test "$MACHINE" != "ARM64"; then + extra_cflags="$extra_cflags -DHAVE_CPUID=1" + fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" echo "$as_me:$LINENO: checking for working -municode linker flag" >&5 @@ -5277,7 +5287,7 @@ case "$TCL_PATCH_LEVEL" in esac TCL_WIN_VERSION="$TCL_VERSION.$TCL_RELEASE_LEVEL.`echo $TCL_PATCH_LEVEL | tr -d ab.`" -# X86|AMD64|IA64 for manifest +# X86|AMD64|ARM64|IA64 for manifest diff --git a/win/configure.in b/win/configure.in index 0aa3224..45ee1fb 100644 --- a/win/configure.in +++ b/win/configure.in @@ -375,7 +375,7 @@ case "$TCL_PATCH_LEVEL" in esac TCL_WIN_VERSION="$TCL_VERSION.$TCL_RELEASE_LEVEL.`echo $TCL_PATCH_LEVEL | tr -d ab.`" AC_SUBST(TCL_WIN_VERSION) -# X86|AMD64|IA64 for manifest +# X86|AMD64|ARM64|IA64 for manifest AC_SUBST(MACHINE) AC_SUBST(TCL_VERSION) diff --git a/win/makefile.vc b/win/makefile.vc index 22e0267..08ffc31 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -97,7 +97,7 @@ # nodep = Turns off compatibility macros to ensure the core # isn't being built with deprecated functions. # -# MACHINE=(ALPHA|AMD64|IA64|IX86) +# MACHINE=(ALPHA|AMD64|ARM64|IA64|IX86) # Set the machine type used for the compiler, linker, and # resource compiler. This hook is needed to tell the tools # when alternate platforms are requested. IX86 is the default @@ -520,7 +520,7 @@ $(OUT_DIR)\zlib1.dll: $(COMPATDIR)\zlib\win64\zlib1.dll $(COPY) $(COMPATDIR)\zlib\win64\zlib1.dll $(OUT_DIR)\zlib1.dll $(OUT_DIR)\zdll.lib: $(COMPATDIR)\zlib\win64\zdll.lib $(COPY) $(COMPATDIR)\zlib\win64\zdll.lib $(OUT_DIR)\zdll.lib -!else +!elseif "$(MACHINE)" == "IX86" $(OUT_DIR)\zlib1.dll: $(COMPATDIR)\zlib\win32\zlib1.dll $(COPY) $(COMPATDIR)\zlib\win32\zlib1.dll $(OUT_DIR)\zlib1.dll $(OUT_DIR)\zdll.lib: $(COMPATDIR)\zlib\win32\zdll.lib diff --git a/win/tcl.m4 b/win/tcl.m4 index e2117d2..ad0cf4f 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -557,7 +557,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ SHLIB_SUFFIX=".dll" # MACHINE is IX86 for LINK, but this is used by the manifest, - # which requires x86|amd64|ia64. + # which requires x86|amd64|arm64|ia64. MACHINE="X86" if test "$GCC" = "yes"; then @@ -582,6 +582,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; + arm64) + CC="arm64-w64-mingw32-${CC}" + LD="arm64-w64-mingw32-ld" + AR="arm64-w64-mingw32-ar" + RANLIB="arm64-w64-mingw32-ranlib" + RC="arm64-w64-mingw32-windres" + ;; *) CC="i686-w64-mingw32-${CC}" LD="i686-w64-mingw32-ld" @@ -642,6 +649,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ if test "$ac_cv_win32" != "yes"; then AC_MSG_ERROR([${CC} cannot produce win32 executables.]) fi + if test "$MACHINE" != "ARM64"; then + extra_cflags="$extra_cflags -DHAVE_CPUID=1" + fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" AC_CACHE_CHECK(for working -municode linker flag, -- cgit v0.12