From f9d2e46f20b77af1b9e46866217d1815157f0b9b Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Fri, 7 Jul 2023 13:59:40 +0200 Subject: [PATCH 1/4] source-build: don't skip building Native Aot artifacts. --- Directory.Build.props | 1 + eng/Subsets.props | 3 --- .../BuildIntegration/Microsoft.NETCore.Native.Unix.targets | 3 +++ src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj | 2 -- src/coreclr/tools/aot/ILCompiler/ILCompiler.props | 3 +-- src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 2 -- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 2 -- 7 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 168399e791fe58..0ca0b3142743e5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -298,6 +298,7 @@ true false true + true true diff --git a/eng/Subsets.props b/eng/Subsets.props index bfa808ab25cd95..a31f68e692032e 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -109,9 +109,6 @@ - - true - true diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index bb1b8c435a1377..3f03084c7d7bfa 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -136,6 +136,9 @@ The .NET Foundation licenses this file to you under the MIT license. + + + diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index 7e5f930584abfc..a3e1f821e3442b 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -10,8 +10,6 @@ $(RuntimeBinDir)ilc-published/ - - false false true diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props index 17c95600f15e76..d42e3587ada60d 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props @@ -48,8 +48,7 @@ true - - true + true diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index ceeb4d63ad0c1e..9afb7cabc60912 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -4,8 +4,6 @@ $(RuntimeBinDir)crossgen2 - - false true linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;freebsd-arm64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64 diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index f697e4d716a56c..1790351137d0c1 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -20,8 +20,6 @@ false false - - false Date: Fri, 7 Jul 2023 15:09:37 +0200 Subject: [PATCH 2/4] Add LinkerArgs for openssl only for Linux target. --- .../BuildIntegration/Microsoft.NETCore.Native.Unix.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index 3f03084c7d7bfa..9d2638cc04be3d 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -137,8 +137,8 @@ The .NET Foundation licenses this file to you under the MIT license. - - + + From 30242120a43ad50f68cf6fbe960561d3488b5b0d Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Tue, 11 Jul 2023 13:28:59 +0200 Subject: [PATCH 3/4] Force portable OpenSSL when NativeAOT. --- Directory.Build.props | 2 ++ eng/SourceBuild.props | 1 + eng/build.sh | 1 + eng/native/build-commons.sh | 8 +++++++- .../Microsoft.NETCore.Native.Unix.targets | 3 --- src/coreclr/runtime.proj | 1 + src/native/corehost/build.sh | 2 +- src/native/corehost/corehost.proj | 1 + src/native/libs/build-native.proj | 1 + src/native/libs/build-native.sh | 2 +- 10 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 0ca0b3142743e5..9d63a940d01778 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -311,6 +311,8 @@ '$(OfficialBuildId)' == ''">true true + + true diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 1e9d5cf8906491..33184a77356b6a 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -37,6 +37,7 @@ $(InnerBuildArgs) --nodereuse false $(InnerBuildArgs) --warnAsError false $(InnerBuildArgs) --outputrid $(TargetRid) + $(InnerBuildArgs) /p:NativeAotSupported=$(NativeAotSupported) $(InnerBuildArgs) /p:PackageOS=$(RuntimeOS) /p:ToolsOS=$(RuntimeOS) diff --git a/eng/build.sh b/eng/build.sh index bfe3d351e2a62e..52420743abf4e4 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -81,6 +81,7 @@ usage() echo " --gcc Optional argument to build using gcc in PATH (default)." echo " --gccx.y Optional argument to build using gcc version x.y." echo " --portablebuild Optional argument: set to false to force a non-portable build." + echo " --portablessl Optional argument: set to true to force a portable OpenSSL build." echo " --keepnativesymbols Optional argument: set to true to keep native symbols/debuginfo in generated binaries." echo " --ninja Optional argument: set to true to use Ninja instead of Make to run the native build." echo " --pgoinstrument Optional argument: build PGO-instrumented runtime" diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index e9d696fa87f14a..006ef290574a99 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -411,6 +411,10 @@ while :; do __PortableBuild=0 ;; + portablessl=true|-portablebuild=true) + __PortableSsl=1 + ;; + release|-release) __BuildType=Release ;; @@ -511,6 +515,8 @@ if [[ "$__PortableBuild" == 0 ]]; then __CommonMSBuildArgs="$__CommonMSBuildArgs /p:PortableBuild=false" fi +__PortableSsl="${__PortableSsl:-$__PortableBuild}" + if [[ "$__TargetArch" == wasm ]]; then # nothing to do here true @@ -524,7 +530,7 @@ elif [[ "$__TargetOS" == android ]]; then # nothing to do here true else - __CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs" + __CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableSsl $__CMakeArgs" fi # Configure environment if we are doing a cross compile. diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index 9d2638cc04be3d..bb1b8c435a1377 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -136,9 +136,6 @@ The .NET Foundation licenses this file to you under the MIT license. - - - diff --git a/src/coreclr/runtime.proj b/src/coreclr/runtime.proj index 496e28198429f2..c5902b1ac093b7 100644 --- a/src/coreclr/runtime.proj +++ b/src/coreclr/runtime.proj @@ -30,6 +30,7 @@ <_CoreClrBuildArg Condition="'$(ContinuousIntegrationBuild)' == 'true'" Include="-ci" /> <_CoreClrBuildArg Condition="'$(CrossBuild)' == 'true'" Include="-cross" /> <_CoreClrBuildArg Condition="'$(PortableBuild)' != 'true'" Include="-portablebuild=false" /> + <_CoreClrBuildArg Condition="'$(PortableSsl)' == 'true'" Include="-portablessl=true" /> <_CoreClrBuildArg Condition="'$(KeepNativeSymbols)' != 'false'" Include="-keepnativesymbols" /> <_CoreClrBuildArg Include="-os $(_BuildNativeTargetOS)" /> diff --git a/src/native/corehost/build.sh b/src/native/corehost/build.sh index def574f4839ca8..7e82cfb8274f61 100755 --- a/src/native/corehost/build.sh +++ b/src/native/corehost/build.sh @@ -82,7 +82,7 @@ export __BinDir __IntermediatesDir __RuntimeFlavor __CMakeArgs="-DCLI_CMAKE_HOST_VER=\"$__host_ver\" -DCLI_CMAKE_COMMON_HOST_VER=\"$__apphost_ver\" -DCLI_CMAKE_HOST_FXR_VER=\"$__fxr_ver\" $__CMakeArgs" __CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=\"$__policy_ver\" -DCLI_CMAKE_PKG_RID=\"$__OutputRid\" -DCLI_CMAKE_FALLBACK_OS=\"$__HostFallbackOS\" -DCLI_CMAKE_COMMIT_HASH=\"$__commit_hash\" $__CMakeArgs" __CMakeArgs="-DRUNTIME_FLAVOR=\"$__RuntimeFlavor\" $__CMakeArgs" -__CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs" +__CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableSsl $__CMakeArgs" # Specify path to be set for CMAKE_INSTALL_PREFIX. # This is where all built CoreClr libraries will copied to. diff --git a/src/native/corehost/corehost.proj b/src/native/corehost/corehost.proj index 18ac25f41841d2..086a3fa0381389 100644 --- a/src/native/corehost/corehost.proj +++ b/src/native/corehost/corehost.proj @@ -75,6 +75,7 @@ $(BuildArgs) -cmakeargs "-DVERSION_FILE_PATH=$(NativeVersionFile)" $(BuildArgs) -configureonly $(BuildArgs) -portablebuild=false + $(BuildArgs) -portablessl=true $(BuildArgs) -keepnativesymbols $(BuildArgs) -cross $(BuildArgs) $(Compiler) diff --git a/src/native/libs/build-native.proj b/src/native/libs/build-native.proj index 40ceef386732a4..98263ea284f0ce 100644 --- a/src/native/libs/build-native.proj +++ b/src/native/libs/build-native.proj @@ -41,6 +41,7 @@ --> <_ProcessorCountArg> -numproc $(MSBuildNodeCount) <_PortableBuildArg Condition="'$(PortableBuild)' != 'true'"> -portablebuild=false + <_PortableBuildArg Condition="'$(PortableSsl)' == 'true'"> -portablessl=true <_CrossBuildArg Condition="'$(CrossBuild)' == 'true'"> -cross <_KeepNativeSymbolsBuildArg Condition="'$(KeepNativeSymbols)' != 'false'"> -keepnativesymbols <_CMakeArgs Condition="'$(CMakeArgs)' != ''"> -cmakeargs "$(CMakeArgs)" diff --git a/src/native/libs/build-native.sh b/src/native/libs/build-native.sh index 4d712eb0eed3ab..2802e375dbc2df 100755 --- a/src/native/libs/build-native.sh +++ b/src/native/libs/build-native.sh @@ -87,7 +87,7 @@ elif [[ "$__TargetOS" == android && -z "$ROOTFS_DIR" ]]; then # nothing to do here true else - __CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs" + __CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableSsl $__CMakeArgs" __CMakeArgs="-DCMAKE_STATIC_LIB_LINK=$__StaticLibLink $__CMakeArgs" if [[ "$__TargetOS" != linux-bionic && "$__TargetArch" != x86 && "$__TargetArch" != x64 && "$__TargetArch" != "$__HostArch" ]]; then From ebe95204470cc9b360947657a78d202528ece4ea Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Wed, 16 Aug 2023 15:43:10 +0200 Subject: [PATCH 4/4] ILCompiler: remove unneeded NativeAotSupported Condition. --- src/coreclr/tools/aot/ILCompiler/ILCompiler.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props index d42e3587ada60d..8c675010bbc19d 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props @@ -48,7 +48,7 @@ true - true + true