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

Migrate to zlib-ng, part 2: consume it in runtime #102403

Merged
merged 39 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
fb1d1b2
Comment zlib.cmake and zlib-intel.cmake to confirm they're not being …
carlossanlop May 21, 2024
e19dc0f
Windows, Unix, MacOS and NativeAOT adjustments and workarounds for su…
carlossanlop May 22, 2024
88c2ac4
Workaround: Comment SIZEOF_DATA_PTR test due to problem when trying t…
carlossanlop May 22, 2024
4400116
Workaround: suppress build error 'W4 overriding W3'.
carlossanlop May 22, 2024
b96f889
Workaround: Make sure MacOS ignores unused CLI arguments
carlossanlop May 22, 2024
5737007
Fix HAVE_PTRDIFF_T by forcing all try_compile tests to use Release bu…
jkoritzinsky May 22, 2024
b578594
Enable CFG and fix warning levels
jkoritzinsky May 23, 2024
a4ab08c
Use the same inherited property model we're using for our other scena…
jkoritzinsky May 23, 2024
871a5cd
Specify the warning level at the directory level.
jkoritzinsky May 23, 2024
9ab7ab0
Fix the build in coreclr.
carlossanlop May 23, 2024
76a47b5
remove zlib from mono metadata target_link_library calls
carlossanlop Jun 18, 2024
e0bbfcb
Only keep zlib in mono mini in two places
carlossanlop Jun 18, 2024
f4a2802
Keep only one zlib in mono profiler
carlossanlop Jun 18, 2024
40c43b6
fix wasi and browser build
carlossanlop Jun 19, 2024
03de95b
Fix aot build
carlossanlop Jun 19, 2024
a1fd889
Add libz.a to PlatformManifestFileEntry
carlossanlop Jun 19, 2024
ccbdbca
Fix mono windows build
carlossanlop Jun 19, 2024
523577b
Replace "-lz" with "libz.a" in apple app builder templates
carlossanlop Jun 19, 2024
aa4cc34
Remove dup libz.a
carlossanlop Jun 19, 2024
a5a7565
Add missing libz.a for AppleBuild.targets
carlossanlop Jun 19, 2024
a5d1835
Replace -lz with libz.a in tasks LibraryBuilder CMakeLists template
carlossanlop Jun 19, 2024
15e4d7a
AppleBuild.targets should pass libz.a through the Bundle items
carlossanlop Jun 20, 2024
32d4d15
Use system zlib for mobile. Use this copy of zlib-ng for everything e…
carlossanlop Jun 21, 2024
c0e7fa5
Split build for mobile
carlossanlop Jun 24, 2024
e840a5d
Redefine UseSystemZlib property for NativeAOT
carlossanlop Jun 25, 2024
07b9c98
Define UseSystemZlib in AppleBuild.targets again
carlossanlop Jun 25, 2024
1e74746
Use apple pre-existing property for native.unix.targets.
carlossanlop Jun 27, 2024
6837be2
Use <zlib.h> directly in log.c and mprof-report.c
carlossanlop Jun 27, 2024
1643a1f
Use Exists to condfition UseSystemZlib
carlossanlop Jun 27, 2024
a6d84cc
MIssing single quotes
carlossanlop Jun 27, 2024
9c17349
tabs->spaces
carlossanlop Jun 27, 2024
5399b6f
Remove FUNCTIONEXPORT
carlossanlop Jun 27, 2024
24ebaba
Fix build failure in mobile due to recently added unconditioned zlib …
carlossanlop Jun 27, 2024
13aeb0f
Simplify zlib_allocator.h
carlossanlop Jun 27, 2024
f0e60d9
Fix build for linux-armv6
carlossanlop Jul 1, 2024
c5f6798
Remove unneeded definitions for ZLIB_COMPAT and INTERNAL_ZLIB_NG
carlossanlop Jul 2, 2024
e073b20
Remove unnecessary endif arguments and remove duplicate linked library
carlossanlop Jul 2, 2024
6e9a7c6
Rename INTERNAL_ZLIB_NG to CLR_CMAKE_USE_SYSTEM_ZLIB, fix some incorr…
carlossanlop Jul 2, 2024
417ea9f
Workaround: skip zlib-ng inclusion in armv6
carlossanlop Jul 2, 2024
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 Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>

<NativeBuildPartitionPropertiesToRemove>ClrFullNativeBuild;ClrRuntimeSubset;ClrJitSubset;ClrPalTestsSubset;ClrAllJitsSubset;ClrILToolsSubset;ClrNativeAotSubset;ClrSpmiSubset;ClrCrossComponentsSubset;ClrDebugSubset;HostArchitecture;PgoInstrument;NativeOptimizationDataSupported;CMakeArgs;CxxStandardLibrary;CxxStandardLibraryStatic;CxxAbiLibrary</NativeBuildPartitionPropertiesToRemove>
<UseSystemZlib Condition="'$(TargetsAppleMobile)' == 'true' or '$(TargetOS)' == 'android' or '$(TargetArchitecture)' == 'armv6'">true</UseSystemZlib>
</PropertyGroup>

<!-- RepositoryEngineeringDir isn't set when Installer tests import this file. -->
Expand Down
9 changes: 8 additions & 1 deletion eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# We need to set this to Release as there's no way to intercept configuration-specific linker flags
# for try_compile-style tests (like check_c_source_compiles) and some of the default Debug flags
# (ie. /INCREMENTAL) conflict with our own flags.
set(CMAKE_TRY_COMPILE_CONFIGURATION Release)

include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckLinkerFlag)
Expand Down Expand Up @@ -58,6 +63,7 @@ if (MSVC)
define_property(TARGET PROPERTY CLR_CONTROL_FLOW_GUARD INHERITED BRIEF_DOCS "Controls the /guard:cf flag presence" FULL_DOCS "Set this property to ON or OFF to indicate if the /guard:cf compiler and linker flag should be present")
define_property(TARGET PROPERTY CLR_EH_CONTINUATION INHERITED BRIEF_DOCS "Controls the /guard:ehcont flag presence" FULL_DOCS "Set this property to ON or OFF to indicate if the /guard:ehcont compiler flag should be present")
define_property(TARGET PROPERTY CLR_EH_OPTION INHERITED BRIEF_DOCS "Defines the value of the /EH option" FULL_DOCS "Set this property to one of the valid /EHxx options (/EHa, /EHsc, /EHa-, ...)")
define_property(TARGET PROPERTY MSVC_WARNING_LEVEL INHERITED BRIEF_DOCS "Define the warning level for the /Wn option" FULL_DOCS "Set this property to one of the valid /Wn options (/W0, /W1, /W2, /W3, /W4)")

set_property(GLOBAL PROPERTY CLR_CONTROL_FLOW_GUARD ON)

Expand Down Expand Up @@ -779,7 +785,8 @@ if (MSVC)

# [[! Microsoft.Security.SystemsADM.10086 !]] - SDL required warnings
# set default warning level to 4 but allow targets to override it.
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/W$<GENEX_EVAL:$<IF:$<BOOL:$<TARGET_PROPERTY:MSVC_WARNING_LEVEL>>,$<TARGET_PROPERTY:MSVC_WARNING_LEVEL>,4>>>)
set_property(GLOBAL PROPERTY MSVC_WARNING_LEVEL 4)
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/W$<TARGET_PROPERTY:MSVC_WARNING_LEVEL>>)
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/WX>) # treat warnings as errors
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/Oi>) # enable intrinsics
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/Oy->) # disable suppressing of the creation of frame pointers on the call stack for quicker function calls
Expand Down
6 changes: 6 additions & 0 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,9 @@ if(LOWERCASE_CMAKE_BUILD_TYPE STREQUAL debug)
string(REPLACE "-D_FORTIFY_SOURCE=2 " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "-D_FORTIFY_SOURCE=2 " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endif()

if (CLR_CMAKE_TARGET_ANDROID OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS OR CLR_CMAKE_HOST_ARCH_ARMV6)
# Our zlib-ng copy should only be used in non-mobile platforms only.
# In mobile platforms we should use the zlib package provided by the system.
set(CLR_CMAKE_USE_SYSTEM_ZLIB 1)
endif()
4 changes: 2 additions & 2 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function(preprocess_file inputFilename outputFilename)
get_compile_definitions(PREPROCESS_DEFINITIONS)
get_include_directories(PREPROCESS_INCLUDE_DIRECTORIES)
get_source_file_property(SOURCE_FILE_DEFINITIONS ${inputFilename} COMPILE_DEFINITIONS)

foreach(DEFINITION IN LISTS SOURCE_FILE_DEFINITIONS)
list(APPEND PREPROCESS_DEFINITIONS -D${DEFINITION})
endforeach()
Expand Down Expand Up @@ -508,7 +508,7 @@ function(install_static_library targetName destination component)
if (WIN32)
set_target_properties(${targetName} PROPERTIES
COMPILE_PDB_NAME "${targetName}"
COMPILE_PDB_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
COMPILE_PDB_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:${targetName}>"
)
install (FILES "$<TARGET_FILE_DIR:${targetName}>/${targetName}.pdb" DESTINATION ${destination} COMPONENT ${component})
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<LinkerFlavor Condition="'$(LinkerFlavor)' == '' and '$(_linuxLibcFlavor)' == 'bionic'">lld</LinkerFlavor>
<LinkerFlavor Condition="'$(LinkerFlavor)' == '' and '$(_targetOS)' == 'linux'">bfd</LinkerFlavor>
<IlcDefaultStackSize Condition="'$(IlcDefaultStackSize)' == '' and '$(_linuxLibcFlavor)' == 'musl'">1572864</IlcDefaultStackSize>
<UseSystemZlib Condition="!Exists('$(IlcSdkPath)libz.a')">true</UseSystemZlib>
</PropertyGroup>

<Target Name="SetupOSSpecificProps" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">
Expand Down Expand Up @@ -129,6 +130,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeLibrary Condition="'$(_targetArchitecture)' == 'x64'" Include="$(IlcSdkPath)$(VxSortSupportName)$(LibFileExt)" />
<NativeLibrary Include="$(IlcSdkPath)$(StandaloneGCSupportName)$(LibFileExt)" />
<NativeLibrary Condition="'$(LinkStandardCPlusPlusLibrary)' != 'true' and '$(StaticICULinking)' != 'true'" Include="$(IlcSdkPath)libstdc++compat.a" />
<NativeLibrary Condition="'$(UseSystemZlib)' != 'true'" Include="$(IlcSdkPath)libz.a" />
jkotas marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -188,7 +190,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeSystemLibrary Include="objc" Condition="'$(_IsApplePlatform)' == 'true'" />
<NativeSystemLibrary Include="swiftCore" Condition="'$(_targetOS)' == 'osx'" />
<NativeSystemLibrary Include="swiftFoundation" Condition="'$(_targetOS)' == 'osx'" />
<NativeSystemLibrary Include="z" />
<NativeSystemLibrary Include="z" Condition="'$(UseSystemZlib)' == 'true'" />
<NativeSystemLibrary Include="rt" Condition="'$(_IsApplePlatform)' != 'true' and '$(_linuxLibcFlavor)' != 'bionic'" />
<NativeSystemLibrary Include="log" Condition="'$(_linuxLibcFlavor)' == 'bionic'" />
<NativeSystemLibrary Include="icucore" Condition="'$(_IsApplePlatform)' == 'true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<NativeLibrary Condition="'$(_targetArchitecture)' == 'x64'" Include="$(IlcSdkPath)$(VxSortSupportName)$(LibrarySuffix)" />
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true'" Include="$(SharedLibrary)" />
<NativeLibrary Include="$(IlcSdkPath)$(StandaloneGCSupportName)$(LibrarySuffix)" />
<NativeLibrary Include="$(IlcSdkPath)zlibstatic$(LibFileExt)" />
carlossanlop marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@
<PlatformManifestFileEntry Include="libicudata.a" IsNative="true" />
<PlatformManifestFileEntry Include="libicui18n.a" IsNative="true" />
<PlatformManifestFileEntry Include="libicuuc.a" IsNative="true" />
<!-- zlib-specific files -->
<PlatformManifestFileEntry Include="libz.a" IsNative="true" />
</ItemGroup>

<ItemGroup>
Expand Down
23 changes: 12 additions & 11 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ elseif(CLR_CMAKE_HOST_OS STREQUAL "emscripten")
set(DISABLE_SHARED_LIBS 1)
# sys/random.h exists, but its not found
set(HAVE_SYS_RANDOM_H 1)
set(INTERNAL_ZLIB 1)
elseif(CLR_CMAKE_HOST_OS STREQUAL "wasi")
set(HOST_WASI 1)
add_definitions(-D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -DHOST_WASI)
Expand All @@ -261,7 +260,6 @@ elseif(CLR_CMAKE_HOST_OS STREQUAL "wasi")
add_compile_options(-Wno-unused-but-set-variable)
set(ENABLE_PERFTRACING 0)
set(DISABLE_SHARED_LIBS 1)
set(INTERNAL_ZLIB 1)
carlossanlop marked this conversation as resolved.
Show resolved Hide resolved
set(DISABLE_EXECUTABLES 1)
set(STATIC_COMPONENTS 1)
elseif(CLR_CMAKE_HOST_OS STREQUAL "windows")
Expand All @@ -270,7 +268,6 @@ elseif(CLR_CMAKE_HOST_OS STREQUAL "windows")
set(HOST_NO_SYMLINKS 1)
set(MONO_KEYWORD_THREAD "__declspec (thread)")
set(MONO_ZERO_LEN_ARRAY 1)
set(INTERNAL_ZLIB 1)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") # statically link VC runtime library
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/W4>) # set warning level 4
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/WX>) # treat warnings as errors
Expand Down Expand Up @@ -511,16 +508,15 @@ if ((HOST_MACCAT AND HOST_ARM64) OR (TARGET_MACCAT AND TARGET_ARM64))
set(TARGET_APPLE_MOBILE 1)
endif()

# Decide if we need zlib, and if so whether we want the system zlib or the in-tree copy.
# Decide if we need zlib-ng.
if(NOT DISABLE_EMBEDDED_PDB OR NOT DISABLE_LOG_PROFILER_GZ)
if(INTERNAL_ZLIB)
# defines ZLIB_SOURCES
include(${CLR_SRC_NATIVE_DIR}/external/zlib.cmake)
else()
# if we're not on a platform where we use the in-tree zlib, require system zlib
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()
endif()

Expand Down Expand Up @@ -664,12 +660,17 @@ if(LLVM_PREFIX)
endif()
set(llvm_includedir "${LLVM_PREFIX}/include")

set(llvm_system_libs "")
if(HOST_LINUX)
# llvm-config --system-libs
set(llvm_system_libs ${MONO_cxx_lib} "-lz" "-lrt" "-ldl" "-lpthread" "-lm")
list(APPEND llvm_system_libs ${MONO_cxx_lib} "-lrt" "-ldl" "-lpthread" "-lm")
elseif(HOST_OSX)
# llvm-config --system-libs
set(llvm_system_libs "-lz" "-lm")
list(APPEND llvm_system_libs "-lm")
endif()

if (CLR_CMAKE_USE_SYSTEM_ZLIB AND (HOST_LINUX OR HOST_OSX))
list(APPEND llvm_system_libs "-lz")
endif()

# llvm-config --libs analysis core bitwriter mcjit orcjit
Expand Down
1 change: 1 addition & 0 deletions src/mono/browser/browser.proj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<WasmPInvokeModule Include="libSystem.Native" />
<WasmPInvokeModule Include="libSystem.IO.Compression.Native" />
<WasmPInvokeModule Include="libSystem.Globalization.Native" />
<WasmPInvokeModule Include="libz" />
<WasmPInvokeAssembly Include="@(LibrariesRuntimeFiles)" Condition="'%(Extension)' == '.dll' and '%(IsNative)' != 'true'" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions src/mono/browser/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ target_link_libraries(dotnet.native
${MONO_ARTIFACTS_DIR}/libmono-wasm-${CONFIGURATION_INTERPSIMDTABLES_LIB}.a
${MONO_ARTIFACTS_DIR}/libmono-profiler-aot.a
${MONO_ARTIFACTS_DIR}/libmono-profiler-browser.a
${MONO_ARTIFACTS_DIR}/libz.a
${NATIVE_BIN_DIR}/wasm-bundled-timezones.a
${NATIVE_BIN_DIR}/libSystem.Native.a
${NATIVE_BIN_DIR}/libSystem.Globalization.Native.a
Expand Down
3 changes: 0 additions & 3 deletions src/mono/cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@
/* Define to 1 if you have the <unwind.h> header file. */
#cmakedefine HAVE_UNWIND_H 1

/* Use in-tree zlib */
#cmakedefine INTERNAL_ZLIB 1

/* Define to 1 if you have the <poll.h> header file. */
#cmakedefine HAVE_POLL_H 1

Expand Down
3 changes: 3 additions & 0 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,9 @@ JS_ENGINES = [NODE_JS]
<_MonoRuntimeArtifacts Condition="('$(TargetsBrowser)' == 'true' or '$(TargetsWasi)' == 'true') and '$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(MonoObjDir)out\lib\libmono-wasm-nosimd.a">
<Destination>$(RuntimeBinDir)libmono-wasm-nosimd.a</Destination>
</_MonoRuntimeArtifacts>
<_MonoRuntimeArtifacts Condition="('$(TargetsBrowser)' == 'true' or '$(TargetsWasi)' == 'true') and '$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(MonoObjDir)_deps\fetchzlibng-build\libz.a">
<Destination>$(RuntimeBinDir)libz.a</Destination>
</_MonoRuntimeArtifacts>
<_MonoICorDebugArtifacts Condition="'$(MonoMsCorDbi)' == 'true'" Include="$(MonoObjDir)out\lib\$(LibPrefix)mscordbi$(LibSuffix)">
<Destination>$(RuntimeBinDir)$(LibPrefix)mscordbi$(LibSuffix)</Destination>
</_MonoICorDebugArtifacts>
Expand Down
11 changes: 10 additions & 1 deletion src/mono/mono/eventpipe/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,16 @@ if(ENABLE_PERFTRACING)
set(CMAKE_SKIP_RPATH 1)
add_executable(ep-test ${EVENTPIPE_TEST_SOURCES} ${EVENTPIPE_TEST_HEADERS})
target_sources(ep-test PRIVATE "${mono-components-objects}")
target_link_libraries(ep-test PRIVATE eglib_api monosgen-static ${OS_LIBS} ${LLVM_LIBS} ${Z_LIBS} monoapi)
carlossanlop marked this conversation as resolved.
Show resolved Hide resolved

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()
target_link_libraries(ep-test PRIVATE ${EPTEST_LINKABLE_LIBS})

install_with_stripped_symbols(ep-test TARGETS bin)
else(ENABLE_EVENTPIPE_TEST AND STATIC_COMPONENTS AND (NOT DISABLE_COMPONENTS) AND (NOT DISABLE_LIBS) AND (NOT DISABLE_EXECUTABLES))
message(VERBOSE "Skip building native EventPipe library test runner.")
Expand Down
18 changes: 16 additions & 2 deletions src/mono/mono/metadata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,14 @@ set(metadata_sources "${metadata_platform_sources};${metadata_common_sources};${
if(HOST_WIN32 AND NOT DISABLE_SHARED_LIBS)
add_library(metadata_objects_shared OBJECT ${metadata_sources})
target_compile_definitions(metadata_objects_shared PRIVATE ${metadata_compile_definitions})
target_link_libraries(metadata_objects_shared PRIVATE monoapi eglib_api utils_objects_shared)

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,
# it just adds the relevant include directories - which we need even with Boehm
target_link_libraries(metadata_objects_shared PRIVATE sgen_objects_shared)
Expand All @@ -212,7 +219,14 @@ endif()

add_library(metadata_objects OBJECT ${metadata_sources})
target_compile_definitions(metadata_objects PRIVATE ${metadata_compile_definitions})
target_link_libraries(metadata_objects PRIVATE monoapi eglib_api utils_objects)

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,
# it just adds the relevant include directories - which we need even with Boehm
target_link_libraries(metadata_objects PRIVATE sgen_objects)
Expand Down
6 changes: 1 addition & 5 deletions src/mono/mono/metadata/debug-mono-ppdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@
#include <mono/utils/mono-logger-internals.h>

#ifndef DISABLE_EMBEDDED_PDB
#ifdef INTERNAL_ZLIB
#include <external/zlib/zlib.h>
#else
#include <zlib.h>
carlossanlop marked this conversation as resolved.
Show resolved Hide resolved
#endif
#endif
#endif // DISABLE_EMBEDDED_PDB

#include "debug-mono-ppdb.h"

Expand Down
Loading
Loading