Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response files created by "swift-frontend.exe" on Windows include "/LIB" which causes linking failures #76548

Open
sienkewits opened this issue Sep 18, 2024 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@sienkewits
Copy link

Description

On Windows, when compiling/linking many files, the swiftc compiler ends up putting the command line parameters for the link step into a temporary response file. The first linker parameter in the response file is "/LIB", which (according to the linker) is supposed to be the first parameter of the linker command. However, because "/LIB" is in the response file, it is not interpreted properly by the linker as the first parameter, and the link step fails. If "/LIB" is taken out of the response file, and put onto the linker command line, then the link step works as expected.

Reproduction

A reproducible testcase can be found at:
https://github.com/sienkewits/swiftc-link-issue

Expected behavior

The provided testcase should compile and link successfully.

Environment

This issue has been reproduced with swiftc version 5.8.1 and 5.10.1 on Windows.

Additional information

No response

@sienkewits sienkewits added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Sep 18, 2024
@cgweeder
Copy link

Greetings -

I have seen this incorrect behavior as well, on Windows. Hopefully someone from the Swift team can take a look at this ticket and triage.

Regards,
C

@compnerd
Copy link
Member

What version of swift are you using? This shouldn't be happening on the development snapshots at the very least if it didn't already make it into 6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

3 participants