Ensure SYMTAB in rlib's with arch code but no syms#5
Merged
bjorn3 merged 1 commit intorust-lang:masterfrom Mar 24, 2023
Merged
Conversation
bjorn3
reviewed
Mar 23, 2023
bjorn3
reviewed
Mar 23, 2023
Member
bjorn3
left a comment
There was a problem hiding this comment.
Of course. This explains the trouble I had with getting it to work for webassembly. Thanks for finding this!
776f223 to
65c840d
Compare
Contributor
Author
|
I applied your suggestion, let me know if I should make any more changes. |
65c840d to
21cbbc5
Compare
bjorn3
reviewed
Mar 23, 2023
21cbbc5 to
d99dfda
Compare
bjorn3
approved these changes
Mar 23, 2023
Member
bjorn3
left a comment
There was a problem hiding this comment.
Thanks! I will merge and do a release tomorrow. I'm currently on my phone.
Member
|
Released as v0.1.3. |
bjorn3
added a commit
to bjorn3/rust
that referenced
this pull request
Mar 24, 2023
This updates object to 0.30 and fixes a bug where the symbol table would be omitted for archives where there are object files yet none that export any symbol. This bug could lead to linker errors for crates like rustc_std_workspace_core which don't contain any code of their own but exist solely for their dependencies. This is likely the cause of the linker issues I was experiencing on Webassembly. It has been shown to cause issues on other platforms too. cc rust-lang/ar_archive_writer#5
Member
|
Opened rust-lang/rust#109562 to update ar_archive_writer. |
Noratrieb
added a commit
to Noratrieb/rust
that referenced
this pull request
Mar 28, 2023
…=Mark-Simulacrum Update ar_archive_writer to 0.1.3 This updates object to 0.30 and fixes a bug where the symbol table would be omitted for archives where there are object files yet none that export any symbol. This bug could lead to linker errors for crates like rustc_std_workspace_core which don't contain any code of their own but exist solely for their dependencies. This is likely the cause of the linker issues I was experiencing on Webassembly. It has been shown to cause issues on other platforms too. cc rust-lang/ar_archive_writer#5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was experimenting with using no_std and rustc_codegen_gcc, and it mostly works great, except that librustc_std_workspace_core.rlib would cause a linker error, as GNU LD couldn't find a symbol table for the archive. Investigating it seems to have uncovered an oversight, has_object will effectively inevitably always get reset back to false once it hits the lib.rmeta file, which causes a problem if there's also no symbols pulled out of any of the interior object files (this happens if get_native_object_symbols doesn't see any global symbols prior to lib.rmeta). The rest of the code following will incorrectly assume that since there's no symbols, there must not be any objects inside, and thus no need for a SYMTAB.