-
Notifications
You must be signed in to change notification settings - Fork 8
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
Ensure SYMTAB in rlib's with arch code but no syms #5
Ensure SYMTAB in rlib's with arch code but no syms #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course. This explains the trouble I had with getting it to work for webassembly. Thanks for finding this!
776f223
to
65c840d
Compare
I applied your suggestion, let me know if I should make any more changes. |
65c840d
to
21cbbc5
Compare
21cbbc5
to
d99dfda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I will merge and do a release tomorrow. I'm currently on my phone.
Released as v0.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
Opened rust-lang/rust#109562 to update ar_archive_writer. |
…=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
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.