Skip to content

[main] Source code updates from dotnet/runtime - #6423

Merged
steveisok merged 11 commits into
mainfrom
darc-main-ea1ff30c-94e0-4369-89e0-84cff2acbdd0
May 6, 2026
Merged

steveisok merged 11 commits into
mainfrom
darc-main-ea1ff30c-94e0-4369-89e0-84cff2acbdd0

Conversation

@dotnet-maestro

@dotnet-maestro dotnet-maestro Bot commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Note

This is a codeflow update. It may contain both source code changes from
the source repo
as well as dependency updates. Learn more here.

This pull request brings the following source code changes

From https://github.com/dotnet/runtime

Diff the source with this PR branch
darc vmr diff --name-only https://github.com/dotnet/runtime:055e04bbff528e950acfa0f5e56aa80c2e7929f7..https://github.com/dotnet/dotnet:darc-main-ea1ff30c-94e0-4369-89e0-84cff2acbdd0

@dotnet-maestro

dotnet-maestro Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor Author

Note

PRs from original repository included in this codeflow update:

💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance.

@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team May 2, 2026 02:10
@dotnet-maestro

dotnet-maestro Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@dotnet-maestro

dotnet-maestro Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

Note

PRs from original repository included in this codeflow update:

💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance.

@lewing

lewing commented May 5, 2026

Copy link
Copy Markdown
Member

@max-charlamb I think this is failing due dotnet/runtime#126972

@lewing

lewing commented May 5, 2026

Copy link
Copy Markdown
Member

🤖 From Copilot:

Culprit: PR dotnet/runtime#126972 — "[NativeAOT] Add cDAC data descriptor infrastructure" (commit e883467e, merged
2026-05-01 by @max-charlamb).

That PR is the only commit in the 013ca46…5761661 range that adds new C/C++ sources named exactly
contract-descriptor.c and contractpointerdata.cpp into a target that ends up baked into Runtime.ServerGC.lib.
Specifically it adds:

  • src/coreclr/nativeaot/Runtime/datadescriptor/CMakeLists.txt (new), which calls generate_data_descriptors(...) from
    src/coreclr/clrdatadescriptors.cmake to create three OBJECT libraries:
  • nativeaot_cdac_contract_descriptor
  • nativeaot_gc_wks_descriptor
  • nativeaot_gc_svr_descriptor ← these object files end up inside Runtime.ServerGC.lib
  • Wires it in via src/coreclr/nativeaot/Runtime/CMakeLists.txt and Runtime/Full/CMakeLists.txt.

Why it breaks the VMR Windows verticals

The macro builds the new .c/.cpp files as a CMake OBJECT library with default MSVC flags. Under MSVC that means /Zi
with no COMPILE_PDB_NAME set, so each translation unit emits its debug records into the compiler's default vc140.pdb.
That PDB never travels with the .obj files when they're archived into Runtime.ServerGC.lib. When NativeAOT publish
then re-links that lib into ILCompiler, crossgen2, and ilasm, link.exe emits LNK4099 — "PDB 'vc140.pdb' was not
found" for contract-descriptor.c.obj and contractpointerdata.cpp.obj. Those NativeAOT publish projects build with /WX
, so the warning is promoted to an error → 22 errors → leg fails.

It only shows up on Windows_x64 and Windows_x86 (Linux/Mac/WASM/iOS/Android verticals all pass) because LNK4099 is
MSVC-specific, and it didn't trip in the source dotnet/runtime CI because the runtime repo's leg coverage doesn't
NativeAOT-publish those tools under the same /WX path that the VMR vertical does. The follow-on cDAC commit e406822c
(#127643 — "Always add ManagedDataDescriptorProvider to compilationRoots") just makes sure the descriptor is
referenced, ensuring the failing object files actually pull into the link.

Suggested fix (in dotnet/runtime, will then re-flow)

In src/coreclr/clrdatadescriptors.cmake, for the MSVC branch, either:

  • compile with /Z7 (embed debug info in the .obj — no separate PDB), or
  • set COMPILE_PDB_NAME/COMPILE_PDB_OUTPUT_DIRECTORY on ${LIBRARY} so the PDB is named/placed where the consuming
    static lib expects, or
  • add /wd4099 (or pass /IGNORE:4099 to the consuming linker) for these specific sources.

/Z7 is the simplest and matches what other CoreCLR static-lib subdirs do for files that get re-archived into
Runtime.ServerGC.lib.

@dotnet-maestro

dotnet-maestro Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Note

PRs from original repository included in this codeflow update:

💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance.

steveisok added a commit to dotnet/runtime that referenced this pull request May 6, 2026
)

> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.

## Problem

The OBJECT libraries created by `generate_data_descriptors()` in
`src/coreclr/clrdatadescriptors.cmake` compile `contract-descriptor.c`
and `contractpointerdata.cpp` with MSVC defaults, which routes debug
info into the compiler-default `vc140.pdb`. That PDB does not travel
with the `.obj` files when they are archived into a static library such
as `Runtime.ServerGC.lib`.

Downstream linkers — in particular the NativeAOT publish of
`ILCompiler`, `crossgen2`, and `ilasm` on Windows — then emit `LNK4099`
("PDB 'vc140.pdb' was not found") for each affected object, which is
fatal under `/WX`.

## Symptom

The `dotnet/runtime` → `dotnet/dotnet` codeflow PR
[dotnet/dotnet#6423](dotnet/dotnet#6423) is
blocked: the **VMR Vertical Build Windows_x64** and **VMR Vertical Build
Windows_x86** legs both fail with 22 `LNK4099` errors apiece, e.g.:

```
Runtime.ServerGC.lib(contract-descriptor.c.obj) : error LNK4099:
  PDB 'vc140.pdb' was not found with 'Runtime.ServerGC.lib(contract-descriptor.c.obj)'
  or at '...\artifacts\bin\ILCompiler_publish\x64\Release\native\vc140.pdb';
  linking object as if no debug info
   [src\coreclr\tools\aot\ILCompiler\ILCompiler_publish.csproj]
Runtime.ServerGC.lib(contractpointerdata.cpp.obj) : error LNK4099: ...
```

repeated for `crossgen2_publish.csproj` and `ilasm.csproj`.
Linux/macOS/WASM/iOS/Android verticals all pass — `LNK4099` is
MSVC-specific.

The regression was introduced by #126972 ("[NativeAOT] Add cDAC data
descriptor infrastructure"), which wired the new descriptor `OBJECT`
libraries into the NativeAOT runtime so they end up archived inside
`Runtime.ServerGC.lib`.

## Fix

Set `COMPILE_PDB_NAME` and `COMPILE_PDB_OUTPUT_DIRECTORY` on
`${LIBRARY}` so each descriptor library produces its own deterministic
PDB that the consuming linker can locate. This matches the convention
already used by `install_static_library` in
`eng/native/functions.cmake`.

## Validation

- CMake reconfigures cleanly.
- Ninja built `nativeaot_gc_svr_descriptor`,
`nativeaot_gc_wks_descriptor`, `nativeaot_cdac_contract_descriptor`, and
`cdac_contract_descriptor` without errors on linux-x64.
- The actual `LNK4099` resolution can only be verified on a Windows
NativeAOT publish leg in CI; please pay particular attention to the
Windows legs and to the next forward-flow into `dotnet/dotnet`.

cc @max-charlamb (author of #126972)

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
@dotnet-maestro

dotnet-maestro Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Note

PRs from original repository included in this codeflow update:

💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance.

The per-target compile PDB introduced by dotnet/runtime#127836 only renamed
the missing PDB - the external PDB still stays in the producer's binary dir
and is not visible to downstream linkers consuming Runtime.ServerGC.lib /
Runtime.WorkstationGC.lib. The result was that the LNK4099 errors changed
shape (from missing 'vc140.pdb' to missing per-target named PDBs) but
remained fatal under /WX in the VMR Windows verticals.

Adding /Z7 makes each .obj carry its CodeView debug info inline, so the
data travels with the object file when it is archived into a static lib
and reaches the consumer's linker without needing a separate .pdb file.
This unblocks the VMR Vertical Build Windows_x64 / Windows_x86 legs in
PR 6423 and similar codeflow PRs.

Co-authored-by: Copilot <[email protected]>
@steveisok
steveisok enabled auto-merge (squash) May 6, 2026 22:01
@steveisok
steveisok merged commit 1e02dcc into main May 6, 2026
16 checks passed
@steveisok
steveisok deleted the darc-main-ea1ff30c-94e0-4369-89e0-84cff2acbdd0 branch May 6, 2026 22:04
eiriktsarpalis pushed a commit to dotnet/runtime that referenced this pull request Jul 15, 2026
)

> [!NOTE]
> This PR was authored with assistance from GitHub Copilot.

## Problem

The OBJECT libraries created by `generate_data_descriptors()` in
`src/coreclr/clrdatadescriptors.cmake` compile `contract-descriptor.c`
and `contractpointerdata.cpp` with MSVC defaults, which routes debug
info into the compiler-default `vc140.pdb`. That PDB does not travel
with the `.obj` files when they are archived into a static library such
as `Runtime.ServerGC.lib`.

Downstream linkers — in particular the NativeAOT publish of
`ILCompiler`, `crossgen2`, and `ilasm` on Windows — then emit `LNK4099`
("PDB 'vc140.pdb' was not found") for each affected object, which is
fatal under `/WX`.

## Symptom

The `dotnet/runtime` → `dotnet/dotnet` codeflow PR
[dotnet/dotnet#6423](dotnet/dotnet#6423) is
blocked: the **VMR Vertical Build Windows_x64** and **VMR Vertical Build
Windows_x86** legs both fail with 22 `LNK4099` errors apiece, e.g.:

```
Runtime.ServerGC.lib(contract-descriptor.c.obj) : error LNK4099:
  PDB 'vc140.pdb' was not found with 'Runtime.ServerGC.lib(contract-descriptor.c.obj)'
  or at '...\artifacts\bin\ILCompiler_publish\x64\Release\native\vc140.pdb';
  linking object as if no debug info
   [src\coreclr\tools\aot\ILCompiler\ILCompiler_publish.csproj]
Runtime.ServerGC.lib(contractpointerdata.cpp.obj) : error LNK4099: ...
```

repeated for `crossgen2_publish.csproj` and `ilasm.csproj`.
Linux/macOS/WASM/iOS/Android verticals all pass — `LNK4099` is
MSVC-specific.

The regression was introduced by #126972 ("[NativeAOT] Add cDAC data
descriptor infrastructure"), which wired the new descriptor `OBJECT`
libraries into the NativeAOT runtime so they end up archived inside
`Runtime.ServerGC.lib`.

## Fix

Set `COMPILE_PDB_NAME` and `COMPILE_PDB_OUTPUT_DIRECTORY` on
`${LIBRARY}` so each descriptor library produces its own deterministic
PDB that the consuming linker can locate. This matches the convention
already used by `install_static_library` in
`eng/native/functions.cmake`.

## Validation

- CMake reconfigures cleanly.
- Ninja built `nativeaot_gc_svr_descriptor`,
`nativeaot_gc_wks_descriptor`, `nativeaot_cdac_contract_descriptor`, and
`cdac_contract_descriptor` without errors on linux-x64.
- The actual `LNK4099` resolution can only be verified on a Windows
NativeAOT publish leg in CI; please pay particular attention to the
Windows legs and to the next forward-flow into `dotnet/dotnet`.

cc @max-charlamb (author of #126972)

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants