Skip to content

Swift compiler doesn't support turning off whole module optimization on certain projects #70995

Open
@dabrahams

Description

@dabrahams

Description

I know, I know, this is really an SPM issue. But the SPM people think I should file it here. I'm just doing what they asked. I hope we can avoid 👉 👈

This matters to me because of #70979, which I need to work around.

Reproduction

  • swift package init --type executable
  • add swiftSettings: [.unsafeFlags(["-no-whole-module-optimization"])] to the executable target
  • swift build -c release

Expected behavior

build completes successfully

Environment

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrontendArea → compiler: FrontendbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.swift 5.9whole module optimizationFeature: Whole module optimization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions