From 17526d6acac8c94d23bce40f5a6584e173e1d6a1 Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Tue, 26 Oct 2021 01:17:55 +0200 Subject: [PATCH] Fix ARM64 build --- .github/actions/spelling/expect/expect.txt | 2 ++ src/common.build.pre.props | 3 ++- src/cppwinrt.build.pre.props | 2 +- src/host/proxy/Host.Proxy.vcxproj | 6 ++++-- src/host/proxy/Host.Proxy.vcxproj.filters | 3 +++ src/host/proxy/nodefaultlib_shim.h | 18 ++++++++++++++++++ 6 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 src/host/proxy/nodefaultlib_shim.h diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index dccd6d7405a1..d3cca6bba1de 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -1535,6 +1535,7 @@ NOCOLOR NOCOMM NOCONTEXTHELP NOCOPYBITS +nodefaultlib nodiscard NODUP noexcept @@ -2232,6 +2233,7 @@ STARTWPARMSW Statusline stdafx STDAPI +stdc stdcall stdcpp stderr diff --git a/src/common.build.pre.props b/src/common.build.pre.props index ca15b0a04369..1ec821e3f036 100644 --- a/src/common.build.pre.props +++ b/src/common.build.pre.props @@ -107,7 +107,7 @@ C4467: usage of ATL attributes is deprecated Conhost code still uses ATL. --> - 4103;4201;4312;4467;%(DisableSpecificWarnings) + 4103;4201;4312;4467;5105;%(DisableSpecificWarnings) _WINDOWS;EXTERNAL_BUILD;%(PreprocessorDefinitions) true precomp.h @@ -117,6 +117,7 @@ false false stdcpp17 + stdc17 /utf-8 %(AdditionalOptions) Guard Fast diff --git a/src/cppwinrt.build.pre.props b/src/cppwinrt.build.pre.props index 4587ab3ead82..2022dbc7f511 100644 --- a/src/cppwinrt.build.pre.props +++ b/src/cppwinrt.build.pre.props @@ -75,7 +75,7 @@ true true %(AdditionalOptions) /bigobj /Zc:twoPhase- - 5104;5105;28204;%(DisableSpecificWarnings) + 5104;28204;%(DisableSpecificWarnings) $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) diff --git a/src/host/proxy/Host.Proxy.vcxproj b/src/host/proxy/Host.Proxy.vcxproj index 9896862b6521..c21cdc318649 100644 --- a/src/host/proxy/Host.Proxy.vcxproj +++ b/src/host/proxy/Host.Proxy.vcxproj @@ -31,6 +31,7 @@ + @@ -56,13 +57,14 @@ - ..;%(AdditionalIncludeDirectories) - StdCall + .;..;%(AdditionalIncludeDirectories) + StdCall REGISTER_PROXY_DLL;WIN32;%(PreprocessorDefinitions) NotUsing false false + nodefaultlib_shim.h;%(ForcedIncludeFiles) OpenConsoleProxy.def diff --git a/src/host/proxy/Host.Proxy.vcxproj.filters b/src/host/proxy/Host.Proxy.vcxproj.filters index df6bcbd10c65..1cdf7ca25122 100644 --- a/src/host/proxy/Host.Proxy.vcxproj.filters +++ b/src/host/proxy/Host.Proxy.vcxproj.filters @@ -41,6 +41,9 @@ Header Files + + Header Files + diff --git a/src/host/proxy/nodefaultlib_shim.h b/src/host/proxy/nodefaultlib_shim.h new file mode 100644 index 000000000000..09c0ad53c8ee --- /dev/null +++ b/src/host/proxy/nodefaultlib_shim.h @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +#include + +#if !defined(_M_IX86) && !defined(_M_X64) + +// ARM64 doesn't define a (__builtin_)memcmp function without CRT, +// but we need one to compile IID_GENERIC_CHECK_IID. +// Luckily we only ever use memcmp for IIDs. +#pragma function(memcmp) +inline int memcmp(const IID* a, const IID* b, size_t count) +{ + (void)(count); + return 1 - InlineIsEqualGUID(a, b); +} + +#endif