From 2b26997c85f274c792552385b6a36b8614a3662c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 8 Feb 2022 10:54:45 +0000 Subject: More changed for windows-arm (e.g. add zdll.lib for ARM64, although zlib1.dll still missing) --- compat/zlib/win64-arm/zdll.lib | Bin 0 -> 16732 bytes win/Makefile.in | 6 +++++- win/configure | 29 ++++++++++++++++++++++++----- win/configure.in | 14 +++++++++++--- win/makefile.vc | 15 ++++++++++----- win/tcl.m4 | 3 +-- 6 files changed, 51 insertions(+), 16 deletions(-) create mode 100755 compat/zlib/win64-arm/zdll.lib diff --git a/compat/zlib/win64-arm/zdll.lib b/compat/zlib/win64-arm/zdll.lib new file mode 100755 index 0000000..a1b6c50 Binary files /dev/null and b/compat/zlib/win64-arm/zdll.lib differ diff --git a/win/Makefile.in b/win/Makefile.in index 71b40cd..0c83fd6 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -517,7 +517,11 @@ ${TEST_EXE_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} tclTestMain.${OBJEXT} # use pre-built zlib1.dll ${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE} - @if test "@ZLIB_LIBS@set" != "${ZLIB_DIR_NATIVE}/win32/zdll.libset" ; then \ + @if test "@ZLIB_LIBS@set" = "${ZLIB_DIR_NATIVE}/win64-arm/zdll.libset" ; then \ + $(COPY) $(ZLIB_DIR)/win64-arm/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ + elif test "@ZLIB_LIBS@set" = "${ZLIB_DIR_NATIVE}/win64-arm/libz.dll.aset" ; then \ + $(COPY) $(ZLIB_DIR)/win64-arm/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ + elif test "@ZLIB_LIBS@set" = "${ZLIB_DIR_NATIVE}/win32/zdll.libset" ; then \ $(COPY) $(ZLIB_DIR)/win64/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ else \ $(COPY) $(ZLIB_DIR)/win32/${ZLIB_DLL_FILE} ${ZLIB_DLL_FILE}; \ diff --git a/win/configure b/win/configure index 1701b6f..7b1ec92 100755 --- a/win/configure +++ b/win/configure @@ -3902,8 +3902,7 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 if test "$do64bit" != "no" ; then RC="rc" CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" - # Do not use -O2 for Win64 - this has proved buggy in code gen. - CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" + CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo -MACHINE:${MACHINE}" LINKBIN="link" # Avoid 'unresolved external symbol __security_cookie' errors. @@ -4396,14 +4395,34 @@ if test "$tcl_ok" = "yes"; then if test "$do64bit" != "no"; then - if test "$GCC" == "yes"; then + if test "$do64bit" = "arm64"; then + + if test "$GCC" == "yes"; then + + ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64-arm/libz.dll.a - ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64/libz.dll.a + +else + + ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64-arm/zdll.lib + + +fi else - ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64/zdll.lib + if test "$GCC" == "yes"; then + + ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64/libz.dll.a + + +else + + ZLIB_LIBS=\${ZLIB_DIR_NATIVE}/win64/zdll.lib + + +fi fi diff --git a/win/configure.in b/win/configure.in index 45ee1fb..1f52c52 100644 --- a/win/configure.in +++ b/win/configure.in @@ -144,10 +144,18 @@ AS_IF([test "${enable_shared+set}" = "set"], [ AS_IF([test "$tcl_ok" = "yes"], [ AC_SUBST(ZLIB_DLL_FILE,[\${ZLIB_DLL_FILE}]) AS_IF([test "$do64bit" != "no"], [ - AS_IF([test "$GCC" == "yes"],[ - AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/libz.dll.a]) + AS_IF([test "$do64bit" = "arm64"], [ + AS_IF([test "$GCC" == "yes"],[ + AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64-arm/libz.dll.a]) + ], [ + AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64-arm/zdll.lib]) + ]) ], [ - AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/zdll.lib]) + AS_IF([test "$GCC" == "yes"],[ + AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/libz.dll.a]) + ], [ + AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win64/zdll.lib]) + ]) ]) ], [ AC_SUBST(ZLIB_LIBS,[\${ZLIB_DIR_NATIVE}/win32/zdll.lib]) diff --git a/win/makefile.vc b/win/makefile.vc index 08ffc31..a4de4c2 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -515,16 +515,21 @@ $(TCLREGLIB): $(TMP_DIR)\tclWinReg.obj $(TCLSTUBLIB) $(_VC_MANIFEST_EMBED_DLL) !endif -!if "$(MACHINE)" == "AMD64" -$(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 +!if "$(MACHINE)" == "ARM64" +$(OUT_DIR)\zlib1.dll: $(COMPATDIR)\zlib\win64-arm\zlib1.dll + $(COPY) $(COMPATDIR)\zlib\win64-arm\zlib1.dll $(OUT_DIR)\zlib1.dll +$(OUT_DIR)\zdll.lib: $(COMPATDIR)\zlib\win64-arm\zdll.lib + $(COPY) $(COMPATDIR)\zlib\win64-arm\zdll.lib $(OUT_DIR)\zdll.lib !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 $(COPY) $(COMPATDIR)\zlib\win32\zdll.lib $(OUT_DIR)\zdll.lib +!else +$(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 !endif pkgs: diff --git a/win/tcl.m4 b/win/tcl.m4 index ad0cf4f..f36f263 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -874,8 +874,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ if test "$do64bit" != "no" ; then RC="rc" CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" - # Do not use -O2 for Win64 - this has proved buggy in code gen. - CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" + CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" lflags="${lflags} -nologo -MACHINE:${MACHINE}" LINKBIN="link" # Avoid 'unresolved external symbol __security_cookie' errors. -- cgit v0.12 From 4e39a8e0b828039a94b8014caea48a24a4938349 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 8 Feb 2022 15:07:28 +0000 Subject: Accept aarch64 too (in stead of arm64) --- win/configure | 22 +++++++++++----------- win/tcl.m4 | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/win/configure b/win/configure index 7b1ec92..f815682 100755 --- a/win/configure +++ b/win/configure @@ -3352,12 +3352,12 @@ 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" + arm64|aarch64) + CC="aarch64-w64-mingw32-${CC}" + LD="aarch64-w64-mingw32-ld" + AR="aarch64-w64-mingw32-ar" + RANLIB="aarch64-w64-mingw32-ranlib" + RC="aarch64-w64-mingw32-windres" ;; *) CC="i686-w64-mingw32-${CC}" @@ -3773,7 +3773,7 @@ echo "$as_me: error: ${CC} does not support the -shared option. echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 ;; - arm64) + arm64|aarch64) MACHINE="ARM64" echo "$as_me:$LINENO: result: Using ARM64 $MACHINE mode" >&5 echo "${ECHO_T} Using ARM64 $MACHINE mode" >&6 @@ -3835,9 +3835,9 @@ tcl_win_64bit=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test "$tcl_win_64bit" = "yes" ; then - do64bit=amd64 - MACHINE="AMD64" - echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 + do64bit=amd64 + MACHINE="AMD64" + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 fi ;; @@ -3878,7 +3878,7 @@ echo "${ECHO_T}using shared flags" >&6 amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build ;; - arm64) + arm64|aarch64) MACHINE="ARM64" ;; ia64) diff --git a/win/tcl.m4 b/win/tcl.m4 index f36f263..26702b6 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -30,7 +30,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), - with_tclconfig="${withval}") + [with_tclconfig="${withval}"]) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ @@ -148,7 +148,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ AC_ARG_WITH(tk, AS_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), - with_tkconfig="${withval}") + [with_tkconfig="${withval}"]) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ @@ -582,12 +582,12 @@ 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" + arm64|aarch64) + CC="aarch64-w64-mingw32-${CC}" + LD="aarch64-w64-mingw32-ld" + AR="aarch64-w64-mingw32-ar" + RANLIB="aarch64-w64-mingw32-ranlib" + RC="aarch64-w64-mingw32-windres" ;; *) CC="i686-w64-mingw32-${CC}" @@ -793,7 +793,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ MACHINE="AMD64" ; # assume AMD64 as default 64-bit build AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) ;; - arm64) + arm64|aarch64) MACHINE="ARM64" AC_MSG_RESULT([ Using ARM64 $MACHINE mode]) ;; @@ -811,9 +811,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ [tcl_win_64bit=no] ) if test "$tcl_win_64bit" = "yes" ; then - do64bit=amd64 - MACHINE="AMD64" - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + do64bit=amd64 + MACHINE="AMD64" + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) fi ;; esac @@ -851,7 +851,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build ;; - arm64) + arm64|aarch64) MACHINE="ARM64" ;; ia64) -- cgit v0.12