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

Upgrade to CMake 3.26 #103088

Closed
wants to merge 7 commits into from
Closed
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
4 changes: 2 additions & 2 deletions docs/workflow/requirements/linux-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Minimum RAM required to build is 1GB. The build is known to fail on 512 MB VMs (

Install the following packages for the toolchain:

* CMake 3.20 or newer
* CMake 3.26 or newer
* llvm
* lld
* clang
Expand All @@ -48,7 +48,7 @@ python-is-python3 curl git lldb libicu-dev liblttng-ust-dev \
libssl-dev libkrb5-dev zlib1g-dev ninja-build
```

**NOTE**: As of now, Ubuntu's `apt` only has until CMake version 3.16.3 if you're using Ubuntu 20.04 LTS (less in older Ubuntu versions), and version 3.18.4 in Debian 11 (less in older Debian versions). This is lower than the required 3.20, which in turn makes it incompatible with the repo. For this case, we can use the `snap` package manager or the _Kitware APT feed_ to get a new enough version of CMake.
**NOTE**: As of now, Ubuntu's `apt` only has until CMake version 3.22 if you're using Ubuntu 22.04 LTS (less in older Ubuntu versions), and version 3.25.1 in Debian 12 (less in older Debian versions). This is lower than the required 3.26, which in turn makes it incompatible with the repo. For this case, we can use the `snap` package manager or the _Kitware APT feed_ to get a new enough version of CMake.

For snap:

Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/requirements/macos-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Building _dotnet/runtime_ depends on several tools to be installed. You can down

Install the following packages:

* CMake 3.20 or newer
* CMake 3.26 or newer
* icu4c
* [email protected] or openssl@3
* pkg-config
Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/requirements/windows-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ These steps are required only in case the tools have not been installed as Visua
* Install [CMake](https://cmake.org/download) for Windows.
* Add its location (e.g. C:\Program Files (x86)\CMake\bin) to the PATH environment variable. The installation script has a check box to do this, but you can do it yourself after the fact following the instructions at [Adding to the Default PATH variable](#adding-to-the-default-path-variable).

The _dotnet/runtime_ repository requires using CMake 3.20 or newer.
The _dotnet/runtime_ repository requires using CMake 3.26 or newer.

**NOTE**: If you plan on using the `-msbuild` flag for building the repo, you will need version 3.21 at least. This is because the VS2022 generator doesn't exist in CMake until said version.

Expand Down
56 changes: 18 additions & 38 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ if (MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /sourcelink:${CLR_SOURCELINK_FILE_PATH}")
endif(EXISTS ${CLR_SOURCELINK_FILE_PATH})

# enable $<LINK_GROUP:RESCAN> on MSVC as a no-op
set(CMAKE_LINK_GROUP_USING_RESCAN "" "")
set(CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED ON)

if (CMAKE_GENERATOR MATCHES "^Visual Studio.*$")
# Debug build specific flags
# The Ninja generator doesn't appear to have the default `/INCREMENTAL:ON` that
Expand Down Expand Up @@ -881,7 +885,9 @@ if (MSVC)
# Set Warning Level 4:
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/w44177>) # Pragma data_seg s/b at global scope.

add_compile_options($<$<COMPILE_LANGUAGE:C,CXX,ASM_MASM>:/Zi>) # enable debugging information
# enable debugging information.
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT ProgramDatabase)

add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/ZH:SHA_256>) # use SHA256 for generating hashes of compiler processed source files.
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/source-charset:utf-8>) # Force MSVC to compile source as UTF-8.

Expand Down Expand Up @@ -974,45 +980,19 @@ endif()

# Ensure other tools are present
if (CLR_CMAKE_HOST_WIN32)
if(CLR_CMAKE_HOST_ARCH_ARM)

# Explicitly specify the assembler to be used for Arm32 compile
file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm\\armasm.exe" CMAKE_ASM_COMPILER)

set(CMAKE_ASM_MASM_COMPILER ${CMAKE_ASM_COMPILER})
message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}")

# Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly
# use ml[64].exe as the assembler.
enable_language(ASM)
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -g <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")

elseif(CLR_CMAKE_HOST_ARCH_ARM64)

# Explicitly specify the assembler to be used for Arm64 compile
file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm64\\armasm64.exe" CMAKE_ASM_COMPILER)

set(CMAKE_ASM_MASM_COMPILER ${CMAKE_ASM_COMPILER})
message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}")

# Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly
# use ml[64].exe as the assembler.
enable_language(ASM)
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -g <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
if(CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: we have removed support for Windows ARM32

enable_language(ASM_MARMASM)
# CMake before 3.29 passes defines down to the Microsoft ARMASM compiler, which is not supported.
# We need to remove the defines from the command line.
set(CMAKE_ASM_MARMASM_COMPILE_OBJECT "<CMAKE_ASM_MARMASM_COMPILER> <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
# Add debug info options here as we can't specify separate debug info formats through the CMake abstraction
# and -g in MARMASM is technically Embedded mode (which we don't want for our C or C++ code)
add_compile_options($<$<COMPILE_LANGUAGE:ASM_MARMASM>:-g>)
else()
enable_language(ASM_MASM)
set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
# Add debug info options here as we can't specify separate debug info formats through the CMake abstraction
# and /Zi in MASM is technically Embedded mode (which we don't want for our C or C++ code)
add_compile_options($<$<COMPILE_LANGUAGE:ASM_MASM>:/Zi>)
endif()

# Ensure that MC is present
Expand Down
14 changes: 3 additions & 11 deletions eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,9 @@ if(CLR_CMAKE_HOST_OS STREQUAL linux)
set(CLR_CMAKE_HOST_LINUX 1)

# Detect Linux ID
set(LINUX_ID_FILE "/etc/os-release")
if(CMAKE_CROSSCOMPILING)
set(LINUX_ID_FILE "${CMAKE_SYSROOT}${LINUX_ID_FILE}")
endif()

if(EXISTS ${LINUX_ID_FILE})
execute_process(
COMMAND bash -c "source ${LINUX_ID_FILE} && echo \$ID"
OUTPUT_VARIABLE CLR_CMAKE_LINUX_ID
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
# In cross-building scenarios,
# cmake_host_system_information looks in the sysroot for the /etc/os-release file.
cmake_host_system_information(RESULT CLR_CMAKE_LINUX_ID QUERY DISTRIB_ID)

if(DEFINED CLR_CMAKE_LINUX_ID)
if(CLR_CMAKE_LINUX_ID STREQUAL tizen)
Expand Down
38 changes: 1 addition & 37 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 @@ -276,42 +276,6 @@ function(set_exports_linker_option exports_filename)
endif()
endfunction()

# compile_asm(TARGET target ASM_FILES file1 [file2 ...] OUTPUT_OBJECTS [variableName])
# CMake does not support the ARM or ARM64 assemblers on Windows when using the
# MSBuild generator. When the MSBuild generator is in use, we manually compile the assembly files
# using this function.
function(compile_asm)
set(options "")
set(oneValueArgs TARGET OUTPUT_OBJECTS)
set(multiValueArgs ASM_FILES)
cmake_parse_arguments(COMPILE_ASM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGV})

get_include_directories_asm(ASM_INCLUDE_DIRECTORIES)

set (ASSEMBLED_OBJECTS "")

foreach(ASM_FILE ${COMPILE_ASM_ASM_FILES})
get_filename_component(name ${ASM_FILE} NAME_WE)
# Produce object file where CMake would store .obj files for an OBJECT library.
# ex: artifacts\obj\coreclr\windows.arm64.Debug\src\vm\wks\cee_wks.dir\Debug\AsmHelpers.obj
set (OBJ_FILE "${CMAKE_CURRENT_BINARY_DIR}/${COMPILE_ASM_TARGET}.dir/${CMAKE_CFG_INTDIR}/${name}.obj")

# Need to compile asm file using custom command as include directories are not provided to asm compiler
add_custom_command(OUTPUT ${OBJ_FILE}
COMMAND "${CMAKE_ASM_COMPILER}" -g ${ASM_INCLUDE_DIRECTORIES} -o ${OBJ_FILE} ${ASM_FILE}
DEPENDS ${ASM_FILE}
COMMENT "Assembling ${ASM_FILE} ---> \"${CMAKE_ASM_COMPILER}\" -g ${ASM_INCLUDE_DIRECTORIES} -o ${OBJ_FILE} ${ASM_FILE}")

# mark obj as source that does not require compile
set_source_files_properties(${OBJ_FILE} PROPERTIES EXTERNAL_OBJECT TRUE)

# Add the generated OBJ in the dependency list so that it gets consumed during linkage
list(APPEND ASSEMBLED_OBJECTS ${OBJ_FILE})
endforeach()

set(${COMPILE_ASM_OUTPUT_OBJECTS} ${ASSEMBLED_OBJECTS} PARENT_SCOPE)
endfunction()

# add_component(componentName [targetName] [EXCLUDE_FROM_ALL])
function(add_component componentName)
if (${ARGC} GREATER 2 OR ${ARGC} EQUAL 2)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.26)

# Set the project name
project(CoreCLR)
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/debug/di/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ if(CLR_CMAKE_HOST_WIN32)
if ((CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64) AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD)
convert_to_absolute_path(CORDBDI_SOURCES_ASM_FILE ${CORDBDI_SOURCES_ASM_FILE})
preprocess_files(CORDBDI_SOURCES_ASM_FILE ${CORDBDI_SOURCES_ASM_FILE})
if (CMAKE_GENERATOR MATCHES "Visual Studio")
compile_asm(TARGET cordbdi ASM_FILES ${CORDBDI_SOURCES_ASM_FILE} OUTPUT_OBJECTS CORDBDI_SOURCES_ASM_FILE)
endif()
endif()
elseif(CLR_CMAKE_HOST_UNIX)

Expand Down
6 changes: 1 addition & 5 deletions src/coreclr/debug/ee/wks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ if (CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64 OR CLR_CMAKE_HOST_ARCH_LOONGARCH64)
preprocess_files(ASM_FILE ${ASM_FILE})

if (CMAKE_GENERATOR MATCHES "Visual Studio")
compile_asm(TARGET cordbee_wks ASM_FILES ${ASM_FILE} OUTPUT_OBJECTS ASM_OBJECTS)
endif()

add_library_clr(cordbee_wks OBJECT ${CORDBEE_SOURCES_WKS} ${ASM_FILE} ${ASM_OBJECTS})

else ()
set(ASM_OPTIONS /c /Zi /W3 /errorReport:prompt)
set(ASM_OPTIONS /c /W3 /errorReport:prompt)

if (CLR_CMAKE_HOST_ARCH_I386)
list (APPEND ASM_OPTIONS /safeseh)
Expand Down
36 changes: 5 additions & 31 deletions src/coreclr/dlls/mscordac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ if(CLR_CMAKE_HOST_WIN32)

# Create target to add file dependency on mscordac.def
add_custom_target(mscordaccore_def DEPENDS ${CURRENT_BINARY_DIR_FOR_CONFIG}/mscordac.def)

# No library groups for Win32
set(START_LIBRARY_GROUP)
set(END_LIBRARY_GROUP)
else(CLR_CMAKE_HOST_WIN32)
set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mscordac_unixexports.src)
set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/mscordac.exports)
Expand Down Expand Up @@ -84,15 +80,6 @@ else(CLR_CMAKE_HOST_WIN32)
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")

# The following linked options can be inserted into the linker libraries list to
# ensure proper resolving of circular references between a subset of the libraries.
set(START_LIBRARY_GROUP -Wl,--start-group)
set(END_LIBRARY_GROUP -Wl,--end-group)

# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -Wl,--whole-archive)
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_HAIKU)

set_exports_linker_option(${EXPORTS_FILE})
Expand Down Expand Up @@ -120,20 +107,10 @@ endif(CLR_CMAKE_HOST_UNIX)
# order dependent and changing the order can result in undefined symbols in the shared
# library.
set(COREDAC_LIBRARIES
${START_LIBRARY_GROUP} # Start group of libraries that have circular references
cee_dac
cordbee_dac
${START_WHOLE_ARCHIVE} # force all exports to be available
corguids
daccess
${END_WHOLE_ARCHIVE}
dbgutil
mdcompiler_dac
mdruntime_dac
mdruntimerw_dac
utilcode_dac
unwinder_dac
${END_LIBRARY_GROUP} # End group of libraries that have circular references
# These libraries have circular dependencies and must be grouped together
# The libraries in the WHOLE_ARCHIVE group must have all of their symbols included in the final shared object
$<LINK_GROUP:RESCAN,cee_dac,cordbee_dac,$<LINK_LIBRARY:WHOLE_ARCHIVE,daccess>,dbgutil,mdcompiler_dac,mdruntime_dac,mdruntimerw_dac,utilcode_dac,unwinder_dac>
)

if(CLR_CMAKE_HOST_WIN32)
Expand Down Expand Up @@ -173,11 +150,8 @@ if(CLR_CMAKE_HOST_WIN32)
else(CLR_CMAKE_HOST_WIN32)
list(APPEND COREDAC_LIBRARIES
mscorrc
${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available
coreclrpal
palrt
coreclrminipal
${END_WHOLE_ARCHIVE}
# force all PAL objects to be included so all exports are available
$<LINK_LIBRARY:WHOLE_ARCHIVE,coreclrpal,palrt,coreclrminipal>
)
endif(CLR_CMAKE_HOST_WIN32)

Expand Down
23 changes: 1 addition & 22 deletions src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,8 @@ else(CLR_CMAKE_HOST_WIN32)
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
add_linker_flag("-Wl,-Bsymbolic")

# The following linked options can be inserted into the linker libraries list to
# ensure proper resolving of circular references between a subset of the libraries.
set(START_LIBRARY_GROUP -Wl,--start-group)
set(END_LIBRARY_GROUP -Wl,--end-group)

# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -Wl,--whole-archive)
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)
endif(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD OR CLR_CMAKE_TARGET_SUNOS OR CLR_CMAKE_HOST_HAIKU)

if(CLR_CMAKE_TARGET_OSX)
# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -force_load)
set(END_WHOLE_ARCHIVE )
endif(CLR_CMAKE_TARGET_OSX)

set_exports_linker_option(${EXPORTS_FILE})

if(CLR_CMAKE_TARGET_ANDROID AND CLR_CMAKE_HOST_ARCH_ARM)
Expand Down Expand Up @@ -89,12 +74,10 @@ endif (CLR_CMAKE_HOST_UNIX)
# library.
set(CORECLR_LIBRARIES
utilcode
${START_LIBRARY_GROUP} # Start group of libraries that have circular references
cordbee_wks
debug-pal
${LIB_UNWINDER}
v3binder
${END_LIBRARY_GROUP} # End group of libraries that have circular references
mdcompiler_wks
mdruntime_wks
mdruntimerw_wks
Expand Down Expand Up @@ -136,19 +119,15 @@ if(CLR_CMAKE_TARGET_WIN32)
)
else()
list(APPEND CORECLR_LIBRARIES
${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available
coreclrpal
${END_WHOLE_ARCHIVE}
$<LINK_LIBRARY:WHOLE_ARCHIVE,coreclrpal> # force all PAL objects to be included so all exports are available
mscorrc
palrt
)
endif(CLR_CMAKE_TARGET_WIN32)

if(CLR_CMAKE_TARGET_LINUX)
list(APPEND CORECLR_LIBRARIES
${START_WHOLE_ARCHIVE}
tracepointprovider
${END_WHOLE_ARCHIVE}
)
elseif(CLR_CMAKE_TARGET_SUNOS)
list(APPEND CORECLR_LIBRARIES
Expand Down
13 changes: 2 additions & 11 deletions src/coreclr/ilasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CL
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")

# The following linked options can be inserted into the linker libraries list to
# ensure proper resolving of circular references between a subset of the libraries.
set(START_LIBRARY_GROUP -Wl,--start-group)
set(END_LIBRARY_GROUP -Wl,--end-group)
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_HAIKU)

add_executable_clr(ilasm
Expand All @@ -73,12 +68,8 @@ add_executable_clr(ilasm
set(ILASM_LINK_LIBRARIES
utilcodestaticnohost
mscorpe
${START_LIBRARY_GROUP} # Start group of libraries that have circular references
mdcompiler_ppdb
mdruntime_ppdb
mdruntimerw_ppdb
mdstaticapi_ppdb
${END_LIBRARY_GROUP} # End group of libraries that have circular references
# libraries that have circular references
$<LINK_GROUP:RESCAN,mdcompiler_ppdb,mdruntime_ppdb,mdruntimerw_ppdb,mdstaticapi_ppdb>
ceefgen
corguids
)
Expand Down
11 changes: 2 additions & 9 deletions src/coreclr/ildasm/exe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ if(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CL
# This option is necessary to ensure that the overloaded delete operator defined inside
# of the utilcode will be used instead of the standard library delete operator.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic")

# The following linked options can be inserted into the linker libraries list to
# ensure proper resolving of circular references between a subset of the libraries.
set(START_LIBRARY_GROUP -Wl,--start-group)
set(END_LIBRARY_GROUP -Wl,--end-group)
endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS OR CLR_CMAKE_HOST_HAIKU)

add_executable_clr(ildasm
Expand All @@ -64,13 +59,11 @@ add_executable_clr(ildasm
)

set(ILDASM_LINK_LIBRARIES
${START_LIBRARY_GROUP} # Start group of libraries that have circular references
utilcodestaticnohost
mdcompiler_wks
mdruntime_wks
mdruntimerw_wks
mdstaticapi
${END_LIBRARY_GROUP} # End group of libraries that have circular references
# These libraries that have circular references
$<LINK_GROUP:RESCAN,utilcodestaticnohost,mdstaticapi>
corguids
)

Expand Down
Loading
Loading