Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consume libraries that we vendor fully by building separately and using a custom prefix path #113176

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eng/DotNetBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
<!-- TODO: LinuxTracepoints -->
<InnerBuildArgs Condition="$(UseSystemLibs.Contains('+rapidjson+'))">$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_RAPIDJSON=true</InnerBuildArgs>
<InnerBuildArgs Condition="$(UseSystemLibs.Contains('+zlib+'))">$(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_ZLIB=true</InnerBuildArgs>
<InnerBuildArgs Condition="'$(UseSystemLibs)' != ''">$(InnerBuildArgs) /p:UseSystemLibs=$(UseSystemLibs)</InnerBuildArgs>

<!-- Needed until https://github.com/dotnet/runtime/issues/109329 is fixed. -->
<InnerBuildArgs Condition="'$(NetCoreAppToolCurrentVersion)' != ''">$(InnerBuildArgs) /p:NetCoreAppToolCurrentVersion=$(NetCoreAppToolCurrentVersion)</InnerBuildArgs>
Expand Down
1 change: 1 addition & 0 deletions eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<MonoArtifactsPath Condition="'$(MonoArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin', 'mono', '$(TargetOS).$(TargetArchitecture).$(MonoConfiguration)'))</MonoArtifactsPath>
<LibrariesArtifactsPath Condition="'$(LibrariesArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</LibrariesArtifactsPath>
<LibrariesAllConfigurationsArtifactsPath Condition="'$(LibrariesAllConfigurationsArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</LibrariesAllConfigurationsArtifactsPath>
<VendoredLibraryRootPath>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin', 'native', 'external', '$(TargetOS).$(TargetArchitecture).$(Configuration)'))</VendoredLibraryRootPath>
</PropertyGroup>

<!-- Set up artifact subpaths. -->
Expand Down
7 changes: 7 additions & 0 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,17 @@ if (CLR_CMAKE_TARGET_ANDROID OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET
# Some platforms are opted-out from using the in-tree zlib-ng by default:
# - Android and iOS-like platforms: concerns about extra binary size
# - Armv6: zlib-ng has build breaks
# Keep in sync with the conditions in src/native/external/vendored-libs.proj
set(CLR_CMAKE_USE_SYSTEM_ZLIB 1)
endif()

if (NOT CLR_CMAKE_TARGET_ANDROID)
# opt into building tools like ildasm/ilasm
set(CLR_CMAKE_BUILD_TOOLS 1)
endif()

if (CLR_CMAKE_TARGET_UNIX)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif()

set(CMAKE_FIND_DEBUG_MODE TRUE)
2 changes: 1 addition & 1 deletion eng/native/gen-buildsys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ if not "%__ConfigureOnly%" == "1" (
if /i "%__UseEmcmake%" == "1" (
call "!EMSDK_PATH!/emsdk_env.cmd" > nul 2>&1 && emcmake "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir%
) else (
echo "%CMakePath% %__ExtraCmakeParams% --no-warn-unused-cli -G %__CmakeGenerator% -B %__IntermediatesDir% -S %__SourceDir%"
echo %CMakePath% %__ExtraCmakeParams% --no-warn-unused-cli -G %__CmakeGenerator% -B %__IntermediatesDir% -S %__SourceDir%
"%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir%
)

Expand Down
10 changes: 7 additions & 3 deletions src/coreclr/runtime-prereqs.proj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<Import Project="$(RepositoryEngineeringDir)nativepgo.targets" />

<Target Name="BuildPrereqs" BeforeTargets="Build" DependsOnTargets="GenerateRuntimeVersionFile;GenerateNativeSourcelinkFile;OutputPgoPathForCI" />
<!--
This is a workaround when cross-compiling on Windows for Android.

<!--
This is a workaround when cross-compiling on Windows for Android.
https://github.com/dotnet/arcade/issues/15496
-->
Expand All @@ -39,4 +39,8 @@
<PropertyGroup>
<DebugType>Portable</DebugType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)/src/native/external/vendored-libs.proj" />
</ItemGroup>
</Project>
8 changes: 6 additions & 2 deletions src/coreclr/runtime.proj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<ProjectReference Condition="'$(HasCdacBuildTool)' == 'true'" Include="tools\cdac-build-tool\cdac-build-tool.csproj" ReferenceOutputAssembly="false" GlobalPropertiesToRemove="$(NativeBuildPartitionPropertiesToRemove)" />
</ItemGroup>

<ItemGroup>
<_CMakeArgs Include="-DCMAKE_PREFIX_PATH=$(VendoredLibraryRootPath.TrimEnd('\\'))" />
</ItemGroup>

<Import Project="$(RepositoryEngineeringDir)nativepgo.targets" />

<Target Name="BuildRuntime"
Expand Down Expand Up @@ -82,8 +86,8 @@

<ItemGroup Condition="('$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true') and '$(HostCrossOS)' == '' and '$(ANDROID_NDK_ROOT)' != ''">
<_CoreClrBuildArg Include="-cmakeargs &quot;-DANDROID_STL=c++_static&quot;"/>
<!--

<!--
Only apply this setting on non-windows builds. Our windows build has a hard
time with a value that has spaces in it.
-->
Expand Down Expand Up @@ -111,6 +115,6 @@
<Exec Command="$(_CoreClrBuildPreSource)$(MSBuildThisFileDirectory)&quot;$(_CoreClrBuildScript)&quot; @(_CoreClrBuildArg->'%(Identity)',' ')"
IgnoreStandardErrorWarningFormat="true" />
</Target>

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build freebsd-x64 Debug CoreCLR_TwoStage)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/freebsd.x64.Checked/" -x64 -checked -ci -cross -os freebsd -outputrid freebsd-x64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/freebsd.x64.Checked/cdac-build-tool/cdac-build-tool.dll"" exited with code 1.

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/linux.arm64.Release/" -arm64 -release -ci -cross -os linux -pgodatapath "/__w/1/s/.packages/optimization.linux-arm64.pgo.coreclr/1.0.0-prerelease.25104.10" -outputrid linux-musl-arm64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/linux.arm64.Release/cdac-build-tool/cdac-build-tool.dll"" exited with code 1.

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build android-x64 Release AllSubsets_CoreCLR)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/android.x64.Release/" -x64 -release -ci -os android -outputrid android-x64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/android.x64.Release/cdac-build-tool/cdac-build-tool.dll" -component runtime -component alljits -cmakeargs "-DANDROID_STL=c++_static" -cmakeargs -DANDROID_CPP_FEATURES="no-rtti exceptions"" exited with code 1.

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug Libraries_CheckedCoreCLR)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/linux.x64.Checked/" -x64 -checked -ci -cross -os linux -outputrid linux-musl-x64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/linux.x64.Checked/cdac-build-tool/cdac-build-tool.dll"" exited with code 1.

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 checked CoreCLR_ReleaseLibraries)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/linux.arm64.Checked/" -arm64 -checked -ci -cross -os linux -outputrid linux-musl-arm64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/linux.arm64.Checked/cdac-build-tool/cdac-build-tool.dll"" exited with code 1.

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug AllSubsets_CoreCLR)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/linux.x64.Release/" -x64 -release -ci -cross -os linux -pgodatapath "/__w/1/s/.packages/optimization.linux-x64.pgo.coreclr/1.0.0-prerelease.25104.10" -outputrid linux-musl-x64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/linux.x64.Release/cdac-build-tool/cdac-build-tool.dll"" exited with code 1.

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/linux.x64.Release/" -x64 -release -ci -cross -os linux -pgodatapath "/__w/1/s/.packages/optimization.linux-x64.pgo.coreclr/1.0.0-prerelease.25104.10" -outputrid linux-musl-x64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/linux.x64.Release/cdac-build-tool/cdac-build-tool.dll"" exited with code 1.

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build android-arm64 Release AllSubsets_CoreCLR)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/android.arm64.Release/" -arm64 -release -ci -os android -outputrid android-arm64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/android.arm64.Release/cdac-build-tool/cdac-build-tool.dll" -component runtime -component alljits -cmakeargs "-DANDROID_STL=c++_static" -cmakeargs -DANDROID_CPP_FEATURES="no-rtti exceptions"" exited with code 1.

Check failure on line 118 in src/coreclr/runtime.proj

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked Native_GCC)

src/coreclr/runtime.proj#L118

src/coreclr/runtime.proj(118,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "/__w/1/s/src/coreclr/"build-runtime.sh" -cmakeargs "-DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/linux.x64.Checked/" -x64 -checked gcc -ci -os linux -outputrid linux-x64 -cmakeargs "-DCLR_DOTNET_HOST_PATH=/__w/1/s/.dotnet/dotnet" -cmakeargs "-DCDAC_BUILD_TOOL_BINARY_PATH=/__w/1/s/artifacts/bin/coreclr/linux.x64.Checked/cdac-build-tool/cdac-build-tool.dll"" exited with code 2.
<Import Project="$(RepositoryEngineeringDir)nativeSanitizers.targets" />
</Project>
10 changes: 2 additions & 8 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,8 @@ endif()

# Decide if we need zlib-ng.
if(NOT DISABLE_EMBEDDED_PDB OR NOT DISABLE_LOG_PROFILER_GZ)
if (CLR_CMAKE_USE_SYSTEM_ZLIB)
# if we're not on a platform where we use the in-tree zlib-ng, require system zlib
include(${CLR_SRC_NATIVE_DIR}/libs/System.IO.Compression.Native/extra_libs.cmake)
set(Z_LIBS)
append_extra_compression_libs(Z_LIBS)
else()
include(${CLR_SRC_NATIVE_DIR}/external/zlib-ng.cmake)
endif()
find_package(ZLIB REQUIRED)
set (Z_LIBS ZLIB::ZLIB)
endif()

######################################
Expand Down
9 changes: 9 additions & 0 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)/src/native/external/vendored-libs.proj" />
</ItemGroup>

<!--
Like Wasm, Wasi needs a 64-bit python on windows to pinvoke into libClang.dll for offset generation.
Only wasi doesn't come with its own python and windows uses 32-bit python, so refer to the transport pack instead.
Expand Down Expand Up @@ -423,6 +427,7 @@
<_MonoCMakeArgs Include="-DGC_SUSPEND=$(MonoThreadSuspend)" />
<_MonoCMakeArgs Include="-DMONO_LIB_NAME=$(MonoLibName)" />
<_MonoCMakeArgs Include="-DMONO_SHARED_LIB_NAME=$(MonoSharedLibName)" />
<_MonoCMakeArgs Include="-DCMAKE_PREFIX_PATH=$(VendoredLibraryRootPath.TrimEnd('\\'))" />
</ItemGroup>

<ItemGroup Condition="'$(HostOS)' == 'Linux' and '$(MonoEnableLLVM)' == 'true' and '$(TargetArchitecture)' != 'wasm' and '$(MonoUseLibCxx)' == 'true'">
Expand Down Expand Up @@ -773,7 +778,7 @@
</PropertyGroup>
<Message Condition="'$(_MonoSkipCMakeConfigure)' == 'true'" Text="The CMake command line is the same as the last run. Skipping running CMake configure." Importance="High"/>
<Message Condition="'$(_MonoSkipCMakeConfigure)' != 'true'" Text="Running '$(_MonoCMakeConfigureCommand)' in '$(MonoObjDir)'" Importance="High"/>
<Exec Condition="'$(_MonoSkipCMakeConfigure)' != 'true'" Command="$(_MonoCMakeConfigureCommand)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)"/>

Check failure on line 781 in src/mono/mono.proj

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux release MonoAOTOffsets)

src/mono/mono.proj#L781

src/mono/mono.proj(781,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "cmake -DENABLE_WERROR=1 -DCMAKE_INSTALL_PREFIX="/__w/1/s/artifacts/obj/mono/wasi.wasm.Release/out" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DGC_SUSPEND=preemptive -DMONO_LIB_NAME=monosgen-2.0 -DMONO_SHARED_LIB_NAME=coreclr -DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/wasi.wasm.Release/ -DENABLE_MINIMAL=jit,sgen_major_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,sgen_toggleref,sgen_debug_helpers,sgen_binary_protocol,logging,interpreter,qcalls,debugger_agent,log_dest,assert_messages,threads -DENABLE_INTERP_LIB=1 -DDISABLE_ICALL_TABLES=1 -DENABLE_ICALL_EXPORT=1 -DENABLE_LAZY_GC_THREAD_CREATION=1 -DENABLE_WEBCIL=1 -DFEATURE_PERFTRACING_DISABLE_PERFTRACING_LISTEN_PORTS=1 -DFEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT=1 -DFEATURE_PERFTRACING_DISABLE_CONNECT_PORTS=1 -DFEATURE_PERFTRACING_DISABLE_THREADS=1 -DSTATIC_COMPONENTS=1 -DMONO_COMPONENTS_RID=wasi-wasm -DCLR_CMAKE_HOST_ARCH=x64 -DCMAKE_C_FLAGS=" -I/__w/1/s/src/mono/wasi/include -I/__w/1/s/src/mono/wasi/mono-include -I/__w/1/s/src/native/public -I/__w/1/s/src/mono/mono/eglib -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -D_WASI_EMULATED_PTHREAD" -DCMAKE_CXX_FLAGS=" " "/__w/1/s/src/mono" -DWASI_SDK_PREFIX=/__w/1/s/src/mono/wasi/wasi-sdk/ -DCMAKE_SYSROOT=/__w/1/s/src/mono/wasi/wasi-sdk/share/wasi-sysroot -DCMAKE_TOOLCHAIN_FILE=/__w/1/s/src/mono/wasi/wasi-sdk//share/cmake/wasi-sdk-p2.cmake -DCMAKE_CXX_FLAGS="--sysroot=/__w/1/s/src/mono/wasi/wasi-sdk/share/wasi-sysroot"" exited with code 1.

Check failure on line 781 in src/mono/mono.proj

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux release MonoAOTOffsets)

src/mono/mono.proj#L781

src/mono/mono.proj(781,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "bash -c 'source /__w/1/s/src/mono/browser/emsdk/emsdk_env.sh 2>&1 && emcmake cmake -DENABLE_WERROR=1 -DCMAKE_INSTALL_PREFIX="/__w/1/s/artifacts/obj/mono/browser.wasm.Release/out" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DGC_SUSPEND=preemptive -DMONO_LIB_NAME=monosgen-2.0 -DMONO_SHARED_LIB_NAME=monosgen-2.0 -DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/browser.wasm.Release/ -DENABLE_MINIMAL=jit,sgen_major_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,sgen_toggleref,sgen_debug_helpers,sgen_binary_protocol,logging,interpreter,qcalls,debugger_agent,log_dest,assert_messages,threads -DENABLE_INTERP_LIB=1 -DDISABLE_ICALL_TABLES=1 -DENABLE_ICALL_EXPORT=1 -DENABLE_LAZY_GC_THREAD_CREATION=1 -DENABLE_WEBCIL=1 -DENABLE_LLVM_RUNTIME=1 -DEMSCRIPTEN_SYSTEM_PROCESSOR=wasm -DFEATURE_PERFTRACING_PAL_WS=1 -DFEATURE_PERFTRACING_DISABLE_PERFTRACING_LISTEN_PORTS=1 -DFEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT=1 -DFEATURE_PERFTRACING_DISABLE_THREADS=1 -DSTATIC_COMPONENTS=1 -DMONO_COMPONENTS_RID=browser-wasm -DCLR_CMAKE_HOST_ARCH=x64 -DCMAKE_C_FLAGS=" " -DCMAKE_CXX_FLAGS=" " "/__w/1/s/src/mono"'" exited with code 1.
<WriteLinesToFile
Condition="'$(_MonoSkipCMakeConfigure)' != 'true'"
File="$(MonoObjDir)cmake_cmd_line.txt"
Expand All @@ -794,6 +799,10 @@
<AotHostOS Condition="'$(AotHostOS)' == ''">$(HostOS)</AotHostOS>
</PropertyGroup>

<ItemGroup>
<MonoAOTCMakeArgs Include="-DCMAKE_PREFIX_PATH=$(VendoredLibraryRootPath.TrimEnd('\\'))" />
</ItemGroup>

<!-- iOS/tvOS specific options -->
<PropertyGroup Condition="'$(TargetstvOS)' == 'true' or '$(TargetsiOS)' == 'true'">
<!-- FIXME: Disable for simulator -->
Expand Down Expand Up @@ -1016,7 +1025,7 @@
</PropertyGroup>
<Message Condition="'$(_MonoSkipAotCMakeConfigure)' == 'true'" Text="The AOT Cross CMake command line is the same as the last run. Skipping running CMake configure." Importance="High"/>
<Message Condition="'$(_MonoSkipAotCMakeConfigure)' != 'true'" Text="Running '$(_MonoAotCMakeConfigureCommand)' in '$(MonoObjCrossDir)'" Importance="High"/>
<Exec Condition="'$(_MonoSkipAotCMakeConfigure)' != 'true'" Command="$(_MonoAotCMakeConfigureCommand)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjCrossDir)"/>

Check failure on line 1028 in src/mono/mono.proj

View check run for this annotation

Azure Pipelines / runtime (Build android-arm Release AllSubsets_Mono)

src/mono/mono.proj#L1028

src/mono/mono.proj(1028,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "sh -c 'build_arch="arm" ROOTFS_DIR="" compiler="clang" . "/__w/1/s/eng/common/native/init-compiler.sh" && cmake -DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/android.arm.Release/ -DMONO_SET_RPATH_ORIGIN=true -DAOT_TARGET_TRIPLE=armv7-none-linux-androideabi -DCMAKE_INSTALL_PREFIX=/__w/1/s/artifacts/obj/mono/android.arm.Release/cross/out -DCMAKE_BUILD_TYPE=Release -DENABLE_MINIMAL= -DENABLE_ICALL_SYMBOL_MAP=1 -DDISABLE_SHARED_LIBS=1 -DDISABLE_LIBS=1 -DAOT_COMPONENTS=1 -DSTATIC_COMPONENTS=1 -DAOT_OFFSETS_FILE="/__w/1/s/src/mono/mono/offsets/armv7-none-linux-androideabi.h" -DLLVM_PREFIX=/__w/1/s/artifacts/obj/mono/android.arm.Release/llvm//x64 -DCMAKE_C_FLAGS=" -Wl,--build-id=sha1" -DCMAKE_CXX_FLAGS=" -I/__w/1/s/artifacts/obj/mono/android.arm.Release/llvm//x64/include/c++/v1 -L/__w/1/s/artifacts/obj/mono/android.arm.Release/llvm//x64/lib -stdlib=libc++ -Wl,--build-id=sha1" -DGC_SUSPEND=hybrid -DMONO_CROSS_COMPILE_EXECUTABLE_NAME=1 "/__w/1/s/src/mono"'" exited with code 1.

Check failure on line 1028 in src/mono/mono.proj

View check run for this annotation

Azure Pipelines / runtime (Build android-arm64 Release AllSubsets_Mono)

src/mono/mono.proj#L1028

src/mono/mono.proj(1028,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "sh -c 'build_arch="arm64" ROOTFS_DIR="" compiler="clang" . "/__w/1/s/eng/common/native/init-compiler.sh" && cmake -DCMAKE_PREFIX_PATH=/__w/1/s/artifacts/bin/native/external/android.arm64.Release/ -DMONO_SET_RPATH_ORIGIN=true -DAOT_TARGET_TRIPLE=aarch64-v8a-linux-android -DCMAKE_INSTALL_PREFIX=/__w/1/s/artifacts/obj/mono/android.arm64.Release/cross/out -DCMAKE_BUILD_TYPE=Release -DENABLE_MINIMAL= -DENABLE_ICALL_SYMBOL_MAP=1 -DDISABLE_SHARED_LIBS=1 -DDISABLE_LIBS=1 -DAOT_COMPONENTS=1 -DSTATIC_COMPONENTS=1 -DAOT_OFFSETS_FILE="/__w/1/s/src/mono/mono/offsets/aarch64-v8a-linux-android.h" -DLLVM_PREFIX=/__w/1/s/artifacts/obj/mono/android.arm64.Release/llvm//x64 -DCMAKE_C_FLAGS=" -Wl,--build-id=sha1" -DCMAKE_CXX_FLAGS=" -I/__w/1/s/artifacts/obj/mono/android.arm64.Release/llvm//x64/include/c++/v1 -L/__w/1/s/artifacts/obj/mono/android.arm64.Release/llvm//x64/lib -stdlib=libc++ -Wl,--build-id=sha1" -DGC_SUSPEND=hybrid -DMONO_CROSS_COMPILE_EXECUTABLE_NAME=1 "/__w/1/s/src/mono"'" exited with code 1.
<WriteLinesToFile
Condition="'$(_MonoSkipAotCMakeConfigure)' != 'true'"
File="$(MonoObjCrossDir)cmake_cmd_line.txt"
Expand All @@ -1025,7 +1034,7 @@

<!-- build -->
<Message Text="Running '$(_MonoAotCMakeBuildCommand)' in '$(MonoObjCrossDir)'" Importance="High" />
<Exec Condition="'$(MonoGenerateOffsetsOSGroups)' == ''" Command="$(_MonoAotCMakeBuildCommand)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjCrossDir)"/>

Check failure on line 1037 in src/mono/mono.proj

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 debug Mono_Runtime)

src/mono/mono.proj#L1037

src/mono/mono.proj(1037,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command " cmake --build . --target install --config Debug" exited with code 1.
</Target>

<PropertyGroup>
Expand Down
7 changes: 1 addition & 6 deletions src/mono/mono/eventpipe/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ if(ENABLE_PERFTRACING)
target_sources(ep-test PRIVATE "${mono-components-objects}")

set(EPTEST_LINKABLE_LIBS "")
list(APPEND EPTEST_LINKABLE_LIBS eglib_api monosgen-static ${OS_LIBS} ${LLVM_LIBS} monoapi)
if (CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND EPTEST_LINKABLE_LIBS ${EPTEST_LINKABLE_LIBS} ${Z_LIBS})
else()
list(APPEND EPTEST_LINKABLE_LIBS ${EPTEST_LINKABLE_LIBS} zlib)
endif()
list(APPEND EPTEST_LINKABLE_LIBS eglib_api monosgen-static ${OS_LIBS} ${LLVM_LIBS} monoapi ${Z_LIBS})
target_link_libraries(ep-test PRIVATE ${EPTEST_LINKABLE_LIBS})

install_with_stripped_symbols(ep-test TARGETS bin)
Expand Down
6 changes: 0 additions & 6 deletions src/mono/mono/metadata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ if(HOST_WIN32 AND NOT DISABLE_SHARED_LIBS)

set(METADATAOBJECTSSHARED_LINKABLE_LIBS "")
list(APPEND METADATAOBJECTSSHARED_LINKABLE_LIBS monoapi eglib_api utils_objects_shared)
if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND METADATAOBJECTSSHARED_LINKABLE_LIBS zlib)
endif()
target_link_libraries(metadata_objects_shared PRIVATE ${METADATAOBJECTSSHARED_LINKABLE_LIBS})

# note: metadata_objects is an object library, so this doesn't force linking with sgen,
Expand All @@ -222,9 +219,6 @@ target_compile_definitions(metadata_objects PRIVATE ${metadata_compile_definitio

set(METADATAOBJECTS_LINKABLE_LIBS "")
list(APPEND METADATAOBJECTS_LINKABLE_LIBS monoapi eglib_api utils_objects)
if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND METADATAOBJECTS_LINKABLE_LIBS zlib)
endif()
target_link_libraries(metadata_objects PRIVATE ${METADATAOBJECTS_LINKABLE_LIBS})

# note: metadata_objects is an object library, so this doesn't force linking with sgen,
Expand Down
33 changes: 3 additions & 30 deletions src/mono/mono/mini/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,6 @@ add_library(monosgen-objects OBJECT "${monosgen-sources}")

set(MONOSGEN_OBJECTS_LINKABLE_LIBS "")
list(APPEND MONOSGEN_OBJECTS_LINKABLE_LIBS monoapi eglib_api utils_objects sgen_objects metadata_objects)
if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND MONOSGEN_OBJECTS_LINKABLE_LIBS zlib)
endif()
target_link_libraries (monosgen-objects PRIVATE ${MONOSGEN_OBJECTS_LINKABLE_LIBS})

if(NOT HOST_WIN32)
Expand Down Expand Up @@ -365,9 +362,6 @@ if(NOT DISABLE_SHARED_LIBS)

set(MONOSGENSHARED_LINKABLE_LIBS "")
list(APPEND MONOSGENSHARED_LINKABLE_LIBS monoapi eglib_objects dn-containers)
if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND MONOSGENSHARED_LINKABLE_LIBS zlib)
endif()
if(HOST_WIN32)
list(APPEND MONOSGENSHARED_LINKABLE_LIBS utils_objects_shared sgen_objects_shared metadata_objects_shared minipal)
target_link_libraries(monosgen-shared PRIVATE ${MONOSGENSHARED_LINKABLE_LIBS})
Expand All @@ -383,12 +377,7 @@ if(NOT DISABLE_SHARED_LIBS)
endif()

set(MONOSGENSHARED_LINKABLE_EXTRALIBS "")
list(APPEND MONOSGENSHARED_LINKABLE_EXTRALIBS ${OS_LIBS} ${LLVM_LIBS})
if (CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND MONOSGENSHARED_LINKABLE_EXTRALIBS ${Z_LIBS})
else()
list(APPEND MONOSGENSHARED_LINKABLE_EXTRALIBS zlib)
endif()
list(APPEND MONOSGENSHARED_LINKABLE_EXTRALIBS ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS})
target_link_libraries(monosgen-shared PRIVATE ${MONOSGENSHARED_LINKABLE_EXTRALIBS})

if(TARGET_DARWIN)
Expand Down Expand Up @@ -437,18 +426,10 @@ if(NOT DISABLE_SHARED_LIBS)

set(FRAMEWORKCONFIG_LINKABLE_LIBS "")
list(APPEND FRAMEWORKCONFIG_LINKABLE_LIBS monoapi eglib_objects utils_objects sgen_objects metadata_objects dn-containers minipal)
if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND FRAMEWORKCONFIG_LINKABLE_LIBS zlib)
endif()
target_link_libraries(${frameworkconfig} PRIVATE ${FRAMEWORKCONFIG_LINKABLE_LIBS})

set(FRAMEWORKCONFIG_LINKABLE_EXTRALIBS "")
list(APPEND FRAMEWORKCONFIG_LINKABLE_EXTRALIBS ${OS_LIBS} ${LLVM_LIBS})
if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND FRAMEWORKCONFIG_LINKABLE_EXTRALIBS zlib)
else()
list(APPEND FRAMEWORKCONFIG_LINKABLE_EXTRALIBS ${Z_LIBS})
endif()
list(APPEND FRAMEWORKCONFIG_LINKABLE_EXTRALIBS ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS})
target_link_libraries(${frameworkconfig} PRIVATE ${FRAMEWORKCONFIG_LINKABLE_EXTRALIBS})

set_property(TARGET ${frameworkconfig} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-compatibility_version -Wl,2.0 -Wl,-current_version -Wl,2.0")
Expand Down Expand Up @@ -568,22 +549,14 @@ if(NOT DISABLE_EXECUTABLES)

set(MONOSGEN_LINKABLE_LIBS "")
list(APPEND MONOSGEN_LINKABLE_LIBS monoapi eglib_api monosgen-static dn-containers)
if (NOT CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND MONOSGEN_LINKABLE_LIBS zlib)
endif()
target_link_libraries(mono-sgen PRIVATE ${MONOSGEN_LINKABLE_LIBS})

if (HOST_WASM)
target_link_libraries(mono-sgen PRIVATE mono-wasm-nosimd)
endif()

set(MONOSGEN_LINKABLE_EXTRALIBS "")
list(APPEND MONOSGEN_LINKABLE_EXTRALIBS ${OS_LIBS} ${LLVM_LIBS})
if (CLR_CMAKE_USE_SYSTEM_ZLIB)
list(APPEND MONOSGEN_LINKABLE_EXTRALIBS ${Z_LIBS})
else()
list(APPEND MONOSGEN_LINKABLE_EXTRALIBS zlib)
endif()
list(APPEND MONOSGEN_LINKABLE_EXTRALIBS ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS})
target_link_libraries(mono-sgen PRIVATE ${MONOSGEN_LINKABLE_EXTRALIBS})

# musl-libc implements ucontext in a different library on s390x
Expand Down
12 changes: 2 additions & 10 deletions src/mono/mono/profiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ if(NOT DISABLE_LIBS)
install(TARGETS mono-profiler-log-static LIBRARY)

if(NOT DISABLE_LOG_PROFILER_GZ)
if (CLR_CMAKE_USE_SYSTEM_ZLIB)
target_link_libraries(mono-profiler-log PRIVATE ${Z_LIBS})
else()
target_link_libraries(mono-profiler-log PRIVATE zlib)
endif()
target_link_libraries(mono-profiler-log PRIVATE ${Z_LIBS})
endif()
endif()

Expand All @@ -55,11 +51,7 @@ if(NOT DISABLE_LIBS)
install(TARGETS mono-profiler-log-static LIBRARY)

if(NOT DISABLE_LOG_PROFILER_GZ)
if (CLR_CMAKE_USE_SYSTEM_ZLIB)
target_link_libraries(mono-profiler-log-static PRIVATE ${Z_LIBS})
else()
target_link_libraries(mono-profiler-log-static PRIVATE zlib)
endif()
target_link_libraries(mono-profiler-log-static PRIVATE ${Z_LIBS})
endif()
endif()
endif()
10 changes: 1 addition & 9 deletions src/native/corehost/apphost/static/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ if(CLR_CMAKE_TARGET_WIN32)
delayimp.lib
)

# additional requirements for System.IO.Compression.Native
include(${CLR_SRC_NATIVE_DIR}/libs/System.IO.Compression.Native/extra_libs.cmake)
append_extra_compression_libs(NATIVE_LIBS)

set(RUNTIMEINFO_LIB runtimeinfo)

else()
Expand Down Expand Up @@ -195,15 +191,11 @@ else()
LIST(APPEND NATIVE_LIBS
eventprovider
)
endif(FEATURE_EVENT_TRACE)
endif(FEATURE_EVENT_TRACE)
LIST(APPEND NATIVE_LIBS
nativeresourcestring
)

# additional requirements for System.IO.Compression.Native
include(${CLR_SRC_NATIVE_DIR}/libs/System.IO.Compression.Native/extra_libs.cmake)
append_extra_compression_libs(NATIVE_LIBS)

if (NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) # no gssapi on tvOS, see https://developer.apple.com/documentation/gss
# Additional requirements for System.Net.Security.Native
include(${CLR_SRC_NATIVE_DIR}/libs/System.Net.Security.Native/extra_libs.cmake)
Expand Down
1 change: 1 addition & 0 deletions src/native/corehost/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ if /i [%1] == [rootDir] (set __rootDir=%2&&shift&&shift&goto Arg_Loop)
if /i [%1] == [msbuild] (set __Ninja=0)
if /i [%1] == [runtimeflavor] (set __RuntimeFlavor=%2&&shift&&shift&goto Arg_Loop)
if /i [%1] == [runtimeconfiguration] (set __RuntimeConfiguration=%2&&shift&&shift&goto Arg_Loop)
if /i [%1] == [-cmakeargs] (set __ExtraCmakeParams=%__ExtraCmakeParams% %2&shift&shift&goto Arg_Loop)
if /i [%1] == [-fsanitize] ( set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCLR_CMAKE_ENABLE_SANITIZERS=%2"&&shift&&shift&goto Arg_Loop)

shift
Expand Down
15 changes: 10 additions & 5 deletions src/native/corehost/corehost.proj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@
<!-- Global location for version files -->
<NativeVersionFile Condition="$([MSBuild]::IsOsPlatform(Windows))">$(ArtifactsObjDir)_version.h</NativeVersionFile>
<NativeVersionFile Condition="!$([MSBuild]::IsOsPlatform(Windows)) or '$(TargetsAndroid)' == 'true'">$(ArtifactsObjDir)_version.c</NativeVersionFile>
<PrefixPathArg>-cmakeargs "-DCMAKE_PREFIX_PATH=$(VendoredLibraryRootPath.TrimEnd('\\'))"</PrefixPathArg>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)/src/native/external/vendored-libs.proj" />
</ItemGroup>

<Target Name="CopySingleFileHost" AfterTargets="Build">

<PropertyGroup>
Expand Down Expand Up @@ -54,7 +59,7 @@

<_CoreHostUnixTargetOS>$(TargetOS)</_CoreHostUnixTargetOS>
<_CoreHostUnixTargetOS Condition="'$(TargetsLinuxBionic)' == 'true'">linux-bionic</_CoreHostUnixTargetOS>
<BuildArgs>$(Configuration) $(TargetArchitecture) -commithash "$([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A'))" -os $(_CoreHostUnixTargetOS)</BuildArgs>
<BuildArgs>$(Configuration) $(TargetArchitecture) -commithash "$([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A'))" -os $(_CoreHostUnixTargetOS) $(PrefixPathArg)</BuildArgs>
<BuildArgs>$(BuildArgs) -cmakeargs "-DVERSION_FILE_PATH=$(NativeVersionFile)"</BuildArgs>
</PropertyGroup>
<PropertyGroup Condition="'$(CxxStandardLibrary)' != ''">
Expand Down Expand Up @@ -91,8 +96,8 @@
<Exec Command="&quot;$(BuildScript)&quot; $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
</Target>

<!--
This is a workaround when cross-compiling on Windows for Android.
<!--
This is a workaround when cross-compiling on Windows for Android.

https://github.com/dotnet/arcade/issues/15496
-->
Expand All @@ -106,7 +111,7 @@
<NativeVersionFile>$(ArtifactsObjDir)_version.c</NativeVersionFile>
</PropertyGroup>
</Target>

<Target Name="BuildCoreHostWindows"
Condition="'$(TargetOS)' == 'windows'"
AfterTargets="Build"
Expand Down Expand Up @@ -147,7 +152,7 @@
<PropertyGroup>
<BuildScript>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', 'build.cmd'))</BuildScript>

<BuildArgs>$(Configuration) $(TargetArchitecture) commit $([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A')) outputrid $(OutputRID)</BuildArgs>
<BuildArgs>$(Configuration) $(TargetArchitecture) commit $([MSBuild]::ValueOrDefault('$(SourceRevisionId)', 'N/A')) outputrid $(OutputRID) $(PrefixPathArg)</BuildArgs>
<BuildArgs Condition="'$(ConfigureOnly)' == 'true'">$(BuildArgs) configureonly</BuildArgs>
<BuildArgs Condition="'$(PortableBuild)' == 'true'">$(BuildArgs) portable</BuildArgs>
<BuildArgs Condition="'$(IncrementalNativeBuild)' == 'true'">$(BuildArgs) incremental-native-build</BuildArgs>
Expand Down
15 changes: 15 additions & 0 deletions src/native/external/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project>
<Import Project="..\..\..\Directory.Build.props" />
<ItemGroup Condition="'$(HostOS)' == 'windows'">
<CFlag Include="/guard:cf" />
<CFlag Include="/guard:ehcont" />
<CMakeArg Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'" Include="-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug" />
<CMakeArg Condition="'$(Configuration)' == 'Release'" Include="-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded" />
</ItemGroup>
<ItemGroup Condition="'$(HostOS)' == 'windows'">
<LDFlag Include="/guard:ehcont" />
</ItemGroup>
<ItemGroup>
<CMakeArg Include="-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=1" Condition="'$(BuildFlavor)' != 'NOIPO'" />
</ItemGroup>
</Project>
Loading
Loading