-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.legacy driverArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver projectArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Description
Description
swiftc
(with legacy driver) unexpectedly treats static libraries as source files with -wmo
flag, so it emits error diagnostics.
Steps to reproduce
// Module.swift
public func hello() {}
// main.swift
import Module
hello()
Windows:
- Run
swiftc -emit-module -emit-library Module.swift
; - Run
swiftc -disallow-use-new-driver -wmo -I. main.swift Module.lib
.
Unix:
- Run
swiftc -emit-module -emit-library -static Module.swift
; - Run
swiftc -disallow-use-new-driver -wmo -I. main.swift libModule.a
.
Expected behavior
This should run successfully with or without -wmo
.
Environment
Swift version 5.9-dev (LLVM 230b7b8312a62d8, Swift 5ca8989242af5af)
Additional context
This is found when building swift-corelibs-libdispatch
on Windows with CMake 3.26.0, which enables WMO for release build by default.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.legacy driverArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver projectArea → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project