Skip to content

Remove StripSymbols workaround for macOS NativeAOT publish once Swift module debug fix is available #123687

@steveisok

Description

@steveisok

After #120953 added Swift code to System.Security.Cryptography.Native.Apple, publishing NativeAOT tools (ILCompiler, crossgen2) on macOS fails with dsymutil errors about missing module cache files (.pcm).

The Swift code was compiled with -g which includes module debug information. When dsymutil processes the final linked binary, it looks for .pcm files that were in a temporary build cache and fails.

Current Workaround

PR #123386 implements a two-part fix:

  1. Immediate workaround: Set StripSymbols=false for Apple platforms in:

    • src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj
    • src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
  2. Long-term fix: Changed Swift compilation to use -gline-tables-only instead of -g in:

    • src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt

Action Needed

Once a new Microsoft.NETCore.App.Runtime.NativeAOT.osx-arm64 NuGet package is published with the CMakeLists.txt fix, we should:

  1. Remove the StripSymbols=false workaround from the .csproj files
  2. Re-enable symbol stripping for macOS NativeAOT publish builds

Related

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions