From 166c7978eec1d02de9f5bad891bc022272786004 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 27 Apr 2022 12:19:42 -0400 Subject: [PATCH] ALMOST compiles for ARM64 Windows, only remaining barrier is ring in zeroidc. --- node/Salsa20.hpp | 2 +- windows/ZeroTierOne.sln | 17 +- windows/ZeroTierOne/ZeroTierOne.vcxproj | 194 +++++++++++++++++- zeroidc/zeroidc.vcxproj | 254 ++++++++++++++---------- 4 files changed, 345 insertions(+), 122 deletions(-) diff --git a/node/Salsa20.hpp b/node/Salsa20.hpp index ae618cbf4..893553866 100644 --- a/node/Salsa20.hpp +++ b/node/Salsa20.hpp @@ -15,7 +15,7 @@ #include "Constants.hpp" #include "Utils.hpp" -#if (!defined(ZT_SALSA20_SSE)) && (defined(__SSE2__) || (defined(__WINDOWS__) && !defined(__MINGW32__))) +#if (!defined(ZT_SALSA20_SSE)) && (defined(__SSE2__) || (defined(__WINDOWS__) && !defined(__MINGW32__) && !defined(_M_ARM64))) #define ZT_SALSA20_SSE 1 #endif diff --git a/windows/ZeroTierOne.sln b/windows/ZeroTierOne.sln index e1242342a..83c0bad00 100644 --- a/windows/ZeroTierOne.sln +++ b/windows/ZeroTierOne.sln @@ -36,7 +36,8 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|Any CPU.ActiveCfg = Debug|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|ARM.ActiveCfg = Debug|Win32 - {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|ARM64.ActiveCfg = Debug|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|ARM64.Build.0 = Debug|ARM64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|Mixed Platforms.Deploy.0 = Debug|Win32 @@ -47,7 +48,7 @@ Global {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Debug|x64.Build.0 = Debug|x64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Any CPU.ActiveCfg = Profile|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|ARM.ActiveCfg = Profile|Win32 - {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|ARM64.ActiveCfg = Profile|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|ARM64.ActiveCfg = Profile|ARM64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Mixed Platforms.ActiveCfg = Profile|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Mixed Platforms.Build.0 = Profile|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|Win32.ActiveCfg = Profile|Win32 @@ -56,7 +57,8 @@ Global {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Profile|x64.Build.0 = Profile|x64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Any CPU.ActiveCfg = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|ARM.ActiveCfg = Release|Win32 - {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|ARM64.ActiveCfg = Release|Win32 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|ARM64.ActiveCfg = Release|ARM64 + {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|ARM64.Build.0 = Release|ARM64 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Mixed Platforms.Build.0 = Release|Win32 {B00A4957-5977-4AC1-9EF4-571DC27EADA2}.Release|Mixed Platforms.Deploy.0 = Release|Win32 @@ -91,7 +93,7 @@ Global {43BA7584-D4DB-4F7C-90FC-E2B18A68A213}.Release|x64.Deploy.0 = Win8 Release|x64 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Debug|Any CPU.ActiveCfg = Debug|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Debug|ARM.ActiveCfg = Debug|Win32 - {175C340F-F5BA-4CB1-88AD-533B102E3799}.Debug|ARM64.ActiveCfg = Debug|Win32 + {175C340F-F5BA-4CB1-88AD-533B102E3799}.Debug|ARM64.ActiveCfg = Debug|ARM64 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -102,8 +104,8 @@ Global {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|Any CPU.Build.0 = Debug|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|ARM.ActiveCfg = Debug|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|ARM.Build.0 = Debug|Win32 - {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|ARM64.ActiveCfg = Debug|Win32 - {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|ARM64.Build.0 = Debug|Win32 + {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|ARM64.ActiveCfg = Debug|ARM64 + {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|ARM64.Build.0 = Debug|ARM64 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|Mixed Platforms.ActiveCfg = Debug|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|Mixed Platforms.Build.0 = Debug|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|Win32.ActiveCfg = Debug|Win32 @@ -112,7 +114,8 @@ Global {175C340F-F5BA-4CB1-88AD-533B102E3799}.Profile|x64.Build.0 = Debug|x64 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Release|Any CPU.ActiveCfg = Release|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Release|ARM.ActiveCfg = Release|Win32 - {175C340F-F5BA-4CB1-88AD-533B102E3799}.Release|ARM64.ActiveCfg = Release|Win32 + {175C340F-F5BA-4CB1-88AD-533B102E3799}.Release|ARM64.ActiveCfg = Release|ARM64 + {175C340F-F5BA-4CB1-88AD-533B102E3799}.Release|ARM64.Build.0 = Release|ARM64 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Release|Mixed Platforms.Build.0 = Release|Win32 {175C340F-F5BA-4CB1-88AD-533B102E3799}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/windows/ZeroTierOne/ZeroTierOne.vcxproj b/windows/ZeroTierOne/ZeroTierOne.vcxproj index e09a5cd05..45df9fc23 100644 --- a/windows/ZeroTierOne/ZeroTierOne.vcxproj +++ b/windows/ZeroTierOne/ZeroTierOne.vcxproj @@ -1,6 +1,10 @@  + + Debug + ARM64 + Debug Win32 @@ -9,6 +13,10 @@ Debug x64 + + Profile + ARM64 + Profile Win32 @@ -17,6 +25,10 @@ Profile x64 + + Release + ARM64 + Release Win32 @@ -57,8 +69,10 @@ MaxSpeed MaxSpeed + MaxSpeed Default Default + Default @@ -78,8 +92,10 @@ MaxSpeed MaxSpeed + MaxSpeed Default Default + Default @@ -92,11 +108,14 @@ false + false false false false false + false false + false @@ -110,8 +129,11 @@ true true true + true true + true true + true @@ -121,14 +143,20 @@ false false false + false true + true StreamingSIMDExtensions2 + StreamingSIMDExtensions2 NoExtensions false false false + false false + false StreamingSIMDExtensions2 + StreamingSIMDExtensions2 NoExtensions @@ -249,12 +277,25 @@ MultiByte false + + Application + true + v142 + MultiByte + false + Application true v142 MultiByte + + Application + true + v142 + MultiByte + Application false @@ -271,6 +312,14 @@ MultiByte Static + + Application + false + v142 + true + MultiByte + Static + @@ -283,45 +332,78 @@ + + + + + + + + + .exe $(SolutionDir)\Build\$(Platform)\$(Configuration)\ zerotier-one_x86 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ .exe $(SolutionDir)\Build\$(Platform)\$(Configuration)\ zerotier-one_x86 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ .exe $(SolutionDir)\Build\$(Platform)\$(Configuration)\ zerotier-one_x86 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ .exe $(SolutionDir)\Build\$(Platform)\$(Configuration)\ zerotier-one_x64 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_arm64 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ .exe $(SolutionDir)\Build\$(Platform)\$(Configuration)\ zerotier-one_x64 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_arm64 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ .exe $(SolutionDir)\Build\$(Platform)\$(Configuration)\ zerotier-one_x64 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + + + .exe + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ + zerotier-one_arm64 + $(SolutionDir)\Build\$(Platform)\$(Configuration)\ @@ -334,6 +416,9 @@ false stdcpp14 true + stdc11 + false + false true @@ -352,6 +437,10 @@ 4996 false stdcpp14 + stdc11 + true + false + false true @@ -370,6 +459,32 @@ 4996 false stdcpp14 + stdc11 + false + false + + + true + wbemuuid.lib;wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;zeroidc.lib;bcrypt.lib;userenv.lib;crypt32.lib;secur32.lib;ncrypt.lib;ntdll.lib;%(AdditionalDependencies) + false + "notelemetry.obj" %(AdditionalOptions) + $(SolutionDir)..\zeroidc\target\x86_64-pc-windows-msvc\debug\;%(AdditionalLibraryDirectories) + + + + + Level3 + Disabled + true + $(SolutionDir)\..\zeroidc\target;%(AdditionalIncludeDirectories) + ZT_EXPORT;FD_SETSIZE=1024;NOMINMAX;STATICLIB;WIN32;ZT_TRACE;ZT_RULES_ENGINE_DEBUGGING;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + true + 4996 + false + stdcpp14 + stdc11 + false + false true @@ -386,10 +501,35 @@ true $(SolutionDir)\..\zeroidc\target;%(AdditionalIncludeDirectories) ZT_EXPORT;FD_SETSIZE=1024;NOMINMAX;STATICLIB;WIN32;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) - false + true 4996 false stdcpp14 + stdc11 + false + false + + + true + wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;%(AdditionalDependencies) + false + "notelemetry.obj" %(AdditionalOptions) + + + + + Level3 + Disabled + true + $(SolutionDir)\..\zeroidc\target;%(AdditionalIncludeDirectories) + ZT_EXPORT;FD_SETSIZE=1024;NOMINMAX;STATICLIB;WIN32;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="disable";%(PreprocessorDefinitions) + true + 4996 + false + stdcpp14 + stdc11 + false + false true @@ -400,15 +540,14 @@ - Level2 + Level1 MaxSpeed - true + false true true $(SolutionDir)\..\zeroidc\target;%(AdditionalIncludeDirectories) ZT_EXPORT;FD_SETSIZE=1024;STATICLIB;ZT_SALSA20_SSE;ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=1;%(PreprocessorDefinitions) MultiThreaded - StreamingSIMDExtensions2 true AnySuitable Speed @@ -422,6 +561,9 @@ false true false + stdc11 + false + false false @@ -434,9 +576,9 @@ - Level2 + Level1 MaxSpeed - true + false true true $(SolutionDir)\..\zeroidc\target;%(AdditionalIncludeDirectories) @@ -458,6 +600,46 @@ false true stdc11 + false + false + + + false + true + true + wbemuuid.lib;wsock32.lib;ws2_32.lib;Iphlpapi.lib;Rpcrt4.lib;zeroidc.lib;bcrypt.lib;userenv.lib;crypt32.lib;secur32.lib;ncrypt.lib;ntdll.lib;%(AdditionalDependencies) + false + $(SolutionDir)..\zeroidc\target\x86_64-pc-windows-msvc\release\;%(AdditionalLibraryDirectories) + + + + + Level1 + MaxSpeed + false + true + true + $(SolutionDir)\..\zeroidc\target;%(AdditionalIncludeDirectories) + ZT_EXPORT;FD_SETSIZE=1024;STATICLIB;ZT_SOFTWARE_UPDATE_DEFAULT="apply";ZT_USE_MINIUPNPC;MINIUPNP_STATICLIB;WIN32;NOMINMAX;ZT_BUILD_PLATFORM=2;ZT_BUILD_ARCHITECTURE=2;%(PreprocessorDefinitions) + MultiThreaded + NotSet + true + AnySuitable + Speed + true + 4996 + Guard + false + Cdecl + false + stdcpp14 + None + false + false + true + stdc11 + false + false false diff --git a/zeroidc/zeroidc.vcxproj b/zeroidc/zeroidc.vcxproj index 7410d1570..d0b06945f 100644 --- a/zeroidc/zeroidc.vcxproj +++ b/zeroidc/zeroidc.vcxproj @@ -1,109 +1,147 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - {175C340F-F5BA-4CB1-88AD-533B102E3799} - Win32Proj - - - - Makefile - true - v142 - - - Makefile - false - v142 - - - Makefile - true - v142 - - - Makefile - false - v142 - - - - - - - - - - - - - - - - - - - - - cargo build --release --target=x86_64-pc-windows-msvc - - - cargo clean - cargo clean & cargo build --release --target=x86_64-pc-windows-msvc - NDEBUG;$(NMakePreprocessorDefinitions) - - - cargo build --target=i686-pc-windows-msvc - - - cargo clean - cargo clean & cargo build --target=i686-pc-windows-msvc - WIN32;_DEBUG;$(NMakePreprocessorDefinitions) - - - cargo build --target=x86_64-pc-windows-msvc - - - cargo clean - cargo clean & cargo build --target=x86_64-pc-windows-msvc - _DEBUG;$(NMakePreprocessorDefinitions) - - - cargo build --release --target=i686-pc-windows-msvc - - - cargo clean - cargo clean & cargo build --release --target=i686-pc-windows-msvc - WIN32;NDEBUG;$(NMakePreprocessorDefinitions) - - - - - - - - - - - - - + + + + + Debug + ARM64 + + + Debug + Win32 + + + Release + ARM64 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + {175C340F-F5BA-4CB1-88AD-533B102E3799} + Win32Proj + + + + Makefile + true + v142 + + + Makefile + false + v142 + + + Makefile + true + v142 + + + Makefile + true + v142 + + + Makefile + false + v142 + + + Makefile + false + v142 + + + + + + + + + + + + + + + + + + + + + + + + + + + cargo build --release --target=x86_64-pc-windows-msvc + + + cargo clean + cargo clean & cargo build --release --target=x86_64-pc-windows-msvc + NDEBUG;$(NMakePreprocessorDefinitions) + + + cargo build --release --target=aarch64-pc-windows-msvc + + cargo clean + cargo clean & cargo build --release --target=aarch64-pc-windows-msvc + NDEBUG;$(NMakePreprocessorDefinitions) + + + cargo build --target=i686-pc-windows-msvc + + + cargo clean + cargo clean & cargo build --target=i686-pc-windows-msvc + WIN32;_DEBUG;$(NMakePreprocessorDefinitions) + + + cargo build --target=x86_64-pc-windows-msvc + + + cargo clean + cargo clean & cargo build --target=x86_64-pc-windows-msvc + _DEBUG;$(NMakePreprocessorDefinitions) + + + cargo build --target=aarch64-pc-windows-msvc + + cargo clean + cargo clean & cargo build --target=aarch64-pc-windows-msvc + _DEBUG;$(NMakePreprocessorDefinitions) + + + cargo build --release --target=i686-pc-windows-msvc + + + cargo clean + cargo clean & cargo build --release --target=i686-pc-windows-msvc + WIN32;NDEBUG;$(NMakePreprocessorDefinitions) + + + + + + + + + + + + + \ No newline at end of file