From 1ee5dfd619c0c1579c5046f72719c03957d02c75 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Sat, 17 Feb 2024 23:51:31 +0800 Subject: [PATCH 01/28] added aarch64 target support for wsl_tools --- erts/etc/win32/wsl_tools/SetupWSLcross.bat | 5 ++++- erts/etc/win32/wsl_tools/reg_query.sh | 2 ++ erts/etc/win32/wsl_tools/vc/cc.sh | 8 +++++++- erts/etc/win32/wsl_tools/vc/emu_cc.sh | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/erts/etc/win32/wsl_tools/SetupWSLcross.bat b/erts/etc/win32/wsl_tools/SetupWSLcross.bat index 0e8d9348c188..81e8c44f2ac6 100644 --- a/erts/etc/win32/wsl_tools/SetupWSLcross.bat +++ b/erts/etc/win32/wsl_tools/SetupWSLcross.bat @@ -2,8 +2,11 @@ rem Setup MCL and echo the environment rem Usage: eval `cmd.exe /c SetupWSLcross.bat x64` +set MACHINE="%~1" IF "%~1"=="x86" GOTO search IF "%~1"=="x64" GOTO search +IF "%~1"=="arm64" GOTO search +IF "%~1"=="amd64_arm64" GOTO search GOTO badarg @@ -87,7 +90,7 @@ wsl.exe echo "# Eval this file eval \`cmd.exe /c SetupWSLcross.bat\`" exit :badarg -echo "Bad TARGET or not specified: %~1 expected x86 or x64" +echo "Bad TARGET or not specified: %~1 expected x86, x64, arm64 or x64_arm64" exit :no_vcvars diff --git a/erts/etc/win32/wsl_tools/reg_query.sh b/erts/etc/win32/wsl_tools/reg_query.sh index c05f00dfa191..0c7e401b2ce3 100755 --- a/erts/etc/win32/wsl_tools/reg_query.sh +++ b/erts/etc/win32/wsl_tools/reg_query.sh @@ -10,6 +10,8 @@ BACKED=`echo "$1" | sed 's,/,\\\\,g'` if [ $CONFIG_SUBTYPE = "win64" ]; then REG_OPT=" /reg:64" +elif [ X"$CONFIG_SUBTYPE" = X"arm64" -o X"$CONFIG_SUBTYPE" = X"x86_arm64" ]; then + REG_OPT=" /reg:64" else REG_OPT=" /reg:32" fi diff --git a/erts/etc/win32/wsl_tools/vc/cc.sh b/erts/etc/win32/wsl_tools/vc/cc.sh index 5203ff5f17c5..b37167d7bcbc 100755 --- a/erts/etc/win32/wsl_tools/vc/cc.sh +++ b/erts/etc/win32/wsl_tools/vc/cc.sh @@ -26,6 +26,12 @@ SAVE="$@" +if [ "$CONFIG_SUBTYPE" = "x64_arm64" -o "$CONFIG_SUBTYPE" = "arm64" ]; then + MACHINE="ARM64" +else + MACHINE="$CONFIG_SUBTYPE" +fi + # Constants COMMON_CFLAGS="-nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -D_CRT_SECURE_NO_DEPRECATE" @@ -64,7 +70,7 @@ CMD="" # All the c source files, in unix style SOURCES="" # All the options to pass to the linker, kept in Unix style -LINKCMD="" +LINKCMD="-MACHINE:${MACHINE}" # Loop through the parameters and set the above variables accordingly diff --git a/erts/etc/win32/wsl_tools/vc/emu_cc.sh b/erts/etc/win32/wsl_tools/vc/emu_cc.sh index fd931c826023..839c84ac1a06 100755 --- a/erts/etc/win32/wsl_tools/vc/emu_cc.sh +++ b/erts/etc/win32/wsl_tools/vc/emu_cc.sh @@ -23,6 +23,8 @@ if [ X"$CONFIG_SUBTYPE" = X"win64" ]; then GCC="x86_64-w64-mingw32-gcc -m64" +elif [ X"$CONFIG_SUBTYPE" = X"arm64" -o X"$CONFIG_SUBTYPE" = X"x86_arm64" ]; then + GCC="aarch64-w64-mingw32-gcc -m64" else GCC="x86_64-w64-mingw32-gcc -m32" fi From f4eb21e739f146021b6475ff4c446b7ce4bf983e Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 19 Feb 2024 22:28:16 +0800 Subject: [PATCH 02/28] added aarch64 target support --- otp_build | 64 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/otp_build b/otp_build index 6349ad947817..c73140e20abc 100755 --- a/otp_build +++ b/otp_build @@ -173,11 +173,23 @@ set_config_flags () if target_contains win32; then if [ "$CONFIG_SUBTYPE" = "win64" ]; then - bht_type=local-x86_64-pc-windows + build_type=local-x86_64-pc-windows + host_type=local-x86_64-pc-windows + target_type=local-x86_64-pc-windows + elif [ "$CONFIG_SUBTYPE" = "arm64" ]; then + build_type=local-aarch64-pc-windows + host_type=local-aarch64-pc-windows + target_type=local-aarch64-pc-windows + elif [ "$CONFIG_SUBTYPE" = "x64_arm64" ]; then + build_type=local-x86_64-pc-windows + host_type=local-aarch64-pc-windows + target_type=local-aarch64-pc-windows else - bht_type=local-x86-pc-windows + build_type=local-x86-pc-windows + host_type=local-x86-pc-windows + target_type=local-x86-pc-windows fi - CONFIG_FLAGS="--build=$bht_type --host=$bht_type --target=$bht_type $CONFIG_FLAGS" + CONFIG_FLAGS="--build=$build_type --host=$host_type --target=$target_type $CONFIG_FLAGS" fi @@ -737,6 +749,7 @@ echo_env_msys () echo_env_wsl () { X64=$1 + ARM64=$2 #echo_envinfo if [ X"$SHELL" = X"" ]; then echo "You need to export the shell variable first," \ @@ -754,6 +767,10 @@ echo_env_wsl () if [ ! -n "`lookup_prog_in_path cl`" ]; then if [ X"$X64" = X"true" ]; then setup_win32_cl_env "x64" `wslpath -a -m erts/etc/win32/wsl_tools/SetupWSLcross.bat` + elif [ X"$ARM64" = X"arm64" ]; then + setup_win32_cl_env "arm64" `wslpath -a -m erts/etc/win32/wsl_tools/SetupWSLcross.bat` + elif [ X"$ARM64" = X"x64_arm64" ]; then + setup_win32_cl_env "amd64_arm64" `wslpath -a -m erts/etc/win32/wsl_tools/SetupWSLcross.bat` else setup_win32_cl_env "x86" `wslpath -a -m erts/etc/win32/wsl_tools/SetupWSLcross.bat` fi @@ -761,6 +778,8 @@ echo_env_wsl () echo_setenv OVERRIDE_TARGET win32 ';' if [ X"$X64" = X"true" ]; then echo_setenv CONFIG_SUBTYPE win64 ';' + elif [ X"$ARM64" = X"arm64" -o X"$ARM64" = X"x64_arm64" ]; then + echo_setenv CONFIG_SUBTYPE "$ARM64" ';' fi echo_setenv WSLcross true ';' echo_setenv CC cc.sh ';' @@ -772,6 +791,11 @@ echo_env_wsl () echo_setenv OVERRIDE_CONFIG_CACHE_STATIC "$ERL_TOP/make/autoconf/win64.config.cache.static" ';' fi echo_setenv OVERRIDE_CONFIG_CACHE "$ERL_TOP/make/autoconf/win64.config.cache" ';' + elif [ X"$ARM64" = X"arm64" -o X"$ARM64" = X"x64_arm64" ]; then + if [ -f "$ERL_TOP/make/autoconf/win64-$ARM64.config.cache.static" ]; then + echo_setenv OVERRIDE_CONFIG_CACHE_STATIC "$ERL_TOP/make/autoconf/win64-$ARM64.config.cache.static" ';' + fi + echo_setenv OVERRIDE_CONFIG_CACHE "$ERL_TOP/make/autoconf/win64-$ARM64.config.cache" ';' else if [ -f "$ERL_TOP/make/autoconf/win32.config.cache.static" ]; then echo_setenv OVERRIDE_CONFIG_CACHE_STATIC "$ERL_TOP/make/autoconf/win32.config.cache.static" ';' @@ -1225,7 +1249,7 @@ case "$1" in do_configure "$@";; opt) do_boot;; - smp) + plain|smp) if [ $minus_x_flag = false ]; then TYPE=opt fi; @@ -1276,9 +1300,15 @@ case "$1" in env_win32) if [ x"$2" = x"x64" -o x"$2" = x"amd64" ]; then ISX64=true + elif [ x"$2" = x"arm64" ]; then + ISX64=false + ISARM64=arm64 + elif [ x"$2" = x"x64_arm64" ]; then + ISX64=false + ISARM64=x64_arm64 fi if [ -x /bin/wslpath ]; then - echo_env_wsl $ISX64 + echo_env_wsl $ISX64 $ISARM64 elif [ -x /usr/bin/msys-?.0.dll ]; then echo_env_msys $ISX64 else @@ -1287,17 +1317,33 @@ case "$1" in env_mingw32) echo_env_mingw32;; env_win64) + ISX64=true + if [ x"$2" = x"arm64" ]; then + ISX64=false + ISARM64=arm64 + elif [ x"$2" = x"x64_arm64" ]; then + ISX64=false + ISARM64=x64_arm64 + fi if [ -x /bin/wslpath ]; then - echo_env_wsl true + echo_env_wsl $ISX64 $ISARM64 elif [ -x /usr/bin/msys-?.0.dll ]; then - echo_env_msys true + echo_env_msys $ISX64 else - echo_env_cygwin true + echo_env_cygwin $ISX64 fi;; env_msys32) echo_env_msys;; env_msys64) - echo_env_msys true;; + ISX64=true + if [ x"$2" = x"arm64" ]; then + ISX64=false + ISARM64=arm64 + elif [ x"$2" = x"x64_arm64" ]; then + ISX64=false + ISARM64=x64_arm64 + fi + echo_env_msys $ISX64;; env_cross) echo_env_cross "$2";; env_bootstrap) From 554b2e3cd1a6ba527c425b93dffd8d073e644824 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Sat, 17 Feb 2024 23:58:25 +0800 Subject: [PATCH 03/28] added config cache files for aarch64 windows target --- make/autoconf/win64-arm64.config.cache.static | 358 ++++++++++++++++++ .../win64-x64_arm64.config.cache.static | 358 ++++++++++++++++++ 2 files changed, 716 insertions(+) create mode 100644 make/autoconf/win64-arm64.config.cache.static create mode 100644 make/autoconf/win64-x64_arm64.config.cache.static diff --git a/make/autoconf/win64-arm64.config.cache.static b/make/autoconf/win64-arm64.config.cache.static new file mode 100644 index 000000000000..a48a64dc6811 --- /dev/null +++ b/make/autoconf/win64-arm64.config.cache.static @@ -0,0 +1,358 @@ +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +# ac_cv_build=${ac_cv_build=local-aarch64-pc-windows} +ac_cv_c_bigendian=${ac_cv_c_bigendian=no} +ac_cv_c_compiler_gnu=${ac_cv_c_compiler_gnu=no} +ac_cv_c_const=${ac_cv_c_const=yes} +# ac_cv_c_double_middle_endian=${ac_cv_c_double_middle_endian=no} +ac_cv_c_undeclared_builtin_options=${ac_cv_c_undeclared_builtin_options='none needed'} +ac_cv_cxx_compiler_gnu=${ac_cv_cxx_compiler_gnu=no} +ac_cv_decl_h_errno=${ac_cv_decl_h_errno=no} +ac_cv_decl_inaddr_loopback=${ac_cv_decl_inaddr_loopback=no} +ac_cv_decl_inaddr_loopback_rpc=${ac_cv_decl_inaddr_loopback_rpc=no} +ac_cv_decl_inaddr_loopback_winsock2=${ac_cv_decl_inaddr_loopback_winsock2=yes} +ac_cv_decl_so_bsdcompat=${ac_cv_decl_so_bsdcompat=no} +ac_cv_decl_sys_errlist=${ac_cv_decl_sys_errlist=no} +ac_cv_env_AR_set=set +ac_cv_env_AR_value=ar.sh +ac_cv_env_CCC_set= +ac_cv_env_CCC_value= +ac_cv_env_CC_set=set +ac_cv_env_CC_value=cc.sh +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +# ac_cv_env_CFLAG_RUNTIME_LIBRARY_PATH_set= +# ac_cv_env_CFLAG_RUNTIME_LIBRARY_PATH_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set=set +ac_cv_env_CXX_value=cc.sh +# ac_cv_env_DED_LDFLAGS_set= +# ac_cv_env_DED_LDFLAGS_value= +# ac_cv_env_DED_LD_FLAG_RUNTIME_LIBRARY_PATH_set= +# ac_cv_env_DED_LD_FLAG_RUNTIME_LIBRARY_PATH_value= +# ac_cv_env_DED_LD_set= +# ac_cv_env_DED_LD_value= +# ac_cv_env_ERL_TOP_set=set +# ac_cv_env_ERL_TOP_value=$ERL_TOP +# ac_cv_env_GETCONF_set= +# ac_cv_env_GETCONF_value= +# ac_cv_env_LDFLAGS_set= +# ac_cv_env_LDFLAGS_value= +# ac_cv_env_LD_set= +# ac_cv_env_LD_value= +# ac_cv_env_LFS_CFLAGS_set= +# ac_cv_env_LFS_CFLAGS_value= +# ac_cv_env_LFS_LDFLAGS_set= +# ac_cv_env_LFS_LDFLAGS_value= +# ac_cv_env_LFS_LIBS_set= +# ac_cv_env_LFS_LIBS_value= +# ac_cv_env_LIBS_set= +# ac_cv_env_LIBS_value= +# ac_cv_env_RANLIB_set=set +# ac_cv_env_RANLIB_value=true +# ac_cv_env_STATIC_CFLAGS_set= +# ac_cv_env_STATIC_CFLAGS_value= +# ac_cv_env_YACC_set= +# ac_cv_env_YACC_value= +# ac_cv_env_YFLAGS_set= +# ac_cv_env_YFLAGS_value= +ac_cv_env_build_alias_set=set +ac_cv_env_build_alias_value=local-aarch64-pc-windows +# ac_cv_env_erl_xcomp_after_morecore_hook_set= +# ac_cv_env_erl_xcomp_after_morecore_hook_value= +# ac_cv_env_erl_xcomp_bigendian_set= +# ac_cv_env_erl_xcomp_bigendian_value= +# ac_cv_env_erl_xcomp_clock_gettime_cpu_time_set= +# ac_cv_env_erl_xcomp_clock_gettime_cpu_time_value= +# ac_cv_env_erl_xcomp_dlsym_brk_wrappers_set= +# ac_cv_env_erl_xcomp_dlsym_brk_wrappers_value= +# ac_cv_env_erl_xcomp_double_middle_endian_set= +# ac_cv_env_erl_xcomp_double_middle_endian_value= +# ac_cv_env_erl_xcomp_getaddrinfo_set= +# ac_cv_env_erl_xcomp_getaddrinfo_value= +# ac_cv_env_erl_xcomp_gethrvtime_procfs_ioctl_set= +# ac_cv_env_erl_xcomp_gethrvtime_procfs_ioctl_value= +# ac_cv_env_erl_xcomp_isysroot_set= +# ac_cv_env_erl_xcomp_isysroot_value= +# ac_cv_env_erl_xcomp_kqueue_set= +# ac_cv_env_erl_xcomp_kqueue_value= +# ac_cv_env_erl_xcomp_linux_nptl_set= +# ac_cv_env_erl_xcomp_linux_nptl_value= +# ac_cv_env_erl_xcomp_linux_usable_sigaltstack_set= +# ac_cv_env_erl_xcomp_linux_usable_sigaltstack_value= +# ac_cv_env_erl_xcomp_linux_usable_sigusrx_set= +# ac_cv_env_erl_xcomp_linux_usable_sigusrx_value= +# ac_cv_env_erl_xcomp_poll_set= +# ac_cv_env_erl_xcomp_poll_value= +# ac_cv_env_erl_xcomp_putenv_copy_set= +# ac_cv_env_erl_xcomp_putenv_copy_value= +# ac_cv_env_erl_xcomp_reliable_fpe_set= +# ac_cv_env_erl_xcomp_reliable_fpe_value= +# ac_cv_env_erl_xcomp_sysroot_set= +# ac_cv_env_erl_xcomp_sysroot_value= +ac_cv_env_host_alias_set=set +ac_cv_env_host_alias_value=local-aarch64-pc-windows +ac_cv_env_target_alias_set=set +ac_cv_env_target_alias_value=local-aarch64-pc-windows +ac_cv_exeext=${ac_cv_exeext=.exe} +ac_cv_func___brk=${ac_cv_func___brk=no} +ac_cv_func___sbrk=${ac_cv_func___sbrk=no} +ac_cv_func__brk=${ac_cv_func__brk=no} +ac_cv_func__doprnt=${ac_cv_func__doprnt=no} +ac_cv_func__sbrk=${ac_cv_func__sbrk=no} +ac_cv_func_brk=${ac_cv_func_brk=no} +ac_cv_func_clock_get_attributes=${ac_cv_func_clock_get_attributes=no} +ac_cv_func_clock_getres=${ac_cv_func_clock_getres=no} +ac_cv_func_closefrom=${ac_cv_func_closefrom=no} +ac_cv_func_connect=${ac_cv_func_connect=no} +ac_cv_func_decl_fread=${ac_cv_func_decl_fread=yes} +ac_cv_func_dlopen=${ac_cv_func_dlopen=no} +ac_cv_func_dlvsym=${ac_cv_func_dlvsym=no} +ac_cv_func_endprotoent=${ac_cv_func_endprotoent=no} +ac_cv_func_fdatasync=${ac_cv_func_fdatasync=no} +ac_cv_func_finite=${ac_cv_func_finite=no} +ac_cv_func_flockfile=${ac_cv_func_flockfile=no} +ac_cv_func_fpsetmask=${ac_cv_func_fpsetmask=no} +ac_cv_func_fstat=${ac_cv_func_fstat=yes} +ac_cv_func_gethostbyname2=${ac_cv_func_gethostbyname2=no} +ac_cv_func_gethostbyname=${ac_cv_func_gethostbyname=yes} +ac_cv_func_gethostbyname_r=${ac_cv_func_gethostbyname_r=no} +ac_cv_func_gethostname=${ac_cv_func_gethostname=no} +ac_cv_func_gethrtime=${ac_cv_func_gethrtime=no} +ac_cv_func_getifaddrs=${ac_cv_func_getifaddrs=no} +ac_cv_func_getipnodebyaddr=${ac_cv_func_getipnodebyaddr=no} +ac_cv_func_getipnodebyname=${ac_cv_func_getipnodebyname=no} +ac_cv_func_getprotoent=${ac_cv_func_getprotoent=no} +ac_cv_func_getrusage=${ac_cv_func_getrusage=no} +ac_cv_func_gettimeofday=${ac_cv_func_gettimeofday=no} +ac_cv_func_gmtime_r=${ac_cv_func_gmtime_r=no} +ac_cv_func_ieee_handler=${ac_cv_func_ieee_handler=no} +ac_cv_func_if_freenameindex=${ac_cv_func_if_freenameindex=no} +ac_cv_func_if_indextoname=${ac_cv_func_if_indextoname=no} +ac_cv_func_if_nameindex=${ac_cv_func_if_nameindex=no} +ac_cv_func_if_nametoindex=${ac_cv_func_if_nametoindex=no} +ac_cv_func_isinf=${ac_cv_func_isinf=no} +ac_cv_func_isnan=${ac_cv_func_isnan=no} +ac_cv_func_localtime_r=${ac_cv_func_localtime_r=no} +ac_cv_func_log2=${ac_cv_func_log2=no} +ac_cv_func_madvise=${ac_cv_func_madvise=no} +ac_cv_func_mallopt=${ac_cv_func_mallopt=no} +ac_cv_func_memcpy=${ac_cv_func_memcpy=no} +ac_cv_func_memmove=${ac_cv_func_memmove=no} +ac_cv_func_mlockall=${ac_cv_func_mlockall=no} +ac_cv_func_mmap=${ac_cv_func_mmap=no} +ac_cv_func_mprotect=${ac_cv_func_mprotect=no} +ac_cv_func_mremap=${ac_cv_func_mremap=no} +ac_cv_func_nl_langinfo=${ac_cv_func_nl_langinfo=no} +ac_cv_func_openpty=${ac_cv_func_openpty=no} +ac_cv_func_poll=${ac_cv_func_poll=no} +ac_cv_func_posix2time=${ac_cv_func_posix2time=no} +ac_cv_func_posix_fadvise=${ac_cv_func_posix_fadvise=no} +ac_cv_func_posix_madvise=${ac_cv_func_posix_madvise=no} +ac_cv_func_posix_memalign=${ac_cv_func_posix_memalign=no} +ac_cv_func_ppoll=${ac_cv_func_ppoll=no} +ac_cv_func_pread=${ac_cv_func_pread=no} +ac_cv_func_pwrite=${ac_cv_func_pwrite=no} +ac_cv_func_res_gethostbyname=${ac_cv_func_res_gethostbyname=no} +ac_cv_func_sbrk=${ac_cv_func_sbrk=no} +ac_cv_func_setlocale=${ac_cv_func_setlocale=yes} +ac_cv_func_setns=${ac_cv_func_setns=no} +ac_cv_func_setprotoent=${ac_cv_func_setprotoent=no} +ac_cv_func_setsid=${ac_cv_func_setsid=no} +ac_cv_func_strerror=${ac_cv_func_strerror=yes} +ac_cv_func_strerror_r=${ac_cv_func_strerror_r=no} +ac_cv_func_strftime=${ac_cv_func_strftime=yes} +ac_cv_func_strlcat=${ac_cv_func_strlcat=no} +ac_cv_func_strlcpy=${ac_cv_func_strlcpy=no} +ac_cv_func_strncasecmp=${ac_cv_func_strncasecmp=no} +ac_cv_func_time2posix=${ac_cv_func_time2posix=no} +ac_cv_func_vprintf=${ac_cv_func_vprintf=no} +ac_cv_func_vsyslog=${ac_cv_func_vsyslog=no} +ac_cv_func_writev=${ac_cv_func_writev=no} +ac_cv_have_decl_IN6ADDR_ANY_INIT=${ac_cv_have_decl_IN6ADDR_ANY_INIT=no} +ac_cv_have_decl_IN6ADDR_LOOPBACK_INIT=${ac_cv_have_decl_IN6ADDR_LOOPBACK_INIT=no} +ac_cv_have_decl_IPV6_V6ONLY=${ac_cv_have_decl_IPV6_V6ONLY=no} +ac_cv_have_decl_posix2time=${ac_cv_have_decl_posix2time=no} +ac_cv_have_decl_time2posix=${ac_cv_have_decl_time2posix=no} +ac_cv_header_arpa_nameser_h=${ac_cv_header_arpa_nameser_h=no} +ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h=no} +ac_cv_header_dirent_ndir_h=${ac_cv_header_dirent_ndir_h=no} +ac_cv_header_dirent_sys_dir_h=${ac_cv_header_dirent_sys_dir_h=no} +ac_cv_header_dirent_sys_ndir_h=${ac_cv_header_dirent_sys_ndir_h=no} +ac_cv_header_dlfcn_h=${ac_cv_header_dlfcn_h=no} +ac_cv_header_elf_h=${ac_cv_header_elf_h=no} +ac_cv_header_fcntl_h=${ac_cv_header_fcntl_h=yes} +ac_cv_header_ieeefp_h=${ac_cv_header_ieeefp_h=no} +ac_cv_header_ifaddrs_h=${ac_cv_header_ifaddrs_h=no} +ac_cv_header_inttypes_h=${ac_cv_header_inttypes_h=yes} +ac_cv_header_langinfo_h=${ac_cv_header_langinfo_h=no} +ac_cv_header_libdlpi_h=${ac_cv_header_libdlpi_h=no} +ac_cv_header_libutil_h=${ac_cv_header_libutil_h=no} +ac_cv_header_limits_h=${ac_cv_header_limits_h=yes} +ac_cv_header_linux_errqueue_h=${ac_cv_header_linux_errqueue_h=no} +ac_cv_header_linux_falloc_h=${ac_cv_header_linux_falloc_h=no} +ac_cv_header_linux_types_h=${ac_cv_header_linux_types_h=no} +ac_cv_header_malloc_h=${ac_cv_header_malloc_h=yes} +ac_cv_header_net_errno_h=${ac_cv_header_net_errno_h=no} +ac_cv_header_net_if_dl_h=${ac_cv_header_net_if_dl_h=no} +ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no} +ac_cv_header_netpacket_packet_h=${ac_cv_header_netpacket_packet_h=no} +ac_cv_header_poll_h=${ac_cv_header_poll_h=no} +ac_cv_header_pty_h=${ac_cv_header_pty_h=no} +ac_cv_header_sched_h=${ac_cv_header_sched_h=no} +ac_cv_header_sdkddkver_h=${ac_cv_header_sdkddkver_h=yes} +ac_cv_header_setns_h=${ac_cv_header_setns_h=no} +ac_cv_header_stdint_h=${ac_cv_header_stdint_h=yes} +ac_cv_header_stdio_h=${ac_cv_header_stdio_h=yes} +ac_cv_header_stdlib_h=${ac_cv_header_stdlib_h=yes} +ac_cv_header_string_h=${ac_cv_header_string_h=yes} +ac_cv_header_strings_h=${ac_cv_header_strings_h=no} +ac_cv_header_sys_devpoll_h=${ac_cv_header_sys_devpoll_h=no} +ac_cv_header_sys_epoll_h=${ac_cv_header_sys_epoll_h=no} +ac_cv_header_sys_event_h=${ac_cv_header_sys_event_h=no} +ac_cv_header_sys_ioctl_h=${ac_cv_header_sys_ioctl_h=no} +ac_cv_header_sys_mman_h=${ac_cv_header_sys_mman_h=no} +ac_cv_header_sys_resource_h=${ac_cv_header_sys_resource_h=no} +ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no} +ac_cv_header_sys_socketio_h=${ac_cv_header_sys_socketio_h=no} +ac_cv_header_sys_sockio_h=${ac_cv_header_sys_sockio_h=no} +ac_cv_header_sys_stat_h=${ac_cv_header_sys_stat_h=yes} +ac_cv_header_sys_stropts_h=${ac_cv_header_sys_stropts_h=no} +ac_cv_header_sys_sysctl_h=${ac_cv_header_sys_sysctl_h=no} +ac_cv_header_sys_time_h=${ac_cv_header_sys_time_h=no} +ac_cv_header_sys_timerfd_h=${ac_cv_header_sys_timerfd_h=no} +ac_cv_header_sys_types_h=${ac_cv_header_sys_types_h=yes} +ac_cv_header_sys_uio_h=${ac_cv_header_sys_uio_h=no} +ac_cv_header_sys_un_h=${ac_cv_header_sys_un_h=no} +ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h=no} +ac_cv_header_syslog_h=${ac_cv_header_syslog_h=no} +ac_cv_header_unistd_h=${ac_cv_header_unistd_h=no} +ac_cv_header_util_h=${ac_cv_header_util_h=no} +ac_cv_header_utmp_h=${ac_cv_header_utmp_h=no} +ac_cv_header_valgrind_valgrind_h=${ac_cv_header_valgrind_valgrind_h=no} +ac_cv_header_windows_h=${ac_cv_header_windows_h=yes} +ac_cv_header_winsock2_h=${ac_cv_header_winsock2_h=yes} +ac_cv_header_ws2tcpip_h=${ac_cv_header_ws2tcpip_h=yes} +ac_cv_host=${ac_cv_host=local-aarch64-pc-windows} +ac_cv_lib_dl_dlopen=${ac_cv_lib_dl_dlopen=no} +ac_cv_lib_dl_dlvsym=${ac_cv_lib_dl_dlvsym=no} +ac_cv_lib_dlpi_dlpi_open=${ac_cv_lib_dlpi_dlpi_open=no} +ac_cv_lib_inet_main=${ac_cv_lib_inet_main=no} +ac_cv_lib_kstat_kstat_open=${ac_cv_lib_kstat_kstat_open=no} +ac_cv_lib_kvm_kvm_open=${ac_cv_lib_kvm_kvm_open=no} +ac_cv_lib_m_sin=${ac_cv_lib_m_sin=no} +ac_cv_lib_rt_clock_gettime=${ac_cv_lib_rt_clock_gettime=no} +ac_cv_lib_socket_main=${ac_cv_lib_socket_main=yes} +ac_cv_lib_util_openpty=${ac_cv_lib_util_openpty=no} +ac_cv_member_struct_ifreq_ifr_enaddr=${ac_cv_member_struct_ifreq_ifr_enaddr=no} +ac_cv_member_struct_ifreq_ifr_hwaddr=${ac_cv_member_struct_ifreq_ifr_hwaddr=no} +ac_cv_member_struct_ifreq_ifr_ifindex=${ac_cv_member_struct_ifreq_ifr_ifindex=no} +ac_cv_member_struct_ifreq_ifr_index=${ac_cv_member_struct_ifreq_ifr_index=no} +ac_cv_member_struct_ifreq_ifr_map=${ac_cv_member_struct_ifreq_ifr_map=no} +ac_cv_member_struct_sockaddr_dl_sdl_len=${ac_cv_member_struct_sockaddr_dl_sdl_len=no} +ac_cv_member_struct_sockaddr_un_sun_path=${ac_cv_member_struct_sockaddr_un_sun_path=no} +ac_cv_objext=${ac_cv_objext=o} +# ac_cv_path_CP=${ac_cv_path_CP=/bin/cp} +# ac_cv_path_EGREP=${ac_cv_path_EGREP='/usr/bin/grep -E'} +# ac_cv_path_GREP=${ac_cv_path_GREP=/usr/bin/grep} +# ac_cv_path_MKDIR=${ac_cv_path_MKDIR=/bin/mkdir} +# ac_cv_path_PERL=${ac_cv_path_PERL=/usr/bin/perl} +# ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'} +ac_cv_prog_AR=${ac_cv_prog_AR=ar.sh} +ac_cv_prog_CC=${ac_cv_prog_CC=cc.sh} +ac_cv_prog_CPP=${ac_cv_prog_CPP='cc.sh -E'} +ac_cv_prog_GETCONF=${ac_cv_prog_GETCONF=getconf} +ac_cv_prog_JAVAC=${ac_cv_prog_JAVAC=javac.sh} +ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=true} +ac_cv_prog_cc_c11=${ac_cv_prog_cc_c11=no} +ac_cv_prog_cc_c89=${ac_cv_prog_cc_c89=no} +ac_cv_prog_cc_c99=${ac_cv_prog_cc_c99=no} +ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes} +ac_cv_prog_cxx_11=${ac_cv_prog_cxx_11=no} +ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g=yes} +ac_cv_prog_cxx_stdcxx=${ac_cv_prog_cxx_stdcxx=} +# ac_cv_prog_emu_cc=${ac_cv_prog_emu_cc=$ERL_TOP/git/otp/erts/etc/win32/wsl_tools/vc/emu_cc.sh} +# ac_cv_prog_javac_ver_1_6=${ac_cv_prog_javac_ver_1_6=no} +# ac_cv_prog_mkdir_p=${ac_cv_prog_mkdir_p='/usr/bin/install -c -d'} +ac_cv_search_fdatasync=${ac_cv_search_fdatasync=no} +ac_cv_search_opendir=${ac_cv_search_opendir=no} +ac_cv_search_strerror=${ac_cv_search_strerror='none required'} +ac_cv_sizeof__Float16=${ac_cv_sizeof__Float16=0} +ac_cv_sizeof___int128_t=${ac_cv_sizeof___int128_t=0} +ac_cv_sizeof___int64=${ac_cv_sizeof___int64=8} +ac_cv_sizeof_char=${ac_cv_sizeof_char=1} +ac_cv_sizeof_int=${ac_cv_sizeof_int=4} +ac_cv_sizeof_long=${ac_cv_sizeof_long=4} +ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8} +ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=4} +ac_cv_sizeof_short=${ac_cv_sizeof_short=2} +ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=8} +ac_cv_sizeof_suseconds_t=${ac_cv_sizeof_suseconds_t=0} +ac_cv_sizeof_time_t=${ac_cv_sizeof_time_t=8} +ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8} +ac_cv_struct_sockaddr_sa_len=${ac_cv_struct_sockaddr_sa_len=no} +ac_cv_struct_tm=${ac_cv_struct_tm=time.h} +# ac_cv_sys_ipv6_support=${ac_cv_sys_ipv6_support=yes} +ac_cv_sys_multicast_support=${ac_cv_sys_multicast_support=no} +ac_cv_target=${ac_cv_target=local-aarch64-pc-windows} +ac_cv_type_off_t=${ac_cv_type_off_t=yes} +ac_cv_type_pid_t=${ac_cv_type_pid_t=no} +ac_cv_type_size_t=${ac_cv_type_size_t=yes} +erl_cv_clock_gettime_monotonic_default_resolution=${erl_cv_clock_gettime_monotonic_default_resolution=no} +erl_cv_clock_gettime_monotonic_high_resolution=${erl_cv_clock_gettime_monotonic_high_resolution=no} +erl_cv_clock_gettime_monotonic_raw=${erl_cv_clock_gettime_monotonic_raw=no} +erl_cv_clock_gettime_monotonic_try_find_pthread_compatible=${erl_cv_clock_gettime_monotonic_try_find_pthread_compatible=no} +erl_cv_clock_gettime_wall_default_resolution=${erl_cv_clock_gettime_wall_default_resolution=no} +erl_cv_mach_clock_get_time_monotonic=${erl_cv_mach_clock_get_time_monotonic=no} +erl_cv_mach_clock_get_time_wall=${erl_cv_mach_clock_get_time_wall=no} +erts_cv___after_morecore_hook_can_track_malloc=${erts_cv___after_morecore_hook_can_track_malloc=no} +erts_cv_fwrite_unlocked=${erts_cv_fwrite_unlocked=no} +erts_cv_have__end_symbol=${erts_cv_have__end_symbol=no} +erts_cv_have_end_symbol=${erts_cv_have_end_symbol=no} +erts_cv_have_in6addr_any=${erts_cv_have_in6addr_any=no} +erts_cv_have_in6addr_loopback=${erts_cv_have_in6addr_loopback=no} +erts_cv_putc_unlocked=${erts_cv_putc_unlocked=no} +erts_cv_windows_h_includes_winsock2_h=${erts_cv_windows_h_includes_winsock2_h=no} +ethr_cv_have__InterlockedAnd64=${ethr_cv_have__InterlockedAnd64=yes} +ethr_cv_have__InterlockedAnd=${ethr_cv_have__InterlockedAnd=yes} +ethr_cv_have__InterlockedCompareExchange128=${ethr_cv_have__InterlockedCompareExchange128=yes} +ethr_cv_have__InterlockedCompareExchange64=${ethr_cv_have__InterlockedCompareExchange64=yes} +# ethr_cv_have__InterlockedCompareExchange64_acq=${ethr_cv_have__InterlockedCompareExchange64_acq=no} +# ethr_cv_have__InterlockedCompareExchange64_rel=${ethr_cv_have__InterlockedCompareExchange64_rel=no} +ethr_cv_have__InterlockedCompareExchange=${ethr_cv_have__InterlockedCompareExchange=yes} +# ethr_cv_have__InterlockedCompareExchange_acq=${ethr_cv_have__InterlockedCompareExchange_acq=no} +# ethr_cv_have__InterlockedCompareExchange_rel=${ethr_cv_have__InterlockedCompareExchange_rel=no} +ethr_cv_have__InterlockedDecrement64=${ethr_cv_have__InterlockedDecrement64=yes} +# ethr_cv_have__InterlockedDecrement64_rel=${ethr_cv_have__InterlockedDecrement64_rel=no} +ethr_cv_have__InterlockedDecrement=${ethr_cv_have__InterlockedDecrement=yes} +# ethr_cv_have__InterlockedDecrement_rel=${ethr_cv_have__InterlockedDecrement_rel=no} +ethr_cv_have__InterlockedExchange64=${ethr_cv_have__InterlockedExchange64=yes} +ethr_cv_have__InterlockedExchange=${ethr_cv_have__InterlockedExchange=yes} +ethr_cv_have__InterlockedExchangeAdd64=${ethr_cv_have__InterlockedExchangeAdd64=yes} +# ethr_cv_have__InterlockedExchangeAdd64_acq=${ethr_cv_have__InterlockedExchangeAdd64_acq=no} +ethr_cv_have__InterlockedExchangeAdd=${ethr_cv_have__InterlockedExchangeAdd=yes} +# ethr_cv_have__InterlockedExchangeAdd_acq=${ethr_cv_have__InterlockedExchangeAdd_acq=no} +ethr_cv_have__InterlockedIncrement64=${ethr_cv_have__InterlockedIncrement64=yes} +# ethr_cv_have__InterlockedIncrement64_acq=${ethr_cv_have__InterlockedIncrement64_acq=no} +ethr_cv_have__InterlockedIncrement=${ethr_cv_have__InterlockedIncrement=yes} +# ethr_cv_have__InterlockedIncrement_acq=${ethr_cv_have__InterlockedIncrement_acq=no} +ethr_cv_have__InterlockedOr64=${ethr_cv_have__InterlockedOr64=yes} +ethr_cv_have__InterlockedOr=${ethr_cv_have__InterlockedOr=yes} +i_cv_fallocate_works=${i_cv_fallocate_works=no} +i_cv_posix_fallocate_works=${i_cv_posix_fallocate_works=no} diff --git a/make/autoconf/win64-x64_arm64.config.cache.static b/make/autoconf/win64-x64_arm64.config.cache.static new file mode 100644 index 000000000000..774914b0261e --- /dev/null +++ b/make/autoconf/win64-x64_arm64.config.cache.static @@ -0,0 +1,358 @@ +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +# ac_cv_build=${ac_cv_build=local-x86_64-pc-windows} +ac_cv_c_bigendian=${ac_cv_c_bigendian=no} +ac_cv_c_compiler_gnu=${ac_cv_c_compiler_gnu=no} +ac_cv_c_const=${ac_cv_c_const=yes} +# ac_cv_c_double_middle_endian=${ac_cv_c_double_middle_endian=no} +ac_cv_c_undeclared_builtin_options=${ac_cv_c_undeclared_builtin_options='none needed'} +ac_cv_cxx_compiler_gnu=${ac_cv_cxx_compiler_gnu=no} +ac_cv_decl_h_errno=${ac_cv_decl_h_errno=no} +ac_cv_decl_inaddr_loopback=${ac_cv_decl_inaddr_loopback=no} +ac_cv_decl_inaddr_loopback_rpc=${ac_cv_decl_inaddr_loopback_rpc=no} +ac_cv_decl_inaddr_loopback_winsock2=${ac_cv_decl_inaddr_loopback_winsock2=yes} +ac_cv_decl_so_bsdcompat=${ac_cv_decl_so_bsdcompat=no} +ac_cv_decl_sys_errlist=${ac_cv_decl_sys_errlist=no} +ac_cv_env_AR_set=set +ac_cv_env_AR_value=ar.sh +ac_cv_env_CCC_set= +ac_cv_env_CCC_value= +ac_cv_env_CC_set=set +ac_cv_env_CC_value=cc.sh +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +# ac_cv_env_CFLAG_RUNTIME_LIBRARY_PATH_set= +# ac_cv_env_CFLAG_RUNTIME_LIBRARY_PATH_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_CXXFLAGS_set= +ac_cv_env_CXXFLAGS_value= +ac_cv_env_CXX_set=set +ac_cv_env_CXX_value=cc.sh +# ac_cv_env_DED_LDFLAGS_set= +# ac_cv_env_DED_LDFLAGS_value= +# ac_cv_env_DED_LD_FLAG_RUNTIME_LIBRARY_PATH_set= +# ac_cv_env_DED_LD_FLAG_RUNTIME_LIBRARY_PATH_value= +# ac_cv_env_DED_LD_set= +# ac_cv_env_DED_LD_value= +# ac_cv_env_ERL_TOP_set=set +# ac_cv_env_ERL_TOP_value=$ERL_TOP +# ac_cv_env_GETCONF_set= +# ac_cv_env_GETCONF_value= +# ac_cv_env_LDFLAGS_set= +# ac_cv_env_LDFLAGS_value= +# ac_cv_env_LD_set= +# ac_cv_env_LD_value= +# ac_cv_env_LFS_CFLAGS_set= +# ac_cv_env_LFS_CFLAGS_value= +# ac_cv_env_LFS_LDFLAGS_set= +# ac_cv_env_LFS_LDFLAGS_value= +# ac_cv_env_LFS_LIBS_set= +# ac_cv_env_LFS_LIBS_value= +# ac_cv_env_LIBS_set= +# ac_cv_env_LIBS_value= +# ac_cv_env_RANLIB_set=set +# ac_cv_env_RANLIB_value=true +# ac_cv_env_STATIC_CFLAGS_set= +# ac_cv_env_STATIC_CFLAGS_value= +# ac_cv_env_YACC_set= +# ac_cv_env_YACC_value= +# ac_cv_env_YFLAGS_set= +# ac_cv_env_YFLAGS_value= +ac_cv_env_build_alias_set=set +ac_cv_env_build_alias_value=local-x86_64-pc-windows +# ac_cv_env_erl_xcomp_after_morecore_hook_set= +# ac_cv_env_erl_xcomp_after_morecore_hook_value= +# ac_cv_env_erl_xcomp_bigendian_set= +# ac_cv_env_erl_xcomp_bigendian_value= +# ac_cv_env_erl_xcomp_clock_gettime_cpu_time_set= +# ac_cv_env_erl_xcomp_clock_gettime_cpu_time_value= +# ac_cv_env_erl_xcomp_dlsym_brk_wrappers_set= +# ac_cv_env_erl_xcomp_dlsym_brk_wrappers_value= +# ac_cv_env_erl_xcomp_double_middle_endian_set= +# ac_cv_env_erl_xcomp_double_middle_endian_value= +# ac_cv_env_erl_xcomp_getaddrinfo_set= +# ac_cv_env_erl_xcomp_getaddrinfo_value= +# ac_cv_env_erl_xcomp_gethrvtime_procfs_ioctl_set= +# ac_cv_env_erl_xcomp_gethrvtime_procfs_ioctl_value= +# ac_cv_env_erl_xcomp_isysroot_set= +# ac_cv_env_erl_xcomp_isysroot_value= +# ac_cv_env_erl_xcomp_kqueue_set= +# ac_cv_env_erl_xcomp_kqueue_value= +# ac_cv_env_erl_xcomp_linux_nptl_set= +# ac_cv_env_erl_xcomp_linux_nptl_value= +# ac_cv_env_erl_xcomp_linux_usable_sigaltstack_set= +# ac_cv_env_erl_xcomp_linux_usable_sigaltstack_value= +# ac_cv_env_erl_xcomp_linux_usable_sigusrx_set= +# ac_cv_env_erl_xcomp_linux_usable_sigusrx_value= +# ac_cv_env_erl_xcomp_poll_set= +# ac_cv_env_erl_xcomp_poll_value= +# ac_cv_env_erl_xcomp_putenv_copy_set= +# ac_cv_env_erl_xcomp_putenv_copy_value= +# ac_cv_env_erl_xcomp_reliable_fpe_set= +# ac_cv_env_erl_xcomp_reliable_fpe_value= +# ac_cv_env_erl_xcomp_sysroot_set= +# ac_cv_env_erl_xcomp_sysroot_value= +ac_cv_env_host_alias_set=set +ac_cv_env_host_alias_value=local-aarch64-pc-windows +ac_cv_env_target_alias_set=set +ac_cv_env_target_alias_value=local-aarch64-pc-windows +ac_cv_exeext=${ac_cv_exeext=.exe} +ac_cv_func___brk=${ac_cv_func___brk=no} +ac_cv_func___sbrk=${ac_cv_func___sbrk=no} +ac_cv_func__brk=${ac_cv_func__brk=no} +ac_cv_func__doprnt=${ac_cv_func__doprnt=no} +ac_cv_func__sbrk=${ac_cv_func__sbrk=no} +ac_cv_func_brk=${ac_cv_func_brk=no} +ac_cv_func_clock_get_attributes=${ac_cv_func_clock_get_attributes=no} +ac_cv_func_clock_getres=${ac_cv_func_clock_getres=no} +ac_cv_func_closefrom=${ac_cv_func_closefrom=no} +ac_cv_func_connect=${ac_cv_func_connect=no} +ac_cv_func_decl_fread=${ac_cv_func_decl_fread=yes} +ac_cv_func_dlopen=${ac_cv_func_dlopen=no} +ac_cv_func_dlvsym=${ac_cv_func_dlvsym=no} +ac_cv_func_endprotoent=${ac_cv_func_endprotoent=no} +ac_cv_func_fdatasync=${ac_cv_func_fdatasync=no} +ac_cv_func_finite=${ac_cv_func_finite=no} +ac_cv_func_flockfile=${ac_cv_func_flockfile=no} +ac_cv_func_fpsetmask=${ac_cv_func_fpsetmask=no} +ac_cv_func_fstat=${ac_cv_func_fstat=yes} +ac_cv_func_gethostbyname2=${ac_cv_func_gethostbyname2=no} +ac_cv_func_gethostbyname=${ac_cv_func_gethostbyname=yes} +ac_cv_func_gethostbyname_r=${ac_cv_func_gethostbyname_r=no} +ac_cv_func_gethostname=${ac_cv_func_gethostname=no} +ac_cv_func_gethrtime=${ac_cv_func_gethrtime=no} +ac_cv_func_getifaddrs=${ac_cv_func_getifaddrs=no} +ac_cv_func_getipnodebyaddr=${ac_cv_func_getipnodebyaddr=no} +ac_cv_func_getipnodebyname=${ac_cv_func_getipnodebyname=no} +ac_cv_func_getprotoent=${ac_cv_func_getprotoent=no} +ac_cv_func_getrusage=${ac_cv_func_getrusage=no} +ac_cv_func_gettimeofday=${ac_cv_func_gettimeofday=no} +ac_cv_func_gmtime_r=${ac_cv_func_gmtime_r=no} +ac_cv_func_ieee_handler=${ac_cv_func_ieee_handler=no} +ac_cv_func_if_freenameindex=${ac_cv_func_if_freenameindex=no} +ac_cv_func_if_indextoname=${ac_cv_func_if_indextoname=no} +ac_cv_func_if_nameindex=${ac_cv_func_if_nameindex=no} +ac_cv_func_if_nametoindex=${ac_cv_func_if_nametoindex=no} +ac_cv_func_isinf=${ac_cv_func_isinf=no} +ac_cv_func_isnan=${ac_cv_func_isnan=no} +ac_cv_func_localtime_r=${ac_cv_func_localtime_r=no} +ac_cv_func_log2=${ac_cv_func_log2=no} +ac_cv_func_madvise=${ac_cv_func_madvise=no} +ac_cv_func_mallopt=${ac_cv_func_mallopt=no} +ac_cv_func_memcpy=${ac_cv_func_memcpy=no} +ac_cv_func_memmove=${ac_cv_func_memmove=no} +ac_cv_func_mlockall=${ac_cv_func_mlockall=no} +ac_cv_func_mmap=${ac_cv_func_mmap=no} +ac_cv_func_mprotect=${ac_cv_func_mprotect=no} +ac_cv_func_mremap=${ac_cv_func_mremap=no} +ac_cv_func_nl_langinfo=${ac_cv_func_nl_langinfo=no} +ac_cv_func_openpty=${ac_cv_func_openpty=no} +ac_cv_func_poll=${ac_cv_func_poll=no} +ac_cv_func_posix2time=${ac_cv_func_posix2time=no} +ac_cv_func_posix_fadvise=${ac_cv_func_posix_fadvise=no} +ac_cv_func_posix_madvise=${ac_cv_func_posix_madvise=no} +ac_cv_func_posix_memalign=${ac_cv_func_posix_memalign=no} +ac_cv_func_ppoll=${ac_cv_func_ppoll=no} +ac_cv_func_pread=${ac_cv_func_pread=no} +ac_cv_func_pwrite=${ac_cv_func_pwrite=no} +ac_cv_func_res_gethostbyname=${ac_cv_func_res_gethostbyname=no} +ac_cv_func_sbrk=${ac_cv_func_sbrk=no} +ac_cv_func_setlocale=${ac_cv_func_setlocale=yes} +ac_cv_func_setns=${ac_cv_func_setns=no} +ac_cv_func_setprotoent=${ac_cv_func_setprotoent=no} +ac_cv_func_setsid=${ac_cv_func_setsid=no} +ac_cv_func_strerror=${ac_cv_func_strerror=yes} +ac_cv_func_strerror_r=${ac_cv_func_strerror_r=no} +ac_cv_func_strftime=${ac_cv_func_strftime=yes} +ac_cv_func_strlcat=${ac_cv_func_strlcat=no} +ac_cv_func_strlcpy=${ac_cv_func_strlcpy=no} +ac_cv_func_strncasecmp=${ac_cv_func_strncasecmp=no} +ac_cv_func_time2posix=${ac_cv_func_time2posix=no} +ac_cv_func_vprintf=${ac_cv_func_vprintf=no} +ac_cv_func_vsyslog=${ac_cv_func_vsyslog=no} +ac_cv_func_writev=${ac_cv_func_writev=no} +ac_cv_have_decl_IN6ADDR_ANY_INIT=${ac_cv_have_decl_IN6ADDR_ANY_INIT=no} +ac_cv_have_decl_IN6ADDR_LOOPBACK_INIT=${ac_cv_have_decl_IN6ADDR_LOOPBACK_INIT=no} +ac_cv_have_decl_IPV6_V6ONLY=${ac_cv_have_decl_IPV6_V6ONLY=no} +ac_cv_have_decl_posix2time=${ac_cv_have_decl_posix2time=no} +ac_cv_have_decl_time2posix=${ac_cv_have_decl_time2posix=no} +ac_cv_header_arpa_nameser_h=${ac_cv_header_arpa_nameser_h=no} +ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h=no} +ac_cv_header_dirent_ndir_h=${ac_cv_header_dirent_ndir_h=no} +ac_cv_header_dirent_sys_dir_h=${ac_cv_header_dirent_sys_dir_h=no} +ac_cv_header_dirent_sys_ndir_h=${ac_cv_header_dirent_sys_ndir_h=no} +ac_cv_header_dlfcn_h=${ac_cv_header_dlfcn_h=no} +ac_cv_header_elf_h=${ac_cv_header_elf_h=no} +ac_cv_header_fcntl_h=${ac_cv_header_fcntl_h=yes} +ac_cv_header_ieeefp_h=${ac_cv_header_ieeefp_h=no} +ac_cv_header_ifaddrs_h=${ac_cv_header_ifaddrs_h=no} +ac_cv_header_inttypes_h=${ac_cv_header_inttypes_h=yes} +ac_cv_header_langinfo_h=${ac_cv_header_langinfo_h=no} +ac_cv_header_libdlpi_h=${ac_cv_header_libdlpi_h=no} +ac_cv_header_libutil_h=${ac_cv_header_libutil_h=no} +ac_cv_header_limits_h=${ac_cv_header_limits_h=yes} +ac_cv_header_linux_errqueue_h=${ac_cv_header_linux_errqueue_h=no} +ac_cv_header_linux_falloc_h=${ac_cv_header_linux_falloc_h=no} +ac_cv_header_linux_types_h=${ac_cv_header_linux_types_h=no} +ac_cv_header_malloc_h=${ac_cv_header_malloc_h=yes} +ac_cv_header_net_errno_h=${ac_cv_header_net_errno_h=no} +ac_cv_header_net_if_dl_h=${ac_cv_header_net_if_dl_h=no} +ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no} +ac_cv_header_netpacket_packet_h=${ac_cv_header_netpacket_packet_h=no} +ac_cv_header_poll_h=${ac_cv_header_poll_h=no} +ac_cv_header_pty_h=${ac_cv_header_pty_h=no} +ac_cv_header_sched_h=${ac_cv_header_sched_h=no} +ac_cv_header_sdkddkver_h=${ac_cv_header_sdkddkver_h=yes} +ac_cv_header_setns_h=${ac_cv_header_setns_h=no} +ac_cv_header_stdint_h=${ac_cv_header_stdint_h=yes} +ac_cv_header_stdio_h=${ac_cv_header_stdio_h=yes} +ac_cv_header_stdlib_h=${ac_cv_header_stdlib_h=yes} +ac_cv_header_string_h=${ac_cv_header_string_h=yes} +ac_cv_header_strings_h=${ac_cv_header_strings_h=no} +ac_cv_header_sys_devpoll_h=${ac_cv_header_sys_devpoll_h=no} +ac_cv_header_sys_epoll_h=${ac_cv_header_sys_epoll_h=no} +ac_cv_header_sys_event_h=${ac_cv_header_sys_event_h=no} +ac_cv_header_sys_ioctl_h=${ac_cv_header_sys_ioctl_h=no} +ac_cv_header_sys_mman_h=${ac_cv_header_sys_mman_h=no} +ac_cv_header_sys_resource_h=${ac_cv_header_sys_resource_h=no} +ac_cv_header_sys_socket_h=${ac_cv_header_sys_socket_h=no} +ac_cv_header_sys_socketio_h=${ac_cv_header_sys_socketio_h=no} +ac_cv_header_sys_sockio_h=${ac_cv_header_sys_sockio_h=no} +ac_cv_header_sys_stat_h=${ac_cv_header_sys_stat_h=yes} +ac_cv_header_sys_stropts_h=${ac_cv_header_sys_stropts_h=no} +ac_cv_header_sys_sysctl_h=${ac_cv_header_sys_sysctl_h=no} +ac_cv_header_sys_time_h=${ac_cv_header_sys_time_h=no} +ac_cv_header_sys_timerfd_h=${ac_cv_header_sys_timerfd_h=no} +ac_cv_header_sys_types_h=${ac_cv_header_sys_types_h=yes} +ac_cv_header_sys_uio_h=${ac_cv_header_sys_uio_h=no} +ac_cv_header_sys_un_h=${ac_cv_header_sys_un_h=no} +ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h=no} +ac_cv_header_syslog_h=${ac_cv_header_syslog_h=no} +ac_cv_header_unistd_h=${ac_cv_header_unistd_h=no} +ac_cv_header_util_h=${ac_cv_header_util_h=no} +ac_cv_header_utmp_h=${ac_cv_header_utmp_h=no} +ac_cv_header_valgrind_valgrind_h=${ac_cv_header_valgrind_valgrind_h=no} +ac_cv_header_windows_h=${ac_cv_header_windows_h=yes} +ac_cv_header_winsock2_h=${ac_cv_header_winsock2_h=yes} +ac_cv_header_ws2tcpip_h=${ac_cv_header_ws2tcpip_h=yes} +ac_cv_host=${ac_cv_host=local-aarch64-pc-windows} +ac_cv_lib_dl_dlopen=${ac_cv_lib_dl_dlopen=no} +ac_cv_lib_dl_dlvsym=${ac_cv_lib_dl_dlvsym=no} +ac_cv_lib_dlpi_dlpi_open=${ac_cv_lib_dlpi_dlpi_open=no} +ac_cv_lib_inet_main=${ac_cv_lib_inet_main=no} +ac_cv_lib_kstat_kstat_open=${ac_cv_lib_kstat_kstat_open=no} +ac_cv_lib_kvm_kvm_open=${ac_cv_lib_kvm_kvm_open=no} +ac_cv_lib_m_sin=${ac_cv_lib_m_sin=no} +ac_cv_lib_rt_clock_gettime=${ac_cv_lib_rt_clock_gettime=no} +ac_cv_lib_socket_main=${ac_cv_lib_socket_main=yes} +ac_cv_lib_util_openpty=${ac_cv_lib_util_openpty=no} +ac_cv_member_struct_ifreq_ifr_enaddr=${ac_cv_member_struct_ifreq_ifr_enaddr=no} +ac_cv_member_struct_ifreq_ifr_hwaddr=${ac_cv_member_struct_ifreq_ifr_hwaddr=no} +ac_cv_member_struct_ifreq_ifr_ifindex=${ac_cv_member_struct_ifreq_ifr_ifindex=no} +ac_cv_member_struct_ifreq_ifr_index=${ac_cv_member_struct_ifreq_ifr_index=no} +ac_cv_member_struct_ifreq_ifr_map=${ac_cv_member_struct_ifreq_ifr_map=no} +ac_cv_member_struct_sockaddr_dl_sdl_len=${ac_cv_member_struct_sockaddr_dl_sdl_len=no} +ac_cv_member_struct_sockaddr_un_sun_path=${ac_cv_member_struct_sockaddr_un_sun_path=no} +ac_cv_objext=${ac_cv_objext=o} +# ac_cv_path_CP=${ac_cv_path_CP=/bin/cp} +# ac_cv_path_EGREP=${ac_cv_path_EGREP='/usr/bin/grep -E'} +# ac_cv_path_GREP=${ac_cv_path_GREP=/usr/bin/grep} +# ac_cv_path_MKDIR=${ac_cv_path_MKDIR=/bin/mkdir} +# ac_cv_path_PERL=${ac_cv_path_PERL=/usr/bin/perl} +# ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'} +ac_cv_prog_AR=${ac_cv_prog_AR=ar.sh} +ac_cv_prog_CC=${ac_cv_prog_CC=cc.sh} +ac_cv_prog_CPP=${ac_cv_prog_CPP='cc.sh -E'} +ac_cv_prog_GETCONF=${ac_cv_prog_GETCONF=getconf} +ac_cv_prog_JAVAC=${ac_cv_prog_JAVAC=javac.sh} +ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=true} +ac_cv_prog_cc_c11=${ac_cv_prog_cc_c11=no} +ac_cv_prog_cc_c89=${ac_cv_prog_cc_c89=no} +ac_cv_prog_cc_c99=${ac_cv_prog_cc_c99=no} +ac_cv_prog_cc_g=${ac_cv_prog_cc_g=yes} +ac_cv_prog_cxx_11=${ac_cv_prog_cxx_11=no} +ac_cv_prog_cxx_g=${ac_cv_prog_cxx_g=yes} +ac_cv_prog_cxx_stdcxx=${ac_cv_prog_cxx_stdcxx=} +# ac_cv_prog_emu_cc=${ac_cv_prog_emu_cc=$ERL_TOP/git/otp/erts/etc/win32/wsl_tools/vc/emu_cc.sh} +# ac_cv_prog_javac_ver_1_6=${ac_cv_prog_javac_ver_1_6=no} +# ac_cv_prog_mkdir_p=${ac_cv_prog_mkdir_p='/usr/bin/install -c -d'} +ac_cv_search_fdatasync=${ac_cv_search_fdatasync=no} +ac_cv_search_opendir=${ac_cv_search_opendir=no} +ac_cv_search_strerror=${ac_cv_search_strerror='none required'} +ac_cv_sizeof__Float16=${ac_cv_sizeof__Float16=0} +ac_cv_sizeof___int128_t=${ac_cv_sizeof___int128_t=0} +ac_cv_sizeof___int64=${ac_cv_sizeof___int64=8} +ac_cv_sizeof_char=${ac_cv_sizeof_char=1} +ac_cv_sizeof_int=${ac_cv_sizeof_int=4} +ac_cv_sizeof_long=${ac_cv_sizeof_long=4} +ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8} +ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=4} +ac_cv_sizeof_short=${ac_cv_sizeof_short=2} +ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=8} +ac_cv_sizeof_suseconds_t=${ac_cv_sizeof_suseconds_t=0} +ac_cv_sizeof_time_t=${ac_cv_sizeof_time_t=8} +ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8} +ac_cv_struct_sockaddr_sa_len=${ac_cv_struct_sockaddr_sa_len=no} +ac_cv_struct_tm=${ac_cv_struct_tm=time.h} +# ac_cv_sys_ipv6_support=${ac_cv_sys_ipv6_support=yes} +ac_cv_sys_multicast_support=${ac_cv_sys_multicast_support=no} +ac_cv_target=${ac_cv_target=local-aarch64-pc-windows} +ac_cv_type_off_t=${ac_cv_type_off_t=yes} +ac_cv_type_pid_t=${ac_cv_type_pid_t=no} +ac_cv_type_size_t=${ac_cv_type_size_t=yes} +erl_cv_clock_gettime_monotonic_default_resolution=${erl_cv_clock_gettime_monotonic_default_resolution=no} +erl_cv_clock_gettime_monotonic_high_resolution=${erl_cv_clock_gettime_monotonic_high_resolution=no} +erl_cv_clock_gettime_monotonic_raw=${erl_cv_clock_gettime_monotonic_raw=no} +erl_cv_clock_gettime_monotonic_try_find_pthread_compatible=${erl_cv_clock_gettime_monotonic_try_find_pthread_compatible=no} +erl_cv_clock_gettime_wall_default_resolution=${erl_cv_clock_gettime_wall_default_resolution=no} +erl_cv_mach_clock_get_time_monotonic=${erl_cv_mach_clock_get_time_monotonic=no} +erl_cv_mach_clock_get_time_wall=${erl_cv_mach_clock_get_time_wall=no} +erts_cv___after_morecore_hook_can_track_malloc=${erts_cv___after_morecore_hook_can_track_malloc=no} +erts_cv_fwrite_unlocked=${erts_cv_fwrite_unlocked=no} +erts_cv_have__end_symbol=${erts_cv_have__end_symbol=no} +erts_cv_have_end_symbol=${erts_cv_have_end_symbol=no} +erts_cv_have_in6addr_any=${erts_cv_have_in6addr_any=no} +erts_cv_have_in6addr_loopback=${erts_cv_have_in6addr_loopback=no} +erts_cv_putc_unlocked=${erts_cv_putc_unlocked=no} +erts_cv_windows_h_includes_winsock2_h=${erts_cv_windows_h_includes_winsock2_h=no} +ethr_cv_have__InterlockedAnd64=${ethr_cv_have__InterlockedAnd64=yes} +ethr_cv_have__InterlockedAnd=${ethr_cv_have__InterlockedAnd=yes} +ethr_cv_have__InterlockedCompareExchange128=${ethr_cv_have__InterlockedCompareExchange128=yes} +ethr_cv_have__InterlockedCompareExchange64=${ethr_cv_have__InterlockedCompareExchange64=yes} +# ethr_cv_have__InterlockedCompareExchange64_acq=${ethr_cv_have__InterlockedCompareExchange64_acq=no} +# ethr_cv_have__InterlockedCompareExchange64_rel=${ethr_cv_have__InterlockedCompareExchange64_rel=no} +ethr_cv_have__InterlockedCompareExchange=${ethr_cv_have__InterlockedCompareExchange=yes} +# ethr_cv_have__InterlockedCompareExchange_acq=${ethr_cv_have__InterlockedCompareExchange_acq=no} +# ethr_cv_have__InterlockedCompareExchange_rel=${ethr_cv_have__InterlockedCompareExchange_rel=no} +ethr_cv_have__InterlockedDecrement64=${ethr_cv_have__InterlockedDecrement64=yes} +# ethr_cv_have__InterlockedDecrement64_rel=${ethr_cv_have__InterlockedDecrement64_rel=no} +ethr_cv_have__InterlockedDecrement=${ethr_cv_have__InterlockedDecrement=yes} +# ethr_cv_have__InterlockedDecrement_rel=${ethr_cv_have__InterlockedDecrement_rel=no} +ethr_cv_have__InterlockedExchange64=${ethr_cv_have__InterlockedExchange64=yes} +ethr_cv_have__InterlockedExchange=${ethr_cv_have__InterlockedExchange=yes} +ethr_cv_have__InterlockedExchangeAdd64=${ethr_cv_have__InterlockedExchangeAdd64=yes} +# ethr_cv_have__InterlockedExchangeAdd64_acq=${ethr_cv_have__InterlockedExchangeAdd64_acq=no} +ethr_cv_have__InterlockedExchangeAdd=${ethr_cv_have__InterlockedExchangeAdd=yes} +# ethr_cv_have__InterlockedExchangeAdd_acq=${ethr_cv_have__InterlockedExchangeAdd_acq=no} +ethr_cv_have__InterlockedIncrement64=${ethr_cv_have__InterlockedIncrement64=yes} +# ethr_cv_have__InterlockedIncrement64_acq=${ethr_cv_have__InterlockedIncrement64_acq=no} +ethr_cv_have__InterlockedIncrement=${ethr_cv_have__InterlockedIncrement=yes} +# ethr_cv_have__InterlockedIncrement_acq=${ethr_cv_have__InterlockedIncrement_acq=no} +ethr_cv_have__InterlockedOr64=${ethr_cv_have__InterlockedOr64=yes} +ethr_cv_have__InterlockedOr=${ethr_cv_have__InterlockedOr=yes} +i_cv_fallocate_works=${i_cv_fallocate_works=no} +i_cv_posix_fallocate_works=${i_cv_posix_fallocate_works=no} From 53c2f2e30a01d24bbfd7398a60aef512141ddd6a Mon Sep 17 00:00:00 2001 From: Cocoa Date: Sat, 17 Feb 2024 23:59:38 +0800 Subject: [PATCH 04/28] added installation guide for aarch64 windows updated installation guide build with native-ethr-impls enable updated installation guide --- HOWTO/INSTALL-WIN32-ARM64.md | 479 +++++++++++++++++++++++++++++++++++ HOWTO/INSTALL.md | 1 + system/doc/docs.exs | 1 + 3 files changed, 481 insertions(+) create mode 100644 HOWTO/INSTALL-WIN32-ARM64.md diff --git a/HOWTO/INSTALL-WIN32-ARM64.md b/HOWTO/INSTALL-WIN32-ARM64.md new file mode 100644 index 000000000000..b68ca5069954 --- /dev/null +++ b/HOWTO/INSTALL-WIN32-ARM64.md @@ -0,0 +1,479 @@ +How to Build Erlang/OTP on ARM64 Windows +======================================== + +Introduction +------------ + +This section describes how to build the Erlang emulator and the OTP +libraries on Windows. Note that the Windows binary releases are still +a preferred alternative if one does not have Microsoft’s development +tools and/or don’t want to install WSL. + +The instructions apply to Windows 11 (v.21H2 and later) supporting the +WSL.2 (Windows Subsystem for Linux v.2) and using Ubuntu 20.04 release. + +The procedure described uses WSL as a build environment. You run the +bash shell in WSL and use the gnu configure/make etc to do +the build. The emulator C-source code is, however, mostly compiled +with Microsoft Visual C++™, producing a native Windows binary. This is +the same procedure as we use to build the pre-built binaries. Why we +use VC++ and not gcc is explained further in the FAQ section. + +These instructions apply for native 64-bit ARM Windows. Note that +even if you build a 64-bit version of Erlang, most of the directories +and files involved are still named win32. Some occurrences of the name +win64 are however present. The installation file for a 64-bit Windows +version of Erlang, for example, is `otp_win64_%OTP-REL%.exe`. + +If you feel comfortable with the environment and build +system, and have all the necessary tools, you have a great opportunity +to make the Erlang/OTP distribution for Windows better. Please submit +any suggestions or patches to our [git project] [1] to let +them find their way into the next version of Erlang. If making changes +to the build system (like makefiles etc) please bear in mind that the +same makefiles are used on Unix, so that your changes +don't break other platforms. That of course goes for C-code too; system +specific code resides in the `$ERL_TOP/erts/emulator/sys/win32` and +`$ERL_TOP/erts/etc/win32` directories mostly. The +`$ERL_TOP/erts/emulator/beam` directory is for common code. + + +Short Version +------------- + +In the following sections, we've described as much as we could about +the installation of the tools needed. Once the tools are installed, +building is quite easy. We have also tried to make these instructions +understandable for people with limited Unix experience. WSL is a whole +new environment to some Windows users, why careful explanation of +environment variables etc seemed to be in place. + +This is the short story though, for the experienced and impatient: + +* Get and install complete WSL environment + +* Install Visual Studio 2022 + +* Get and install windows JDK-16 (from + ) + +* Get and install windows NSIS 3.05 or later (3.05 tried and working) + +* Get precompiled static OpenSSL libraries from + and unpack + to: /mnt/c/OpenSSL-Win64/ + +* Get the Erlang source distribution (from + ) and unpack with `tar` + to the windows disk for example to: /mnt/c/src/ + +* Install llvm-mingw (from ), + automake and make. + +* `$ cd UNPACK_DIR` + +* Modify PATH and other environment variables so that all these tools + are runnable from a bash shell. Still standing in `$ERL_TOP`, issue + the following commands: + + $ eval `./otp_build env_win32 arm64` + $ ./otp_build configure + $ ./otp_build boot -a + $ ./otp_build release -a aarch64-windows-msvc + $ ./otp_build installer_win32 aarch64-windows-msvc + $ release/win32/otp_win32_%OTP-REL% /S + +Voila! `Start->Programs->Erlang OTP %OTP-REL%->Erlang` starts the Erlang +Windows shell. + + +Tools you Need and Their Environment +------------------------------------ + +You need some tools to be able to build Erlang/OTP on Windows. Most +notably you'll need WSL (with ubuntu), Visual Studio and +Microsofts Windows SDK, but you might also want a Java compiler, the +NSIS install system, OpenSSL and wxWidgets. Well, here's some information about +the different tools: + +* WSL: Install WSL and Ubuntu in Windows 10 + + + We have used and tested with WSL-1, WSL-2 was not available and may + not be preferred when building Erlang/OTP since access to the windows + disk is (currently) slower WSL-2. + +* Visual Studio 2022 with native ARM64 support + Download and run the installer from: + + Install C++ and SDK packages to the default installation directory. + +* Install llvm-mingw (from ), + automake and make: + + $ sudo apt update && sudo apt install automake make xz-utils pkg-config + + # download aarch64 version if you're compiling natively on an ARM64 Windows machine + $ curl -fSL https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-ubuntu-20.04-aarch64.tar.xz -o llvm-mingw-20231128-ucrt-ubuntu-20.04-aarch64.tar.xz + $ tar -xJf llvm-mingw-20231128-ucrt-ubuntu-20.04-aarch64.tar.xz + $ echo "export PATH=\"\$(pwd)/llvm-mingw-20231128-ucrt-ubuntu-20.04-aarch64/bin\":\$PATH" >> ~/.profile + + # download x86_64 version if you're cross-compiling on an x86_64 Windows machine + $ curl -fSL https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-ubuntu-20.04-x86_64.tar.xz -o llvm-mingw-20231128-ucrt-ubuntu-20.04-x86_64.tar.xz + $ tar -xJf llvm-mingw-20231128-ucrt-ubuntu-20.04-x86_64.tar.xz + $ echo "export PATH=\"\$(pwd)/llvm-mingw-20231128-ucrt-ubuntu-20.04-x86_64/bin\":\$PATH" >> ~/.profile + + $ source ~/.profile + +* Java JDK 8 or later (optional) + If you don't care about Java, you can skip this step. The + result will be that jinterface is not built. + + Our Java code (jinterface, ic) is tested on windows with JDK 8. + Get it for Windows and install it, the JRE is not enough. + + URL: + + // Download and install the JDK + // For example, to install the JDK 16.0.2 GA + $ curl -fSL https://github.com/microsoft/openjdk-aarch64/releases/download/jdk-16.0.2-ga/microsoft-jdk-16.0.2.7.1-windows-aarch64.msi -o microsoft-jdk-16.0.2.7.1-windows-aarch64.msi + $ powershell.exe -command "C:/Users/cocoa/microsoft-jdk-16.0.2.7.1-windows-aarch64.msi /quiet /passive" + + Add javac to your path environment, in my case this means: + + `PATH="/mnt/c/Program\ Files\ (Arm)/Microsoft/Java/jdk-16.0.2.7-hotspot/bin:$PATH` + + No `CLASSPATH` or anything is needed. Type `javac.exe` in the bash prompt + and you should get a list of available Java options. + +* Nullsoft NSIS installer system (optional) + You need this to build the self installing package. + + Download and run the installer from: + URL: + + Add 'makensis.exe' to your path environment, depending your set up + + `PATH="/mnt/c/Program\ Files/NSIS/Bin:$PATH`, or + + `PATH="/mnt/c/Program\ Files\ (x86)/NSIS/Bin:$PATH` + + Type `which makensis.exe` in the bash prompt and you should get the + path to the program. + +* OpenSSL (optional) + You need this to build crypto, ssh and ssl libs. + + We recommend v1.1.1d or later. + There are prebuilt available binaries, which you can just + download and unarchive, available here: + URL: + + Extract to `C:/OpenSSL-Win64`, then move and rename static libraries to + `C:/OpenSSL-Win64/lib/VC/static`: + + $ curl -fSL https://github.com/cocoa-xu/openssl-build/releases/download/v3.2.1/openssl-static-aarch64-windows-msvc.tar.gz -o openssl-static-aarch64-windows-msvc.tar.gz + $ mkdir -p /mnt/c/OpenSSL-Win64 + $ tar -xzf openssl-static-aarch64-windows-msvc.tar.gz -C /mnt/c/OpenSSL-Win64 + $ mkdir -p /mnt/c/OpenSSL-Win64/lib/VC/static + $ mv /mnt/c/OpenSSL-Win64/lib/libcrypto.lib /mnt/c/OpenSSL-Win64/lib/VC/static/libcrypto64MD.lib + $ mv /mnt/c/OpenSSL-Win64/lib/libssl.lib /mnt/c/OpenSSL-Win64/lib/VC/static/libssl64MD.lib + +* Get the Erlang source distribution (from ). + The same as for Unix platforms. Preferably use tar to + unpack the source tar.gz (`tar zxf otp_src_%OTP-REL%.tar.gz`) to somewhere + on the windows disk, `/mnt/c/path/to/otp_src` + + NOTE: It is important that source on the windows disk. + + Set the environment `ERL_TOP` to point to the root directory of the + source distribution. Let's say I stood in `/mnt/c/src` and unpacked + `otp_src_%OTP-REL%.tar.gz`, I then add the following to `.profile`: + + ERL_TOP=/mnt/c/src/otp_src_%OTP-REL% + export ERL_TOP + + + +The Shell Environment +--------------------- + +The path variable should now contain the windows paths to javac.exe and makensis.exe. + +Setup the environment with: + + $ export PATH + $ cd /mnt/c/path/to/otp_src/ + $ eval `./otp_build env_win32 arm64` + +This should setup the additional environment variables. + +This should do the final touch to the environment and building should +be easy after this. You could run `./otp_build env_win32` without +`eval` just to see what it does, and to see that the environment it +sets seems OK. The path is cleaned of spaces if possible (using DOS +style short names instead), the variables `OVERRIDE_TARGET`, `CC`, `CXX`, +`AR` and `RANLIB` are set to their respective wrappers and the directories +`$ERL_TOP/erts/etc/win32/wsl_tools/vc` and +`$ERL_TOP/erts/etc/win32/wsl_tools` are added first in the PATH. + +Now you can check which erlc you have by writing `type erlc` in your shell. +It should reside in `$ERL_TOP/erts/etc/win32/wsl_tools`. + +And running `cl.exe` should print the Microsoft compiler usage message. + +The needed compiler environment variables are setup inside `otp_build` +via `erts/etc/win32/wsl_tools/SetupWSLcross.bat`. It contains some +hardcoded paths, if your installation path is different it can be added +to that file. + + +Building and Installing +----------------------- + +Building is easiest using the `otp_build` script: + + $ ./otp_build configure + $ ./otp_build boot -a + $ ./otp_build release -a + $ ./otp_build installer_win32 # optional + +Now you will have a file called `otp_win64_%OTP-REL%.exe` in the ``, +i.e. `$ERL_TOP/release/aarch64-windows-msvc`. + +Lets get into more detail: + +1. `$ ./otp_build configure` - This runs the newly generated configure + scripts with options making configure behave nicely. The target machine + type is plainly `win32`, so a lot of the configure-scripts recognize + this awkward target name and behave accordingly. The CC variable also + makes the compiler be `cc.sh`, which wraps MSVC++, so all configure + tests regarding the C compiler gets to run the right compiler. A lot of + the tests are not needed on Windows, but we thought it best to run the + whole configure anyway. + + Some features are explictly disabled at the moment. + +2. `$ ./otp_build boot -a` - This uses the bootstrap directory (shipped + with the source, `$ERL_TOP/bootstrap`) to build a complete OTP + system. When this is done you can run erl from within the source tree; + just type `$ERL_TOP/bin/erl` and you should have the prompt. + +3. `$ ./otp_build release -a` - Builds a commercial release tree from the + source tree. The default is to put it in `$ERL_TOP/release/win32`. You can + give any directory as parameter, but it doesn't really + matter if you're going to build a self extracting installer too. + +4. `$ ./otp_build installer_win32` - Creates the self extracting installer executable. + The executable `otp_win32_%OTP-REL%.exe` or `otp_win64_%OTP-REL%.exe` will be placed + in the top directory of the release created in the previous step. If + no release directory is specified, the release is expected to have + been built to `$ERL_TOP/release/win32`, which also will be the place + where the installer executable will be placed. If you specified some + other directory for the release (i.e. `./otp_build release -a + /tmp/erl_release`), you're expected to give the same parameter here, + (i.e. `./otp_build installer_win32 /tmp/erl_release`). You need to have + a full NSIS installation and `makensis.exe` in your path for this to + work. Once you have created the installer, you can run it to + install Erlang/OTP in the regular way, just run the executable and + follow the steps in the installation wizard. To get all default settings + in the installation without any questions asked, you run the executable + with the parameter `/S` (capital S) like in: + + $ cd $ERL_TOP + $ release/win32/otp_win64_%OTP-REL% /S + ... + + + and after a while Erlang/OTP-%OTP-REL% will have been installed in + `C:\Program Files\erl%ERTS-VSN%\`, with shortcuts in the menu etc. + + +Development +----------- + +Once the system is built, you might want to change it. Having a test +release in some nice directory might be useful, but you can also run +Erlang from within the source tree. The target `local_setup`, makes +the program `$ERL_TOP/bin/erl.exe` usable and it also uses all the OTP +libraries in the source tree. + +If you hack the emulator, you can build the emulator executable +by standing in `$ERL_TOP/erts/emulator` and do a simple + + $ make opt + +Note that you need to have run ``(cd $ERL_TOP && eval `./otp_build env_win32 arm64`)`` +in the particular shell before building anything on Windows. After +doing a make opt you can test your result by running `$ERL_TOP/bin/erl`. +If you want to copy the result to a release directory (say +`/tmp/erl_release`), you do this (still in `$ERL_TOP/erts/emulator`) + + $ make TESTROOT=/tmp/erl_release release + +That will copy the emulator executables. + +To make a debug build of the emulator, you need to recompile both +`beam.dll` (the actual runtime system) and `erlexec.dll`. Do like this + + $ cd $ERL_TOP + $ rm bin/win32/erlexec.dll + $ cd erts/emulator + $ make debug + $ cd ../etc + $ make debug + +and sometimes + + $ cd $ERL_TOP + $ make local_setup + +So now when you run `$ERL_TOP/erl.exe`, you should have a debug compiled +emulator, which you will see if you do a: + + 1> erlang:system_info(system_version). + +in the erlang shell. If the returned string contains `[debug]`, you +got a debug compiled emulator. + +To hack the erlang libraries, you simply do a `make opt` in the +specific "applications" directory, like: + + $ cd $ERL_TOP/lib/stdlib + $ make opt + +or even in the source directory... + + $ cd $ERL_TOP/lib/stdlib/src + $ make opt + +Note that you're expected to have a fresh Erlang in your path when +doing this, preferably the plain %OTP-REL% you have built in the previous +steps. You could also add `$ERL_TOP/bootstrap/bin` to your `PATH` before +rebuilding specific libraries. That would give you a good enough +Erlang system to compile any OTP erlang code. Setting up the path +correctly is a little bit tricky. You still need to have +`$ERL_TOP/erts/etc/win32/wsl_tools/vc` and +`$ERL_TOP/erts/etc/win32/wsl_tools` *before* the actual emulator +in the path. A typical setting of the path for using the bootstrap +compiler would be: + + $ export PATH=$ERL_TOP/erts/etc/win32/wsl_tools/vc\ + :$ERL_TOP/erts/etc/win32/wsl_tools:$ERL_TOP/bootstrap/bin:$PATH + +That should make it possible to rebuild any library without hassle... + +If you want to copy a library (an application) newly built, to a +release area, you do like with the emulator: + + $ cd $ERL_TOP/lib/stdlib + $ make TESTROOT=/tmp/erlang_release release + +Remember that: + +* Windows specific C-code goes in the `$ERL_TOP/erts/emulator/sys/win32`, + `$ERL_TOP/erts/emulator/drivers/win32` or `$ERL_TOP/erts/etc/win32`. + +* Windows specific erlang code should be used conditionally and the + host OS tested in *runtime*, the exactly same beam files should be + distributed for every platform! So write code like: + + case os:type() of + {win32,_} -> + do_windows_specific(); + Other -> + do_fallback_or_exit() + end, + +That's basically all you need to get going. + + + +Frequently Asked Questions +-------------------------- + +* Q: So, now I can build Erlang using GCC on Windows? + + A: No, unfortunately not. You'll need Microsoft's Visual C++ + still. A Bourne-shell script (cc.sh) wraps the Visual C++ compiler + and runs it from within the WSL environment. All other tools + needed to build Erlang are free-ware/open source, but not the C + compiler. + +* Q: Why haven't you got rid of VC++ then, you \*\*\*\*\*\*? + + A: Well, partly because it's a good compiler - really! Actually it's + been possible in late R11-releases to build using mingw instead of + visual C++ (you might see the remnants of that in some scripts and + directories). Unfortunately the development of the SMP version for + Windows broke the mingw build and we chose to focus on the VC++ build + as the performance has been much better in the VC++ versions. The + mingw build will possibly be back, but as long as VC++ gives better + performance, the commercial build will be a VC++ one. + +* Q: Hah, I saw you, you used GCC even though you said you didn't! + + A: OK, I admit, one of the files is compiled using + MinGW's GCC and the resulting object code is then converted to MS + VC++ compatible coff using a small C hack. It's because that + particular file, `beam_emu.c` benefits immensely from being able + to use the GCC labels-as-values extension, which boosts emulator + performance by up to 50%. That does unfortunately not (yet) mean + that all of OTP could be compiled using GCC. That particular + source code does not do anything system specific and actually is + adopted to the fact that GCC is used to compile it on Windows. + +* Q: So now there's a MS VC++ project file somewhere and I can build OTP + using the nifty VC++ GUI? + + A: No, never. The hassle of keeping the project files up to date and + do all the steps that constitute an OTP build from within the VC++ GUI + is simply not worth it, maybe even impossible. A VC++ project + file for Erlang/OTP will never happen. + +* Q: So how does it all work then? + + A: WSL/Ubuntu is the environment, it's almost like you had a + virtual Unix machine inside Windows. Configure, given certain + parameters, then creates makefiles that are used by the + environment's gnu-make to built the system. Most of the actual + compilers etc are not, however, WSL tools, so we've written + a couple of wrappers (Bourne-shell scripts), which reside in + `$ERL_TOP/etc/win32/wsl_tools`. They all do conversion of + parameters and switches common in the Unix environment to fit the + native Windows tools. Most notable is of course the paths, which + in WSL are Unix-like paths with "forward slashes" (/) and + no drive letters. The WSL specific command `wslpath` is used + for most of the path conversions in a WSL environment. + Luckily most compilers accept forward slashes instead + of backslashes as path separators, but one still have to get the drive + letters etc right, though. The wrapper scripts are not general in + the sense that, for example, cc.sh would understand and translate + every possible gcc option and pass correct options to + cl.exe. The principle is that the scripts are powerful enough to + allow building of Erlang/OTP, no more, no less. They might need + extensions to cope with changes during the development of Erlang, and + that's one of the reasons we made them into shell-scripts and not + Perl-scripts. We believe they are easier to understand and change + that way. + + In `$ERL_TOP`, there is a script called `otp_build`. That script handles + the hassle of giving all the right parameters to `configure`/`make` and + also helps you set up the correct environment variables to work with + the Erlang source under WSL. + +* Q: Can I build something that looks exactly as the commercial release? + + A: Yes, we use the exact same build procedure. + +* Q: Which version of WSL and other tools do you use then? + + A: We use WSL 1 with Ubuntu 18.04. + The LLVM compiler we used for %OTP-REL% was version 20231128 with ucrt. + We used Visual studio 2022, Mircosoft's Implementation of OpenJDK 16.0.2 GA, + NSIS 3.09, Win32 OpenSSL 3.2.1 and wxWidgets-3.1.3. + + + [1]: https://github.com/erlang/otp + + [?TOC]: true \ No newline at end of file diff --git a/HOWTO/INSTALL.md b/HOWTO/INSTALL.md index 52265ff6f075..ac3b12cdebfc 100644 --- a/HOWTO/INSTALL.md +++ b/HOWTO/INSTALL.md @@ -790,6 +790,7 @@ Operating system [$ERL_TOP/HOWTO/INSTALL-CROSS.md]: INSTALL-CROSS.md [$ERL_TOP/HOWTO/INSTALL-WIN32.md]: INSTALL-WIN32.md +[$ERL_TOP/HOWTO/INSTALL-WIN32-ARM64.md]: INSTALL-WIN32-ARM64.md [DESTDIR]: http://www.gnu.org/prep/standards/html_node/DESTDIR.html [Building in Git]: #advanced-configuration-and-build-of-erlang-otp_Building_Within-Git [Advanced Configure]: #advanced-configuration-and-build-of-erlang-otp_Configuring diff --git a/system/doc/docs.exs b/system/doc/docs.exs index cf63eb0260ab..1093af089e27 100644 --- a/system/doc/docs.exs +++ b/system/doc/docs.exs @@ -6,6 +6,7 @@ "installation_guide/INSTALL.md": [source: "../../HOWTO/INSTALL.md"], "installation_guide/INSTALL-CROSS.md": [source: "../../HOWTO/INSTALL-CROSS.md"], "installation_guide/INSTALL-WIN32.md": [source: "../../HOWTO/INSTALL-WIN32.md"], + "installation_guide/INSTALL-WIN32-ARM64.md": [source: "../../HOWTO/INSTALL-WIN32-ARM64.md"], "installation_guide/OTP-PATCH-APPLY.md": [source: "../../HOWTO/INSTALL-PATCH-APPLY.md"], "system_principles/system_principles.md": [], "system_principles/error_logging.md": [], From af26c849b0273c5f29b1f430f5bedf1062130dbf Mon Sep 17 00:00:00 2001 From: Cocoa Date: Sun, 18 Feb 2024 06:35:16 +0800 Subject: [PATCH 05/28] arm64 jit now works on windows arm64 jit now works on windows --- erts/emulator/beam/jit/beam_jit_common.hpp | 4 ++-- erts/emulator/sys/win32/erl_win_sys.h | 3 +++ erts/etc/win32/wsl_tools/vc/cc.sh | 11 +++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/erts/emulator/beam/jit/beam_jit_common.hpp b/erts/emulator/beam/jit/beam_jit_common.hpp index d11c8768ca33..d178e5b9821d 100644 --- a/erts/emulator/beam/jit/beam_jit_common.hpp +++ b/erts/emulator/beam/jit/beam_jit_common.hpp @@ -195,14 +195,14 @@ struct BeamModuleAssemblerCommon { } /* Helpers */ - const auto &getTypeEntry(const ArgSource &arg) const { + const BeamArgType &getTypeEntry(const ArgSource &arg) const { auto typeIndex = arg.isRegister() ? arg.as().typeIndex() : 0; ASSERT(typeIndex < beam->types.count); return static_cast(beam->types.entries[typeIndex]); } - auto getTypeUnion(const ArgSource &arg) const { + BeamTypeId getTypeUnion(const ArgSource &arg) const { if (arg.isRegister()) { return getTypeEntry(arg).type(); } diff --git a/erts/emulator/sys/win32/erl_win_sys.h b/erts/emulator/sys/win32/erl_win_sys.h index a7b1f7ac9583..753e7c8bcdfe 100644 --- a/erts/emulator/sys/win32/erl_win_sys.h +++ b/erts/emulator/sys/win32/erl_win_sys.h @@ -192,6 +192,9 @@ struct erts_sys_time_read_only_data__ { ErtsMonotonicTime (*os_monotonic_time)(void); void (*os_times)(ErtsMonotonicTime *, ErtsSystemTime*); ErtsSysHrTime (*sys_hrtime)(void); + ErtsSysPerfCounter (*perf_counter)(void); + ErtsSysPerfCounter perf_counter_unit; + int ticks_per_sec; }; typedef struct { diff --git a/erts/etc/win32/wsl_tools/vc/cc.sh b/erts/etc/win32/wsl_tools/vc/cc.sh index b37167d7bcbc..6679e1955af2 100755 --- a/erts/etc/win32/wsl_tools/vc/cc.sh +++ b/erts/etc/win32/wsl_tools/vc/cc.sh @@ -26,15 +26,18 @@ SAVE="$@" +# Constants +COMMON_CFLAGS="-nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -D_CRT_SECURE_NO_DEPRECATE" + if [ "$CONFIG_SUBTYPE" = "x64_arm64" -o "$CONFIG_SUBTYPE" = "arm64" ]; then MACHINE="ARM64" + STDCXX_VERSION="/std:c++20" + COMMON_CFLAGS="${COMMON_CFLAGS} -D__aarch64__" else MACHINE="$CONFIG_SUBTYPE" + STDCXX_VERSION="/std:c++17" fi -# Constants -COMMON_CFLAGS="-nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -D_CRT_SECURE_NO_DEPRECATE" - # Variables # The stdout and stderr for the compiler MSG_FILE=/tmp/cl.exe.$$.1 @@ -195,7 +198,7 @@ while test -n "$1" ; do y=`echo $x | sed 's,^-l\(.*\),\1,g'`; LINKCMD="$LINKCMD $x";; -std=c++*) - CMD="$CMD /std:c++17 /Zc:__cplusplus";; + CMD="$CMD $STDCXX_VERSION /Zc:__cplusplus";; /*.c) SOURCES="$SOURCES $x";; *.c) From e820d26b7879ba5d8a77a42960c29f086c31590f Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 19 Feb 2024 05:25:50 +0800 Subject: [PATCH 06/28] fix cross-compile on x86_64 for aarch64 fix cross-compile on x86_64 for aarch64 --- erts/etc/win32/wsl_tools/SetupWSLcross.bat | 7 ++++++- erts/etc/win32/wsl_tools/vc/cc.sh | 1 - erts/etc/win32/wsl_tools/vc/emu_cc.sh | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/erts/etc/win32/wsl_tools/SetupWSLcross.bat b/erts/etc/win32/wsl_tools/SetupWSLcross.bat index 81e8c44f2ac6..ceef7103eb8e 100644 --- a/erts/etc/win32/wsl_tools/SetupWSLcross.bat +++ b/erts/etc/win32/wsl_tools/SetupWSLcross.bat @@ -70,7 +70,12 @@ GOTO no_vcvars :continue -FOR /F "delims==" %%F IN ('where cl.exe') DO SET _cl_exec_=%%F +FOR /F "delims==" %%F IN ('where cl.exe') DO ( + SET _cl_exec_=%%F + goto set_cl_path +) + +:set_cl_path FOR %%F IN ("%_cl_exec_%") DO SET CL_PATH=%%~dpF FOR /F "delims==" %%F IN ('where rc.exe') DO SET _rc_exec_=%%F diff --git a/erts/etc/win32/wsl_tools/vc/cc.sh b/erts/etc/win32/wsl_tools/vc/cc.sh index 6679e1955af2..02d22d0d56c5 100755 --- a/erts/etc/win32/wsl_tools/vc/cc.sh +++ b/erts/etc/win32/wsl_tools/vc/cc.sh @@ -34,7 +34,6 @@ if [ "$CONFIG_SUBTYPE" = "x64_arm64" -o "$CONFIG_SUBTYPE" = "arm64" ]; then STDCXX_VERSION="/std:c++20" COMMON_CFLAGS="${COMMON_CFLAGS} -D__aarch64__" else - MACHINE="$CONFIG_SUBTYPE" STDCXX_VERSION="/std:c++17" fi diff --git a/erts/etc/win32/wsl_tools/vc/emu_cc.sh b/erts/etc/win32/wsl_tools/vc/emu_cc.sh index 839c84ac1a06..19cc972505fa 100755 --- a/erts/etc/win32/wsl_tools/vc/emu_cc.sh +++ b/erts/etc/win32/wsl_tools/vc/emu_cc.sh @@ -23,8 +23,10 @@ if [ X"$CONFIG_SUBTYPE" = X"win64" ]; then GCC="x86_64-w64-mingw32-gcc -m64" -elif [ X"$CONFIG_SUBTYPE" = X"arm64" -o X"$CONFIG_SUBTYPE" = X"x86_arm64" ]; then +elif [ X"$CONFIG_SUBTYPE" = X"arm64" ]; then GCC="aarch64-w64-mingw32-gcc -m64" +elif [ X"$CONFIG_SUBTYPE" = X"x64_arm64" ]; then + GCC="aarch64-w64-mingw32-clang -m64" else GCC="x86_64-w64-mingw32-gcc -m32" fi From 52b7d7912e9e59ea7269613312bf696d3895f64d Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 19 Feb 2024 09:34:57 +0800 Subject: [PATCH 07/28] [WIP] updated find_redist --- erts/etc/win32/nsis/Makefile | 6 ++++++ erts/etc/win32/nsis/find_redist.sh | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/erts/etc/win32/nsis/Makefile b/erts/etc/win32/nsis/Makefile index dd4bbd4de670..e4155cdf774a 100644 --- a/erts/etc/win32/nsis/Makefile +++ b/erts/etc/win32/nsis/Makefile @@ -54,6 +54,12 @@ WTARGET_DIR=$(shell (w32_path.sh -d "$(TARGET_DIR)")) ifeq ($(CONFIG_SUBTYPE),win64) WINTYPE=win64 REDIST_TARGET=vcredist_x64.exe +else ifeq ($(CONFIG_SUBTYPE),arm64) + WINTYPE=arm64 + REDIST_TARGET=vcredist_arm64.exe +else ifeq ($(CONFIG_SUBTYPE),x64_arm64) + WINTYPE=arm64 + REDIST_TARGET=vcredist_arm64.exe else WINTYPE=win32 REDIST_TARGET=vcredist_x86.exe diff --git a/erts/etc/win32/nsis/find_redist.sh b/erts/etc/win32/nsis/find_redist.sh index f551bc752749..4407cbca47f4 100755 --- a/erts/etc/win32/nsis/find_redist.sh +++ b/erts/etc/win32/nsis/find_redist.sh @@ -84,14 +84,21 @@ add_path_element() # Look to see if it's 64bit if [ "$1" = "win64" ]; then AMD64DIR=true + ARM64DIR=false VCREDIST=vcredist_x64 COMPONENTS="cl amd64 bin vc" elif [ "$1" = "win32" ]; then AMD64DIR=false + ARM64DIR=false VCREDIST=vcredist_x86 COMPONENTS="cl bin vc" +elif [ "$1" = "arm64" ]; then + AMD64DIR=false + ARM64DIR=true + VCREDIST=vcredist_arm64 + COMPONENTS="cl bin vc" else - echo "TARGET argument should win32 or win64" + echo "TARGET argument should win32, win64 or arm64" exit 2 fi @@ -105,7 +112,7 @@ fi CLPATH=`lookup_prog_in_path cl` if [ -z "$CLPATH" ]; then - echo "Can not locate cl.exe and vcredist_x86/x64.exe - OK if using mingw" >&2 + echo "Can not locate cl.exe and vcredist_x86/x64/arm64.exe - OK if using mingw" >&2 exit 1 fi @@ -130,6 +137,8 @@ if [ '!' -z "$RCPATH" ]; then allow_fail=false if [ $AMD64DIR = true ]; then COMPONENTS="rc x64 bin @ANY v6.0A v7.0A v7.1" + elif [ $ARM64DIR = true ]; then + COMPONENTS="rc arm64 bin @ANY v6.0A v7.0A v7.1" else COMPONENTS="rc bin @ANY v6.0A v7.0A v7.1" fi From 4d00bfc5b64906b55f486915d8f65a17af4b6b96 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 19 Feb 2024 17:30:49 +0800 Subject: [PATCH 08/28] fix i_perf_counter on aarch64 windows --- erts/emulator/beam/jit/arm/instr_common.cpp | 5 +++++ erts/emulator/sys/win32/erl_win_sys.h | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/erts/emulator/beam/jit/arm/instr_common.cpp b/erts/emulator/beam/jit/arm/instr_common.cpp index 70c98fc6e348..783c3f4fed66 100644 --- a/erts/emulator/beam/jit/arm/instr_common.cpp +++ b/erts/emulator/beam/jit/arm/instr_common.cpp @@ -3082,7 +3082,12 @@ void BeamModuleAssembler::emit_i_perf_counter() { Label next = a.newLabel(), small = a.newLabel(); emit_enter_runtime_frame(); +#ifdef WIN32 + /* Call the function pointer used by erts_sys_perf_counter */ + runtime_call<0>(erts_sys_time_data__.r.o.sys_hrtime); +#else runtime_call<0>(erts_sys_time_data__.r.o.perf_counter); +#endif emit_leave_runtime_frame(); a.asr(TMP1, ARG1, imm(SMALL_BITS - 1)); diff --git a/erts/emulator/sys/win32/erl_win_sys.h b/erts/emulator/sys/win32/erl_win_sys.h index 753e7c8bcdfe..a7b1f7ac9583 100644 --- a/erts/emulator/sys/win32/erl_win_sys.h +++ b/erts/emulator/sys/win32/erl_win_sys.h @@ -192,9 +192,6 @@ struct erts_sys_time_read_only_data__ { ErtsMonotonicTime (*os_monotonic_time)(void); void (*os_times)(ErtsMonotonicTime *, ErtsSystemTime*); ErtsSysHrTime (*sys_hrtime)(void); - ErtsSysPerfCounter (*perf_counter)(void); - ErtsSysPerfCounter perf_counter_unit; - int ticks_per_sec; }; typedef struct { From 51be569734c074f2d35c0a16bfe495e0c57638ef Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 19 Feb 2024 17:33:47 +0800 Subject: [PATCH 09/28] fix typo in wsl_tools reg_query.sh --- erts/etc/win32/wsl_tools/reg_query.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/etc/win32/wsl_tools/reg_query.sh b/erts/etc/win32/wsl_tools/reg_query.sh index 0c7e401b2ce3..1cb5e711e71c 100755 --- a/erts/etc/win32/wsl_tools/reg_query.sh +++ b/erts/etc/win32/wsl_tools/reg_query.sh @@ -10,7 +10,7 @@ BACKED=`echo "$1" | sed 's,/,\\\\,g'` if [ $CONFIG_SUBTYPE = "win64" ]; then REG_OPT=" /reg:64" -elif [ X"$CONFIG_SUBTYPE" = X"arm64" -o X"$CONFIG_SUBTYPE" = X"x86_arm64" ]; then +elif [ X"$CONFIG_SUBTYPE" = X"arm64" -o X"$CONFIG_SUBTYPE" = X"x64_arm64" ]; then REG_OPT=" /reg:64" else REG_OPT=" /reg:32" From 945c8a1ba2b69aeb6ab1dddbae20f8e1cacf9bf8 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 19 Feb 2024 20:49:25 +0800 Subject: [PATCH 10/28] Update configure scripts Update configure scripts --- erts/configure | 71 +++++++++++++++++++++++++++++-------- lib/common_test/configure | 63 ++++++++++++++++++++++++++------ lib/crypto/configure | 63 ++++++++++++++++++++++++++------ lib/erl_interface/configure | 63 ++++++++++++++++++++++++++------ lib/megaco/configure | 63 ++++++++++++++++++++++++++------ lib/odbc/configure | 63 ++++++++++++++++++++++++++------ lib/snmp/configure | 63 ++++++++++++++++++++++++++------ lib/wx/configure | 71 +++++++++++++++++++++++++++++-------- make/autoconf/otp.m4 | 63 ++++++++++++++++++++++++++------ make/configure | 71 +++++++++++++++++++++++++++++-------- 10 files changed, 542 insertions(+), 112 deletions(-) diff --git a/erts/configure b/erts/configure index 01568bce8de0..04aefc17a44d 100755 --- a/erts/configure +++ b/erts/configure @@ -3794,12 +3794,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -3808,12 +3822,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -3822,29 +3850,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. @@ -6402,11 +6445,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} +if test ${ac_cv_prog_cxx_11+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_cxx11=no + ac_cv_prog_cxx_11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6448,11 +6491,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} +if test ${ac_cv_prog_cxx_98+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_cxx98=no + ac_cv_prog_cxx_98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/lib/common_test/configure b/lib/common_test/configure index 567e5a5f2439..60ef274eb51b 100755 --- a/lib/common_test/configure +++ b/lib/common_test/configure @@ -2044,12 +2044,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -2058,12 +2072,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -2072,29 +2100,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. diff --git a/lib/crypto/configure b/lib/crypto/configure index 14e09d20fb09..692efa0ee7c9 100755 --- a/lib/crypto/configure +++ b/lib/crypto/configure @@ -3135,12 +3135,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -3149,12 +3163,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -3163,29 +3191,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. diff --git a/lib/erl_interface/configure b/lib/erl_interface/configure index 72c01560cf4c..56b954e87723 100755 --- a/lib/erl_interface/configure +++ b/lib/erl_interface/configure @@ -3005,12 +3005,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -3019,12 +3033,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -3033,29 +3061,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. diff --git a/lib/megaco/configure b/lib/megaco/configure index a74de6797790..2cef5e4976a2 100755 --- a/lib/megaco/configure +++ b/lib/megaco/configure @@ -2879,12 +2879,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -2893,12 +2907,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -2907,29 +2935,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. diff --git a/lib/odbc/configure b/lib/odbc/configure index 12df3656c65e..1bf6e6ef0599 100755 --- a/lib/odbc/configure +++ b/lib/odbc/configure @@ -2970,12 +2970,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -2984,12 +2998,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -2998,29 +3026,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. diff --git a/lib/snmp/configure b/lib/snmp/configure index a907ba26b2ad..3c9d3053d892 100755 --- a/lib/snmp/configure +++ b/lib/snmp/configure @@ -2040,12 +2040,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -2054,12 +2068,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -2068,29 +2096,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. diff --git a/lib/wx/configure b/lib/wx/configure index d44a8515fced..91dc2e607868 100755 --- a/lib/wx/configure +++ b/lib/wx/configure @@ -3203,12 +3203,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -3217,12 +3231,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -3231,29 +3259,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. @@ -4554,11 +4597,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} +if test ${ac_cv_prog_cxx_11+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_cxx11=no + ac_cv_prog_cxx_11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4600,11 +4643,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} +if test ${ac_cv_prog_cxx_98+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_cxx98=no + ac_cv_prog_cxx_98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/make/autoconf/otp.m4 b/make/autoconf/otp.m4 index 984ee1ad0b20..71d78cac5896 100644 --- a/make/autoconf/otp.m4 +++ b/make/autoconf/otp.m4 @@ -35,47 +35,90 @@ AC_DEFUN([ERL_CANONICAL_SYSTEM_TYPE], AC_CANONICAL_HOST # Adjust for local legacy windows hack... AS_CASE([$host], - [local-*-windows], + [local-aarch64-*-windows], [ host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ], + [local-x86_64-*-windows], + [ + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ], + [local-i686-*-windows], + [ + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ]) AC_CANONICAL_BUILD # Adjust for local legacy windows hack... AS_CASE([$build], - [local-*-windows], + [local-aarch64-*-windows], + [ + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ], + [local-x86_64-*-windows], [ build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ], + [local-i686-*-windows], + [ + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ]) AC_CANONICAL_TARGET # Adjust for local legacy windows hack... AS_CASE([$target], - [local-*-windows], + [local-aarch64-*-windows], + [ + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ], + [local-x86_64-*-windows], + [ + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ], + [local-i686-*-windows], [ target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ]) - AS_IF([test "$cross_compiling" = "yes" -a "$build" = "$host"], + AS_IF([test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu"], [AC_MSG_ERROR([ - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. diff --git a/make/configure b/make/configure index 3dd553d78aad..40d3ab69f9c9 100755 --- a/make/configure +++ b/make/configure @@ -3451,12 +3451,26 @@ test -n "$target_alias" && # Adjust for local legacy windows hack... case $host in #( - local-*-windows) : + local-aarch64-*-windows) : host=win32 host_os=win32 host_vendor= - host_cpu= + host_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu=i686 ;; #( *) : ;; @@ -3465,12 +3479,26 @@ esac # Adjust for local legacy windows hack... case $build in #( - local-*-windows) : + local-aarch64-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : build=win32 build_os=win32 build_vendor= - build_cpu= + build_cpu=x86_64 + ;; #( + local-i686-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu=i686 ;; #( *) : ;; @@ -3479,29 +3507,44 @@ esac # Adjust for local legacy windows hack... case $target in #( - local-*-windows) : + local-aarch64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=aarch64 + ;; #( + local-x86_64-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu=x86_64 + ;; #( + local-i686-*-windows) : target=win32 target_os=win32 target_vendor= - target_cpu= + target_cpu=i686 ;; #( *) : ;; esac - if test "$cross_compiling" = "yes" -a "$build" = "$host" + if test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu" then : as_fn_error $? " - Cross compiling with the same canonicalized 'host' value - as the canonicalized 'build' value. + Cross compiling with the same canonicalized 'host' and 'host_cpu' + values as the canonicalized 'build' and 'build_cpu' values We are cross compiling since the '--host=$host_alias' and the '--build=$build_alias' arguments differ. When cross compiling Erlang/OTP, also the canonicalized values of the '--build' and the '--host' arguments *must* differ. The canonicalized values of these arguments however both equals: - $host + host = build = $host, + host_cpu = build_cpu = $host_cpu You can check the canonical value by passing a value as argument to the 'make/autoconf/config.sub' script. @@ -4815,11 +4858,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx11+y} +if test ${ac_cv_prog_cxx_11+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_cxx11=no + ac_cv_prog_cxx_11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4861,11 +4904,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_cxx98+y} +if test ${ac_cv_prog_cxx_98+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_cxx98=no + ac_cv_prog_cxx_98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ From b5f6d21bd6f3a70095d5e7743c3719dc7ba8d47a Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 19 Feb 2024 22:34:22 +0800 Subject: [PATCH 11/28] set linker opt `/MACHINE` for all `$CONFIG_SUBTYPE` --- erts/etc/win32/wsl_tools/vc/cc.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erts/etc/win32/wsl_tools/vc/cc.sh b/erts/etc/win32/wsl_tools/vc/cc.sh index 02d22d0d56c5..313b2f5861c9 100755 --- a/erts/etc/win32/wsl_tools/vc/cc.sh +++ b/erts/etc/win32/wsl_tools/vc/cc.sh @@ -30,11 +30,12 @@ SAVE="$@" COMMON_CFLAGS="-nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -D_CRT_SECURE_NO_DEPRECATE" if [ "$CONFIG_SUBTYPE" = "x64_arm64" -o "$CONFIG_SUBTYPE" = "arm64" ]; then - MACHINE="ARM64" - STDCXX_VERSION="/std:c++20" - COMMON_CFLAGS="${COMMON_CFLAGS} -D__aarch64__" + MACHINE="ARM64" + COMMON_CFLAGS="${COMMON_CFLAGS} -D__aarch64__" +elif [ "$CONFIG_SUBTYPE" = "win64" ]; then + MACHINE="x64" else - STDCXX_VERSION="/std:c++17" + MACHINE="x86" fi # Variables From 021c2d1af4bad1dd8252351cca955774d712f20d Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 19 Feb 2024 22:51:24 +0800 Subject: [PATCH 12/28] updated emu_cc.sh --- erts/etc/win32/wsl_tools/vc/emu_cc.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/erts/etc/win32/wsl_tools/vc/emu_cc.sh b/erts/etc/win32/wsl_tools/vc/emu_cc.sh index 19cc972505fa..485c75aa3b80 100755 --- a/erts/etc/win32/wsl_tools/vc/emu_cc.sh +++ b/erts/etc/win32/wsl_tools/vc/emu_cc.sh @@ -23,10 +23,8 @@ if [ X"$CONFIG_SUBTYPE" = X"win64" ]; then GCC="x86_64-w64-mingw32-gcc -m64" -elif [ X"$CONFIG_SUBTYPE" = X"arm64" ]; then +elif [ X"$CONFIG_SUBTYPE" = X"arm64" || X"$CONFIG_SUBTYPE" = X"x64_arm64" ]; then GCC="aarch64-w64-mingw32-gcc -m64" -elif [ X"$CONFIG_SUBTYPE" = X"x64_arm64" ]; then - GCC="aarch64-w64-mingw32-clang -m64" else GCC="x86_64-w64-mingw32-gcc -m32" fi From d97c4bcd887a66d1209f8a5552310cb9ce57de1c Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 00:32:01 +0800 Subject: [PATCH 13/28] clang-format --- erts/emulator/beam/jit/arm/beam_asm_module.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/erts/emulator/beam/jit/arm/beam_asm_module.cpp b/erts/emulator/beam/jit/arm/beam_asm_module.cpp index 207c676ce2ad..8a2f98e1ed33 100644 --- a/erts/emulator/beam/jit/arm/beam_asm_module.cpp +++ b/erts/emulator/beam/jit/arm/beam_asm_module.cpp @@ -540,10 +540,7 @@ const Label &BeamModuleAssembler::resolve_label(const Label &target, anchor = a.newNamedLabel(name.str().c_str()); } - auto it = _veneers.emplace(target.id(), - Veneer{.latestOffset = maxOffset, - .anchor = anchor, - .target = target}); + auto it = _veneers.emplace(target.id(), Veneer{maxOffset, anchor, target}); const Veneer &veneer = it->second; _pending_veneers.emplace(veneer); @@ -589,10 +586,8 @@ arm::Mem BeamModuleAssembler::embed_constant(const ArgVal &value, } } - auto it = _constants.emplace(value, - Constant{.latestOffset = maxOffset, - .anchor = a.newLabel(), - .value = value}); + auto it = + _constants.emplace(value, Constant{maxOffset, a.newLabel(), value}); const Constant &constant = it->second; _pending_constants.emplace(constant); @@ -607,10 +602,9 @@ arm::Mem BeamModuleAssembler::embed_label(const Label &label, ASSERT(disp >= dispMin && disp <= dispMax); - auto it = _embedded_labels.emplace(label.id(), - EmbeddedLabel{.latestOffset = maxOffset, - .anchor = a.newLabel(), - .label = label}); + auto it = _embedded_labels.emplace( + label.id(), + EmbeddedLabel{maxOffset, a.newLabel(), label}); ASSERT(it.second); const EmbeddedLabel &embedded_label = it.first->second; _pending_labels.emplace(embedded_label); From ede4e584d98b2c402287953311657ebd0fe2c03d Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 00:36:30 +0800 Subject: [PATCH 14/28] updated otp_build --- otp_build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/otp_build b/otp_build index c73140e20abc..cfb22c46ef6b 100755 --- a/otp_build +++ b/otp_build @@ -1249,7 +1249,7 @@ case "$1" in do_configure "$@";; opt) do_boot;; - plain|smp) + smp) if [ $minus_x_flag = false ]; then TYPE=opt fi; From 0f5b5b96896b1edab76562e5e2d9d37cc06f0ecb Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 00:58:00 +0800 Subject: [PATCH 15/28] use simple list initializers instead of designated initializers --- erts/emulator/beam/jit/arm/beam_asm_global.cpp | 7 ++++--- erts/etc/win32/wsl_tools/vc/cc.sh | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/erts/emulator/beam/jit/arm/beam_asm_global.cpp b/erts/emulator/beam/jit/arm/beam_asm_global.cpp index 5fdd8bbea62a..8b2b1d8ebdb8 100644 --- a/erts/emulator/beam/jit/arm/beam_asm_global.cpp +++ b/erts/emulator/beam/jit/arm/beam_asm_global.cpp @@ -74,9 +74,10 @@ BeamGlobalAssembler::BeamGlobalAssembler(JitAllocator *allocator) stop = (ErtsCodePtr)((char *)getBaseAddress() + code.codeSize()); } - ranges.push_back({.start = start, - .stop = stop, - .name = code.labelEntry(labels[val.first])->name()}); + ranges.push_back(AsmRange{start, + stop, + code.labelEntry(labels[val.first])->name(), + {}}); } (void)beamasm_metadata_insert("global", diff --git a/erts/etc/win32/wsl_tools/vc/cc.sh b/erts/etc/win32/wsl_tools/vc/cc.sh index 313b2f5861c9..322d46008088 100755 --- a/erts/etc/win32/wsl_tools/vc/cc.sh +++ b/erts/etc/win32/wsl_tools/vc/cc.sh @@ -198,7 +198,7 @@ while test -n "$1" ; do y=`echo $x | sed 's,^-l\(.*\),\1,g'`; LINKCMD="$LINKCMD $x";; -std=c++*) - CMD="$CMD $STDCXX_VERSION /Zc:__cplusplus";; + CMD="$CMD /std:c++17 /Zc:__cplusplus";; /*.c) SOURCES="$SOURCES $x";; *.c) From 6bf0b6ea599c30b2edb656bf49ccd25b1754c812 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 01:10:16 +0800 Subject: [PATCH 16/28] added back base case local-*-windows --- erts/configure | 21 +++++++++++++++++++++ lib/common_test/configure | 21 +++++++++++++++++++++ lib/crypto/configure | 21 +++++++++++++++++++++ lib/erl_interface/configure | 21 +++++++++++++++++++++ lib/megaco/configure | 21 +++++++++++++++++++++ lib/odbc/configure | 21 +++++++++++++++++++++ lib/snmp/configure | 21 +++++++++++++++++++++ lib/wx/configure | 21 +++++++++++++++++++++ make/autoconf/otp.m4 | 21 +++++++++++++++++++++ make/configure | 21 +++++++++++++++++++++ 10 files changed, 210 insertions(+) diff --git a/erts/configure b/erts/configure index 04aefc17a44d..2008431ee708 100755 --- a/erts/configure +++ b/erts/configure @@ -3815,6 +3815,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -3843,6 +3850,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -3871,6 +3885,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac diff --git a/lib/common_test/configure b/lib/common_test/configure index 60ef274eb51b..472856eb7bcf 100755 --- a/lib/common_test/configure +++ b/lib/common_test/configure @@ -2065,6 +2065,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -2093,6 +2100,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -2121,6 +2135,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac diff --git a/lib/crypto/configure b/lib/crypto/configure index 692efa0ee7c9..4d9eb8eea045 100755 --- a/lib/crypto/configure +++ b/lib/crypto/configure @@ -3156,6 +3156,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -3184,6 +3191,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -3212,6 +3226,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac diff --git a/lib/erl_interface/configure b/lib/erl_interface/configure index 56b954e87723..d884a6b21366 100755 --- a/lib/erl_interface/configure +++ b/lib/erl_interface/configure @@ -3026,6 +3026,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -3054,6 +3061,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -3082,6 +3096,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac diff --git a/lib/megaco/configure b/lib/megaco/configure index 2cef5e4976a2..6fb89c2b12ea 100755 --- a/lib/megaco/configure +++ b/lib/megaco/configure @@ -2900,6 +2900,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -2928,6 +2935,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -2956,6 +2970,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac diff --git a/lib/odbc/configure b/lib/odbc/configure index 1bf6e6ef0599..01b82f6e8b49 100755 --- a/lib/odbc/configure +++ b/lib/odbc/configure @@ -2991,6 +2991,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -3019,6 +3026,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -3047,6 +3061,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac diff --git a/lib/snmp/configure b/lib/snmp/configure index 3c9d3053d892..a0ea628200bc 100755 --- a/lib/snmp/configure +++ b/lib/snmp/configure @@ -2061,6 +2061,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -2089,6 +2096,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -2117,6 +2131,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac diff --git a/lib/wx/configure b/lib/wx/configure index 91dc2e607868..a63875a8b32f 100755 --- a/lib/wx/configure +++ b/lib/wx/configure @@ -3224,6 +3224,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -3252,6 +3259,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -3280,6 +3294,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac diff --git a/make/autoconf/otp.m4 b/make/autoconf/otp.m4 index 71d78cac5896..4e5e3b6f017a 100644 --- a/make/autoconf/otp.m4 +++ b/make/autoconf/otp.m4 @@ -55,6 +55,13 @@ AC_DEFUN([ERL_CANONICAL_SYSTEM_TYPE], host_os=win32 host_vendor= host_cpu=i686 + ], + [local-*-windows], + [ + host=win32 + host_os=win32 + host_vendor= + host_cpu= ]) AC_CANONICAL_BUILD @@ -80,6 +87,13 @@ AC_DEFUN([ERL_CANONICAL_SYSTEM_TYPE], build_os=win32 build_vendor= build_cpu=i686 + ], + [local-*-windows], + [ + build=win32 + build_os=win32 + build_vendor= + build_cpu= ]) AC_CANONICAL_TARGET @@ -105,6 +119,13 @@ AC_DEFUN([ERL_CANONICAL_SYSTEM_TYPE], target_os=win32 target_vendor= target_cpu=i686 + ], + [local-*-windows], + [ + target=win32 + target_os=win32 + target_vendor= + target_cpu= ]) AS_IF([test "$cross_compiling" = "yes" -a "$build" = "$host" -a "$build_cpu" = "$host_cpu"], diff --git a/make/configure b/make/configure index 40d3ab69f9c9..89c600249074 100755 --- a/make/configure +++ b/make/configure @@ -3472,6 +3472,13 @@ test -n "$target_alias" && host_vendor= host_cpu=i686 ;; #( + local-*-windows) : + + host=win32 + host_os=win32 + host_vendor= + host_cpu= + ;; #( *) : ;; esac @@ -3500,6 +3507,13 @@ esac build_vendor= build_cpu=i686 ;; #( + local-*-windows) : + + build=win32 + build_os=win32 + build_vendor= + build_cpu= + ;; #( *) : ;; esac @@ -3528,6 +3542,13 @@ esac target_vendor= target_cpu=i686 ;; #( + local-*-windows) : + + target=win32 + target_os=win32 + target_vendor= + target_cpu= + ;; #( *) : ;; esac From 30f9c3502cd8c42edfee125cac3ae38af7fc5216 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 01:10:41 +0800 Subject: [PATCH 17/28] format --- erts/etc/win32/nsis/find_redist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/etc/win32/nsis/find_redist.sh b/erts/etc/win32/nsis/find_redist.sh index 4407cbca47f4..8edc5cedc71e 100755 --- a/erts/etc/win32/nsis/find_redist.sh +++ b/erts/etc/win32/nsis/find_redist.sh @@ -138,7 +138,7 @@ if [ '!' -z "$RCPATH" ]; then if [ $AMD64DIR = true ]; then COMPONENTS="rc x64 bin @ANY v6.0A v7.0A v7.1" elif [ $ARM64DIR = true ]; then - COMPONENTS="rc arm64 bin @ANY v6.0A v7.0A v7.1" + COMPONENTS="rc arm64 bin @ANY v6.0A v7.0A v7.1" else COMPONENTS="rc bin @ANY v6.0A v7.0A v7.1" fi From 5726b547220356c4053fbbc089df18e6a3189e65 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 01:33:22 +0800 Subject: [PATCH 18/28] only set VEREDIST var for arm64 --- erts/etc/win32/nsis/find_redist.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/erts/etc/win32/nsis/find_redist.sh b/erts/etc/win32/nsis/find_redist.sh index 8edc5cedc71e..50723a23476a 100755 --- a/erts/etc/win32/nsis/find_redist.sh +++ b/erts/etc/win32/nsis/find_redist.sh @@ -84,19 +84,14 @@ add_path_element() # Look to see if it's 64bit if [ "$1" = "win64" ]; then AMD64DIR=true - ARM64DIR=false VCREDIST=vcredist_x64 COMPONENTS="cl amd64 bin vc" elif [ "$1" = "win32" ]; then AMD64DIR=false - ARM64DIR=false VCREDIST=vcredist_x86 COMPONENTS="cl bin vc" elif [ "$1" = "arm64" ]; then - AMD64DIR=false - ARM64DIR=true VCREDIST=vcredist_arm64 - COMPONENTS="cl bin vc" else echo "TARGET argument should win32, win64 or arm64" exit 2 @@ -137,8 +132,6 @@ if [ '!' -z "$RCPATH" ]; then allow_fail=false if [ $AMD64DIR = true ]; then COMPONENTS="rc x64 bin @ANY v6.0A v7.0A v7.1" - elif [ $ARM64DIR = true ]; then - COMPONENTS="rc arm64 bin @ANY v6.0A v7.0A v7.1" else COMPONENTS="rc bin @ANY v6.0A v7.0A v7.1" fi From a7ac04d1e484da99efe8eabf81d722e2f9d44135 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 04:54:13 +0800 Subject: [PATCH 19/28] updated installation guide for using wxWidgets --- HOWTO/INSTALL-WIN32-ARM64.md | 42 ++++++++++++++++++++++++++++++++++++ lib/wx/configure | 42 +++++++++++++++++++++++------------- lib/wx/configure.ac | 42 +++++++++++++++++++++++------------- 3 files changed, 96 insertions(+), 30 deletions(-) diff --git a/HOWTO/INSTALL-WIN32-ARM64.md b/HOWTO/INSTALL-WIN32-ARM64.md index b68ca5069954..75ce35c966a1 100644 --- a/HOWTO/INSTALL-WIN32-ARM64.md +++ b/HOWTO/INSTALL-WIN32-ARM64.md @@ -179,6 +179,48 @@ the different tools: $ mv /mnt/c/OpenSSL-Win64/lib/libcrypto.lib /mnt/c/OpenSSL-Win64/lib/VC/static/libcrypto64MD.lib $ mv /mnt/c/OpenSSL-Win64/lib/libssl.lib /mnt/c/OpenSSL-Win64/lib/VC/static/libssl64MD.lib +* wxWidgets (optional) + You need this to build wx to use gui's in debugger and observer. + + We recommend v3.2.2.1 or later. + Unpack into `c:/opt/local64/pgm/wxWidgets-3.2.2.1` + + If the `wxUSE_POSTSCRIPT` isn't enabled in `c:/opt/local64/pgm/wxWidgets-3.2.2.1/include/wx/msw/setup.h`, + enable it. + + We recommend to enable fowxWebViewr wxUSE_WEBVIEW_EDGE. + * Download the nuget package 'Microsoft.Web.WebView2' (Version 0.9.488 or newer) + * Extract the package (it's a zip archive) to wxWidgets/3rdparty/webview2 (you should have 3rdparty/webview2/build/native/include/WebView2.h file after unpacking it) + * Enable wxUSE_WEBVIEW_EDGE in `c:/opt/local64/pgm/wxWidgets-3.2.2.1/include/wx/msw/setup.h` + + Build with: + + C:\...\> cd c:\opt\local64\pgm\wxWidgets-3.2.2.1\build\msw + C:\...\> nmake TARGET_CPU=arm64 BUILD=release SHARED=0 DIR_SUFFIX_CPU= -f makefile.vc + + Precompiled binaries are available here: + URL: + + $ rm -rf /mnt/c/opt/local64/pgm/wxWidgets-3.2.4 + $ curl -fSL https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.4/wxWidgets-3.2.4.zip -o wxWidgets-3.2.4.zip + $ mkdir -p /mnt/c/opt/local64/pgm/wxWidgets-3.2.4 + $ unzip wxWidgets-3.2.4.zip -d /mnt/c/opt/local64/pgm/wxWidgets-3.2.4 + + $ cd /mnt/c/opt/local64/pgm/wxWidgets-3.2.4/3rdparty + $ curl -fSL "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/1.0.2277.86" -OutFile "webview2-1.0.2277.86.zip" + $ rm -rf webview2 && mkdir webview2 + $ unzip webview2-1.0.2277.86.zip -d webview2 + + $ cd /mnt/c/opt/local64/pgm/wxWidgets-3.2.4/include/wx/msw + $ sed -i 's/#define wxUSE_POSTSCRIPT(\s+)(\d+)/#define wxUSE_POSTSCRIPT 1/' setup.h + $ sed -i 's/#define wxUSE_WEBVIEW(\s+)(\d+)/#define wxUSE_WEBVIEW 1/' setup.h + $ sed -i 's/#define wxUSE_WEBVIEW_EDGE (\s+)(\d+)/#define wxUSE_WEBVIEW_EDGE 1/' setup.h + + $ curl -fSL https://github.com/cocoa-xu/wxWidget-windows-build/releases/download/v3.2.4/wxWidgets-static-aarch64-windows-msvc.tar.gz -o wxWidgets-static-aarch64-windows-msvc.tar.gz + $ rm -rf /mnt/c/opt/local64/pgm/wxWidgets/lib/vc_arm64_lib + $ mkdir -p /mnt/c/opt/local64/pgm/wxWidgets/lib/vc_arm64_lib + $ tar -xzf wxWidgets-static-aarch64-windows-msvc.tar.gz -C /mnt/c/opt/local64/pgm/wxWidgets/lib/vc_arm64_lib + * Get the Erlang source distribution (from ). The same as for Unix platforms. Preferably use tar to unpack the source tar.gz (`tar zxf otp_src_%OTP-REL%.tar.gz`) to somewhere diff --git a/lib/wx/configure b/lib/wx/configure index a63875a8b32f..b20bf13ce8a2 100755 --- a/lib/wx/configure +++ b/lib/wx/configure @@ -6706,22 +6706,34 @@ printf "%s\n" "$as_me: OptionCheck: $with_wxdir $with_wx_prefix" >&6;} CWX_DOCUMENTED="$DOC_OPT2/wxWidgets-3.*.* $DOC_OPT2/wxMSW-3.*.* $CWX_DOCUMENTED" case $ac_cv_sizeof_void_p in - 8) - VC_LIB=lib/vc_x64_lib - WX_ARCH=x64 - DOC_OPT64_1=/opt/local64/pgm - DOC_OPT64_2=/mnt/c/opt/local64/pgm - CWX_DOCUMENTED="$DOC_OPT64_1/wxWidgets-3.*.* $DOC_OPT64_1/wxMSW-3.*.* $CWX_DOCUMENTED" - CWX_DOCUMENTED="$DOC_OPT64_2/wxWidgets-3.*.* $DOC_OPT64_2/wxMSW-3.*.* $CWX_DOCUMENTED" - ;; + 8) + case $host_cpu in + aarch64) + VC_LIB=lib/vc_arm64_lib + WX_ARCH=aarch64 + ;; + x86_64) + VC_LIB=lib/vc_x64_lib + WX_ARCH=x64 + ;; + *) + VC_LIB=lib/vc_x64_lib + WX_ARCH=x64 + ;; + esac + DOC_OPT64_1=/opt/local64/pgm + DOC_OPT64_2=/mnt/c/opt/local64/pgm + CWX_DOCUMENTED="$DOC_OPT64_1/wxWidgets-3.*.* $DOC_OPT64_1/wxMSW-3.*.* $CWX_DOCUMENTED" + CWX_DOCUMENTED="$DOC_OPT64_2/wxWidgets-3.*.* $DOC_OPT64_2/wxMSW-3.*.* $CWX_DOCUMENTED" + ;; *) - VC_LIB=lib/vc_lib - WX_ARCH=x86 - DOC_OPT3=/opt/local32/pgm - DOC_OPT4=/mnt/c/opt/local32/pgm - CWX_DOCUMENTED="$DOC_OPT3/wxWidgets-3.*.* $DOC_OPT3/wxMSW-3.*.* $CWX_DOCUMENTED" - CWX_DOCUMENTED="$DOC_OPT4/wxWidgets-3.*.* $DOC_OPT4/wxMSW-3.*.* $CWX_DOCUMENTED" - ;; + VC_LIB=lib/vc_lib + WX_ARCH=x86 + DOC_OPT3=/opt/local32/pgm + DOC_OPT4=/mnt/c/opt/local32/pgm + CWX_DOCUMENTED="$DOC_OPT3/wxWidgets-3.*.* $DOC_OPT3/wxMSW-3.*.* $CWX_DOCUMENTED" + CWX_DOCUMENTED="$DOC_OPT4/wxWidgets-3.*.* $DOC_OPT4/wxMSW-3.*.* $CWX_DOCUMENTED" + ;; esac CWXPATH="$CWXWIN0 $CWXWIN1 $CWXWIN2 $CWX_DOCUMENTED $CWXWIN3 $CWXWIN4" diff --git a/lib/wx/configure.ac b/lib/wx/configure.ac index ba34c709fc2d..de11e762cf7f 100644 --- a/lib/wx/configure.ac +++ b/lib/wx/configure.ac @@ -488,22 +488,34 @@ AS_IF( CWX_DOCUMENTED="$DOC_OPT2/wxWidgets-3.*.* $DOC_OPT2/wxMSW-3.*.* $CWX_DOCUMENTED" case $ac_cv_sizeof_void_p in - 8) - VC_LIB=lib/vc_x64_lib - WX_ARCH=x64 - DOC_OPT64_1=/opt/local64/pgm - DOC_OPT64_2=/mnt/c/opt/local64/pgm - CWX_DOCUMENTED="$DOC_OPT64_1/wxWidgets-3.*.* $DOC_OPT64_1/wxMSW-3.*.* $CWX_DOCUMENTED" - CWX_DOCUMENTED="$DOC_OPT64_2/wxWidgets-3.*.* $DOC_OPT64_2/wxMSW-3.*.* $CWX_DOCUMENTED" - ;; + 8) + case $host_cpu in + aarch64) + VC_LIB=lib/vc_arm64_lib + WX_ARCH=aarch64 + ;; + x86_64) + VC_LIB=lib/vc_x64_lib + WX_ARCH=x64 + ;; + *) + VC_LIB=lib/vc_x64_lib + WX_ARCH=x64 + ;; + esac + DOC_OPT64_1=/opt/local64/pgm + DOC_OPT64_2=/mnt/c/opt/local64/pgm + CWX_DOCUMENTED="$DOC_OPT64_1/wxWidgets-3.*.* $DOC_OPT64_1/wxMSW-3.*.* $CWX_DOCUMENTED" + CWX_DOCUMENTED="$DOC_OPT64_2/wxWidgets-3.*.* $DOC_OPT64_2/wxMSW-3.*.* $CWX_DOCUMENTED" + ;; *) - VC_LIB=lib/vc_lib - WX_ARCH=x86 - DOC_OPT3=/opt/local32/pgm - DOC_OPT4=/mnt/c/opt/local32/pgm - CWX_DOCUMENTED="$DOC_OPT3/wxWidgets-3.*.* $DOC_OPT3/wxMSW-3.*.* $CWX_DOCUMENTED" - CWX_DOCUMENTED="$DOC_OPT4/wxWidgets-3.*.* $DOC_OPT4/wxMSW-3.*.* $CWX_DOCUMENTED" - ;; + VC_LIB=lib/vc_lib + WX_ARCH=x86 + DOC_OPT3=/opt/local32/pgm + DOC_OPT4=/mnt/c/opt/local32/pgm + CWX_DOCUMENTED="$DOC_OPT3/wxWidgets-3.*.* $DOC_OPT3/wxMSW-3.*.* $CWX_DOCUMENTED" + CWX_DOCUMENTED="$DOC_OPT4/wxWidgets-3.*.* $DOC_OPT4/wxMSW-3.*.* $CWX_DOCUMENTED" + ;; esac CWXPATH="$CWXWIN0 $CWXWIN1 $CWXWIN2 $CWX_DOCUMENTED $CWXWIN3 $CWXWIN4" From 27d808c2cf9fece866516419e26624fbec4cf8df Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 05:07:15 +0800 Subject: [PATCH 20/28] updated nsis script --- erts/etc/win32/nsis/erlang20.nsi | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/erts/etc/win32/nsis/erlang20.nsi b/erts/etc/win32/nsis/erlang20.nsi index 7d63671f89ca..0417ddecc3cf 100644 --- a/erts/etc/win32/nsis/erlang20.nsi +++ b/erts/etc/win32/nsis/erlang20.nsi @@ -58,7 +58,11 @@ Var STARTMENU_FOLDER !if ${WINTYPE} == "win64" InstallDir "$PROGRAMFILES64\Erlang OTP" !else - InstallDir "$PROGRAMFILES\Erlang OTP" + !if ${WINTYPE} == "arm64" + InstallDir "$PROGRAMFILES64\Erlang OTP" + !else + InstallDir "$PROGRAMFILES\Erlang OTP" + !endif !endif ;Remember install folder InstallDirRegKey HKLM "SOFTWARE\Ericsson\Erlang\${ERTS_VERSION}" "" @@ -68,7 +72,11 @@ Var STARTMENU_FOLDER !if ${WINTYPE} == "win64" !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)" !else - !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (i386)" + !if ${WINTYPE} == "arm64" + !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)" + !else + !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (Arm)" + !endif !endif ;-------------------------------- @@ -104,7 +112,7 @@ Var STARTMENU_FOLDER VIProductVersion "${OTP_VERSION_LONG}" VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Ericsson AB" -VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${OTP_VERSION}" +VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${OTP_VERSION}" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Erlang/OTP installer" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright Ericsson AB 2010-${YEAR}. All Rights Reserved." VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Erlang/OTP" @@ -385,6 +393,10 @@ Function .onInit StrCmpS ${WINTYPE} "win64" +1 +4 StrCpy $archprefix "amd64" StrCpy $sysnativedir "$WINDIR\sysnative" + Goto +4 + StrCmpS ${WINTYPE} "arm64" +1 +6 + StrCpy $archprefix "arm64" + StrCpy $sysnativedir "$WINDIR\sysnative" Goto +3 StrCpy $archprefix "x86" StrCpy $sysnativedir $SYSDIR From db4363826aed353378b0a4d8645f8ca97b733910 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 05:12:37 +0800 Subject: [PATCH 21/28] check newer vcredist.exe filenames --- erts/etc/win32/nsis/find_redist.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erts/etc/win32/nsis/find_redist.sh b/erts/etc/win32/nsis/find_redist.sh index 50723a23476a..6a43571ff822 100755 --- a/erts/etc/win32/nsis/find_redist.sh +++ b/erts/etc/win32/nsis/find_redist.sh @@ -85,13 +85,17 @@ add_path_element() if [ "$1" = "win64" ]; then AMD64DIR=true VCREDIST=vcredist_x64 + VCREDIST2=vcredist.x64 COMPONENTS="cl amd64 bin vc" elif [ "$1" = "win32" ]; then AMD64DIR=false VCREDIST=vcredist_x86 + VCREDIST2=vcredist.x86 COMPONENTS="cl bin vc" elif [ "$1" = "arm64" ]; then + AMD64DIR=false VCREDIST=vcredist_arm64 + VCREDIST2=vcredist.arm64 else echo "TARGET argument should win32, win64 or arm64" exit 2 @@ -103,6 +107,11 @@ if [ x"$VCToolsRedistDir" != x"" ]; then echo "$File" exit 0 fi + File="$VCToolsRedistDir/$VCREDIST2.exe" + if [ -r "$File" ]; then + echo "$File" + exit 0 + fi fi CLPATH=`lookup_prog_in_path cl` From 576dcb09a650f3c3bef4e0613ff38fad107c847c Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 05:18:27 +0800 Subject: [PATCH 22/28] fix a typo --- erts/etc/win32/nsis/erlang20.nsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erts/etc/win32/nsis/erlang20.nsi b/erts/etc/win32/nsis/erlang20.nsi index 0417ddecc3cf..c0b6c454069d 100644 --- a/erts/etc/win32/nsis/erlang20.nsi +++ b/erts/etc/win32/nsis/erlang20.nsi @@ -73,9 +73,9 @@ Var STARTMENU_FOLDER !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)" !else !if ${WINTYPE} == "arm64" - !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)" - !else !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (Arm)" + !else + !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)" !endif !endif From 747e27ac0268d629d4ccb56dc3cba81322b82222 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 05:53:15 +0800 Subject: [PATCH 23/28] updated nsis script --- erts/etc/win32/nsis/erlang20.nsi | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/erts/etc/win32/nsis/erlang20.nsi b/erts/etc/win32/nsis/erlang20.nsi index c0b6c454069d..52b9229de7b0 100644 --- a/erts/etc/win32/nsis/erlang20.nsi +++ b/erts/etc/win32/nsis/erlang20.nsi @@ -56,13 +56,9 @@ Var STARTMENU_FOLDER ;Folder selection page !if ${WINTYPE} == "win64" - InstallDir "$PROGRAMFILES64\Erlang OTP" + InstallDir "$PROGRAMFILES64\Erlang OTP" !else - !if ${WINTYPE} == "arm64" - InstallDir "$PROGRAMFILES64\Erlang OTP" - !else - InstallDir "$PROGRAMFILES\Erlang OTP" - !endif + InstallDir "$PROGRAMFILES\Erlang OTP" !endif ;Remember install folder InstallDirRegKey HKLM "SOFTWARE\Ericsson\Erlang\${ERTS_VERSION}" "" @@ -73,7 +69,7 @@ Var STARTMENU_FOLDER !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)" !else !if ${WINTYPE} == "arm64" - !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (Arm)" + !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (arm64)" !else !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)" !endif From 7a719a0080c82b8bb4237ddba17a49dc05eedc74 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 15:32:26 +0800 Subject: [PATCH 24/28] Update erts/etc/win32/nsis/find_redist.sh Co-authored-by: Dan Gudmundsson --- erts/etc/win32/nsis/find_redist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/etc/win32/nsis/find_redist.sh b/erts/etc/win32/nsis/find_redist.sh index 6a43571ff822..53d47cd9dbbf 100755 --- a/erts/etc/win32/nsis/find_redist.sh +++ b/erts/etc/win32/nsis/find_redist.sh @@ -116,7 +116,7 @@ fi CLPATH=`lookup_prog_in_path cl` if [ -z "$CLPATH" ]; then - echo "Can not locate cl.exe and vcredist_x86/x64/arm64.exe - OK if using mingw" >&2 + echo "Can not locate cl.exe and thus not vcredist - OK if using mingw" >&2 exit 1 fi From 551751f687e4e6cbca7c67884dd4f1c0e7cb09bc Mon Sep 17 00:00:00 2001 From: Cocoa Date: Tue, 20 Feb 2024 15:32:47 +0800 Subject: [PATCH 25/28] fix typo in nsis script --- erts/etc/win32/nsis/erlang20.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/etc/win32/nsis/erlang20.nsi b/erts/etc/win32/nsis/erlang20.nsi index 52b9229de7b0..3b83115bc395 100644 --- a/erts/etc/win32/nsis/erlang20.nsi +++ b/erts/etc/win32/nsis/erlang20.nsi @@ -71,7 +71,7 @@ Var STARTMENU_FOLDER !if ${WINTYPE} == "arm64" !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (arm64)" !else - !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (x64)" + !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${OTP_PRODUCT} ${OTP_RELEASE} (i386)" !endif !endif From 2d79abba857f885ffd0096f8f31f3ed2e3023ffb Mon Sep 17 00:00:00 2001 From: Cocoa Date: Fri, 23 Feb 2024 23:20:55 +0800 Subject: [PATCH 26/28] use fwrite in `display_string_2` for windows --- erts/emulator/beam/bif.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index 95f9abf90d0e..896df8a41f84 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -3901,11 +3901,11 @@ BIF_RETTYPE display_string_2(BIF_ALIST_2) int res; #ifdef __WIN32__ - HANDLE fd; + FILE * fstream; if (ERTS_IS_ATOM_STR("stdout", BIF_ARG_1)) { - fd = GetStdHandle(STD_OUTPUT_HANDLE); + fd = stdout } else if (ERTS_IS_ATOM_STR("stderr", BIF_ARG_1)) { - fd = GetStdHandle(STD_ERROR_HANDLE); + fd = stderr; } #else int fd; @@ -3964,11 +3964,9 @@ BIF_RETTYPE display_string_2(BIF_ALIST_2) #endif { #ifdef __WIN32__ - Uint32 w; - if (!WriteFile(fd, str, len, &w, NULL)) { + res = fwrite(str, len, 1, fd); + if (res <= 0) goto error; - } - written = (Sint)w; #else written = 0; do { From 892019ab1e6fd03381d8f08c2b3642329a7d4130 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Sat, 24 Feb 2024 09:59:25 +0800 Subject: [PATCH 27/28] handle nanosecond in erlang code --- erts/emulator/beam/erl_time_sup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c index 7af829e738ba..f1ff15c143f9 100644 --- a/erts/emulator/beam/erl_time_sup.c +++ b/erts/emulator/beam/erl_time_sup.c @@ -2184,9 +2184,7 @@ time_unit_conversion(Process *c_p, Eterm term, ErtsMonotonicTime val, ErtsMonoto case am_nanosecond: case am_nano_seconds: case make_small(1000*1000*1000): - result = ERTS_MONOTONIC_TO_NSEC(val) + muloff*ERTS_MONOTONIC_OFFSET_NSEC; - ERTS_BIF_PREP_RET(ret, make_time_val(c_p, result)); - break; + goto trap_to_erlang_code; #endif case am_perf_counter: goto trap_to_erlang_code; From 0641273a670d2f7852db39e31d15fb1c2a0eab73 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Sat, 9 Mar 2024 09:59:16 +0800 Subject: [PATCH 28/28] fix display_string_2 --- erts/emulator/beam/bif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index 896df8a41f84..2b5bc0cadb19 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -3901,9 +3901,9 @@ BIF_RETTYPE display_string_2(BIF_ALIST_2) int res; #ifdef __WIN32__ - FILE * fstream; + FILE * fd; if (ERTS_IS_ATOM_STR("stdout", BIF_ARG_1)) { - fd = stdout + fd = stdout; } else if (ERTS_IS_ATOM_STR("stderr", BIF_ARG_1)) { fd = stderr; }