From eafea0352a26faf652c055bcce7e462a4df46150 Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:04:13 -0800 Subject: [PATCH 1/6] Revert "Make runtime compatible with VMR cross-builds (#95088)" This reverts commit ef66447c3f3767da16c2e4db0acdeda5ac022844. --- eng/SourceBuild.props | 6 ++---- src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj | 1 - src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 3e93e1aa4507fa..383c4cef575d7c 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -15,8 +15,7 @@ true - $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) - $(HostRid) + $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) <_targetRidPlatformIndex>$(TargetRid.LastIndexOf('-')) @@ -38,7 +37,6 @@ $(InnerBuildArgs) --nodereuse false $(InnerBuildArgs) --warnAsError false $(InnerBuildArgs) --outputrid $(TargetRid) - $(InnerBuildArgs) --cross $(InnerBuildArgs) /p:PackageOS=$(RuntimeOS) /p:ToolsOS=$(RuntimeOS) @@ -73,7 +71,7 @@ - + diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index 420887585d68a6..6c94731ffdade7 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -18,7 +18,6 @@ true $(ROOTFS_DIR) true - false true true true diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj index 9b84ac0f097b69..8243494d1e15ad 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj @@ -28,8 +28,6 @@ false false - - false true From 7253e5262b0702929d58057086e0388fb97de6b7 Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Wed, 29 Nov 2023 09:15:30 -0800 Subject: [PATCH 2/6] Add support for crossbuilds in the VMR --- eng/SourceBuild.props | 7 ++++++- src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj | 1 + src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj | 3 ++- .../libs/System.Security.Cryptography.Native/pal_evp.c | 5 +++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 383c4cef575d7c..8a373e1dcb0f13 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -21,6 +21,9 @@ <_targetRidPlatformIndex>$(TargetRid.LastIndexOf('-')) $(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-')) + <_hostRidPlatformIndex>$(HostRid.LastIndexOf('-')) + $(HostRid.Substring($(_hostRidPlatformIndex)).TrimStart('-')) + minimal @@ -31,6 +34,7 @@ This allows to build the repository using './build.sh /p:DotNetBuildFromSource=true'. Properties that control flags from source-build, and the expected output for source-build should be added to this file. --> $(InnerBuildArgs) --arch $(TargetArch) + $(InnerBuildArgs) --cross $(InnerBuildArgs) --configuration $(Configuration) $(InnerBuildArgs) --allconfigurations $(InnerBuildArgs) --verbosity $(LogVerbosity) @@ -49,6 +53,7 @@ $(InnerBuildArgs) /p:ContinuousIntegrationBuild=$(ContinuousIntegrationBuild) $(InnerBuildArgs) --usemonoruntime $(InnerBuildArgs) /p:PortableBuild=$(PortableBuild) + $(InnerBuildArgs) /p:DotnetBuildVertical=$(DotnetBuildVertical) @@ -71,7 +76,7 @@ - + diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index 6c94731ffdade7..d3ccae71ef5cb4 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -19,6 +19,7 @@ $(ROOTFS_DIR) true true + false true true diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj index 8243494d1e15ad..2416920ed40552 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj @@ -28,7 +28,8 @@ false false - true + false + $(PublishReadyToRun) diff --git a/src/native/libs/System.Security.Cryptography.Native/pal_evp.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp.c index b623df6b0b1784..686b9458e9ae5d 100644 --- a/src/native/libs/System.Security.Cryptography.Native/pal_evp.c +++ b/src/native/libs/System.Security.Cryptography.Native/pal_evp.c @@ -9,6 +9,7 @@ #include #define SUCCESS 1 +#define UNUSED(X) (void)(X) static const EVP_MD* g_evpFetchMd5 = NULL; static pthread_once_t g_evpFetch = PTHREAD_ONCE_INIT; @@ -133,6 +134,10 @@ int32_t CryptoNative_EvpDigestFinalXOF(EVP_MD_CTX* ctx, uint8_t* md, uint32_t le return EVP_DigestFinalXOF(ctx, md, len); } } + #else + UNUSED(ctx); + UNUSED(md); + UNUSED(len); #endif return 0; From 11caea4e43f1054700b50aa9aaa85abcafcafb2a Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:58:30 -0800 Subject: [PATCH 3/6] Fix typo and remove unused macro --- eng/SourceBuild.props | 4 ++-- .../libs/System.Security.Cryptography.Native/pal_evp.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 02e4c5934f1072..6d1e9ecc3c5f84 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -53,7 +53,7 @@ $(InnerBuildArgs) /p:ContinuousIntegrationBuild=$(ContinuousIntegrationBuild) $(InnerBuildArgs) --usemonoruntime $(InnerBuildArgs) /p:PortableBuild=$(PortableBuild) - $(InnerBuildArgs) /p:DotnetBuildVertical=$(DotnetBuildVertical) + $(InnerBuildArgs) /p:DotnetBuildVertical=$(DotnetBuildVertical) @@ -76,7 +76,7 @@ - + diff --git a/src/native/libs/System.Security.Cryptography.Native/pal_evp.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp.c index 686b9458e9ae5d..7559b4c1970b24 100644 --- a/src/native/libs/System.Security.Cryptography.Native/pal_evp.c +++ b/src/native/libs/System.Security.Cryptography.Native/pal_evp.c @@ -9,7 +9,6 @@ #include #define SUCCESS 1 -#define UNUSED(X) (void)(X) static const EVP_MD* g_evpFetchMd5 = NULL; static pthread_once_t g_evpFetch = PTHREAD_ONCE_INIT; @@ -135,9 +134,10 @@ int32_t CryptoNative_EvpDigestFinalXOF(EVP_MD_CTX* ctx, uint8_t* md, uint32_t le } } #else - UNUSED(ctx); - UNUSED(md); - UNUSED(len); + // Use each parameter to avoid unused parameter warnings. + (void)(ctx); + (void)(md); + (void)(len); #endif return 0; From a4e72f562689ed3a19f62ffd1d82b89267100cf0 Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:28:56 -0600 Subject: [PATCH 4/6] Set _hostRid to get host arch --- eng/SourceBuild.props | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 6d1e9ecc3c5f84..9706439fdc1532 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -14,15 +14,16 @@ true + <_hostRid>$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) - $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) + $(_hostRid) <_targetRidPlatformIndex>$(TargetRid.LastIndexOf('-')) $(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-')) - <_hostRidPlatformIndex>$(HostRid.LastIndexOf('-')) - $(HostRid.Substring($(_hostRidPlatformIndex)).TrimStart('-')) + <_hostRidPlatformIndex>$(_hostRid.LastIndexOf('-')) + <_hostArch>$(HostRid.Substring(_hostRidPlatformIndex).TrimStart('-')) minimal @@ -34,7 +35,7 @@ This allows to build the repository using './build.sh /p:DotNetBuildFromSource=true'. Properties that control flags from source-build, and the expected output for source-build should be added to this file. --> $(InnerBuildArgs) --arch $(TargetArch) - $(InnerBuildArgs) --cross + $(InnerBuildArgs) --cross $(InnerBuildArgs) --configuration $(Configuration) $(InnerBuildArgs) --allconfigurations $(InnerBuildArgs) --verbosity $(LogVerbosity) From 999e61a00541edfa084fecbb0a723ff3f0b3ab5c Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:59:45 -0600 Subject: [PATCH 5/6] Fix property reference in SourceBuild.props --- eng/SourceBuild.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 9706439fdc1532..d588f565aec22e 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -23,7 +23,7 @@ $(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-')) <_hostRidPlatformIndex>$(_hostRid.LastIndexOf('-')) - <_hostArch>$(HostRid.Substring(_hostRidPlatformIndex).TrimStart('-')) + <_hostArch>$(HostRid.Substring($(_hostRidPlatformIndex)).TrimStart('-')) minimal From ae285d40f114e96ca55b840e1a41227efbadc1dc Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Thu, 30 Nov 2023 16:42:16 -0600 Subject: [PATCH 6/6] Fix _hostArch assignment in SourceBuild.props --- eng/SourceBuild.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index d588f565aec22e..1463c13145dc26 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -23,7 +23,7 @@ $(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-')) <_hostRidPlatformIndex>$(_hostRid.LastIndexOf('-')) - <_hostArch>$(HostRid.Substring($(_hostRidPlatformIndex)).TrimStart('-')) + <_hostArch>$(_hostRid.Substring($(_hostRidPlatformIndex)).TrimStart('-')) minimal