Skip to content

swiftinterface compilation does not re-serialise static library builds #77756

Closed
@hjyamauchi

Description

@hjyamauchi

Description

It seems that I recently started getting link errors related to swiftCxx.lib and swiftCxxStdlib.lib such as:

Windows (x64/arm64):

lld-link: error: could not open 'swiftCxx.lib': no such file or directory
lld-link: error: could not open 'swiftCxxStdlib.lib': no such file or directory
LINK : fatal error LNK1104: cannot open file 'swiftCxx.lib'

where I presume it should probably need to load instead libswiftCxx.lib and libswiftCxxStdlib.lib which actually exist in the toolchain directory, as opposed to swiftCxx.lib and swiftCxxStdlib.lib which don't exist there.

Locally reverting #77559 (and swiftlang/swift-installer-scripts#344) seems to make this error go away.

Reproduction

On a recent toolchain build in the main branch:

Windows

C:\Users\hiroshi\Test>cat Test.swift
import CXXModule

C:\Users\hiroshi\Test>cat Inputs\header.h
#ifndef HEADER_H
#define HEADER_H

#endif // HEADER_H

C:\Users\hiroshi\Test>cat Inputs\module.modulemap
module CXXModule {
  header "header.h"
  requires cplusplus
}

C:\Users\hiroshi\Test>swiftc Test.swift -cxx-interoperability-mode=default -o Test.exe -I C:\Users\hiroshi\SwiftCxxTest\Inputs
error: link command failed with exit code 1104 (use -v to see invocation)
LINK : fatal error LNK1104: cannot open file 'swiftCxx.lib'
clang: error: linker command failed with exit code 1104 (use -v to see invocation)

Expected behavior

Successful linking, no link errors.

Environment

With a recent main-branch toolchain build on windows.

Additional information

No response

Metadata

Metadata

Assignees

Labels

FrontendArea → compiler: FrontendbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.c++ interopFeature: Interoperability with C++compilerThe Swift compiler itselflinker errorswift 6.0unexpected errorBug: Unexpected error

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions