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-662] swiftpm doesn't correctly order .a files when constructing swiftc args #5431
Comments
This is a package manager bug as we decide the order. |
Comment by Jay Buffington (JIRA) Ah, yes, looks like the bug is somewhere around here (from
|
Comment by Shmuel Kallner (JIRA) I'd like to add that this bug will only show itself on certain Unix based platforms. In particular on OSX you won't see this issue because LD will scan the list of .a flles multiple times. One solution for this on Linux albeit not optimal is to place all of the .a's in a group using the -( and -) LD parameters around the .a files. This may not be optimal as the LD documentation claims there is a performance penalty for doing this. |
We should be able to order them correctly |
Confirmed this still occurs after the testing refactor. Looking into it. |
Comment by Shmuel Kallner (JIRA) We have found that the issue seems to crop up if one adds "extra" dependencies beyond the minimal list needed. By that I mean, if A is dependent on B and B is dependent on C, then in theory A can directly import C, even though A is not directly dependent on C and that dependency may not have been listed in A's dependency list at all. If however C gets listed as a dependency of A and by chance it is listed in the dependency list after B, then the problem occurs. The solution is to make sure that such lists of dependencies are in reverse order, i.e. in the case above C is listed before B |
Comment by Jay Buffington (JIRA) Works for me 👍 |
Attachment: Download
Additional Detail from JIRA
md5: f13d5ad12d638b307720fac644c5388f
relates to:
Issue Description:
It looks like llbuild doesn't consider order to pass .a files to swiftc.
The list of .a files and their order is passed from swiftc to clang++, which is finally passed to ld. ld's man page says that order matters:
The text was updated successfully, but these errors were encountered: