Navigation Menu

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

[SR-12123] modulewrap does not pass on -X or --destination information #4612

Closed
swift-ci opened this issue Feb 3, 2020 · 3 comments
Closed
Labels

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Feb 3, 2020

Previous ID SR-12123
Radar rdar://problem/59127918
Original Reporter SDGGiesbrecht (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

The SwiftPM it use is the one from:
Swift version 5.1.3 (swift-5.1.3-RELEASE)
Target: x86_64-unknown-linux-gnu

(Though SwiftPM is obviously being directed to use a separate Android toolchain.)

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 85feafe268e39c401b50acd96e89951d

Issue Description:

The module wrapping strategy used by SwiftPM since September 2019 does not pass any -X flags to swiftc, nor does it pass on any toolchain information from --destination.

This breaks cross‐compilation.

Each file is initially compiled correctly, with the necessary flags being passed on:

$ file .build/aarch64-unknown-linux-android/debug/Module.build/File.swift.o
.build/aarch64-unknown-linux-android/debug/Module.build/File.swift.o: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), with debug_info, not stripped

But then module wrapping ends up being done for the wrong architecture due to the absence of the flags:

$ file .build/aarch64-unknown-linux-android/debug/Module.build/Module.swiftmodule.o
.build/aarch64-unknown-linux-android/debug/Module.build/Module.swiftmodule.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

The mismatched architectures cause the whole thing to fail later when SwiftPM attempts to link it:

ld.lld: error: /[...]/.build/aarch64-unknown-linux-android/debug/Module.build/Module.swiftmodule.o is incompatible with aarch64linux
@ankitspd
Copy link
Member

ankitspd commented Feb 3, 2020

Yikes, that seems bad.

@ankitspd
Copy link
Member

ankitspd commented Feb 3, 2020

@swift-ci create

@swift-ci
Copy link
Contributor Author

Comment by Jeremy David Giesbrecht (JIRA)

This is no longer an issue in the snapshot from 2020‐02‐11.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants