Skip to content

Use MSVC_DEBUG_INFORMATION_FORMAT for CoreCLR object libraries#130983

Open
elinor-fung wants to merge 1 commit into
dotnet:mainfrom
elinor-fung:clr-embed-debuginfo-msvc-format
Open

Use MSVC_DEBUG_INFORMATION_FORMAT for CoreCLR object libraries#130983
elinor-fung wants to merge 1 commit into
dotnet:mainfrom
elinor-fung:clr-embed-debuginfo-msvc-format

Conversation

@elinor-fung

@elinor-fung elinor-fung commented Jul 17, 2026

Copy link
Copy Markdown
Member

Follow-up to #130933: convert the /Z7 compile options on the CoreCLR cDAC data descriptor and NativeAOT GC OBJECT libraries to the MSVC_DEBUG_INFORMATION_FORMAT Embedded target property. The property (added in CMake 3.25) is usable now that the repo minimum is 3.26.

Also remove setting COMPILE_PDB_NAME for the cDAC descriptor, since it is embedded rather than a separate PDB.

cc @MichalStrehovsky @max-charlamb @rcj1

Convert the remaining hand-rolled /Z7 compile options on the CoreCLR data

descriptor and NativeAOT GC OBJECT libraries to the MSVC_DEBUG_INFORMATION_FORMAT

Embedded target property, matching the approach used for the host object

libraries. The property (introduced in CMake 3.25) is usable now that the

repo minimum is 3.26, and keeps debug-info handling consistent across the

object libraries that ship into static libraries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c575f5c4-c35f-4fcb-9311-d65a626b8191
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates CoreCLR/NativeAOT Windows CMake build logic to use the CMake 3.25+ MSVC_DEBUG_INFORMATION_FORMAT target property (set to Embedded) instead of hand-applied /Z7 compiler options, ensuring object libraries embed CodeView debug info and avoid referencing an external vc140.pdb.

Changes:

  • Switch NativeAOT GC OBJECT libraries from target_compile_options(... /Z7) to set_target_properties(... MSVC_DEBUG_INFORMATION_FORMAT Embedded).
  • Switch the cDAC data descriptor OBJECT library from target_compile_options(... /Z7) (and prior PDB-name workaround) to MSVC_DEBUG_INFORMATION_FORMAT Embedded.
Show a summary per file
File Description
src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt Replaces /Z7 compile options with MSVC_DEBUG_INFORMATION_FORMAT Embedded for GC object libraries on Windows.
src/coreclr/clrdatadescriptors.cmake Uses MSVC_DEBUG_INFORMATION_FORMAT Embedded for the generated cDAC contract descriptor OBJECT library on MSVC builds.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread src/coreclr/clrdatadescriptors.cmake
Comment thread src/coreclr/nativeaot/Runtime/Full/CMakeLists.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants