Replace vendored ar module with ar_archive_writer#26
Merged
Conversation
- MSVC path: delegate entirely to ar_archive_writer::write_import_library, reducing msvc.rs from ~1250 lines to ~80 lines. ARM64EC mangling, import descriptors, null thunks, short imports, and weak externals are all handled by the upstream crate. - GNU path: replace vendored ar::GnuBuilder with ar_archive_writer::write_archive_to_stream. The ObjectFactory that builds COFF .o members is kept; only the archive assembly changes. - Delete src/ar/ (vendored fork of the ar crate) entirely. - Remove the now-unused ArchiveMember.symbols field and related tracking code. Output is bit-identical to the previous implementation and to llvm-dlltool. Verified linking with both lld-link (rust-lld) and mingw-w64 ld.
57c73f5 to
b1b0318
Compare
ar_archive_writer 0.5.1 is synced with LLVM 20.1.8, so the bit-identical comparison needs a matching llvm-dlltool version. The default ubuntu llvm package (v18) produces different output.
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.
MSVC path: delegate entirely to
ar_archive_writer::write_import_library, reducing msvc.rs from ~1250 lines to ~80 lines. ARM64EC mangling, import descriptors, null thunks, short imports, and weak externals are all handled by the upstream crate.GNU path: replace vendored
ar::GnuBuilderwithar_archive_writer::write_archive_to_stream. The ObjectFactory that builds COFF .o members is kept; only the archive assembly changes.Delete src/ar/ (vendored fork of the ar crate) entirely.
Remove the now-unused
ArchiveMember.symbolsfield and related tracking code.Output is bit-identical to the previous implementation and to llvm-dlltool. Verified linking with both lld-link (rust-lld) and mingw-w64 ld.
Closes #15