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

rustc: Handle duplicate names merging archives #24439

Merged
merged 1 commit into from
Apr 22, 2015

Conversation

alexcrichton
Copy link
Member

When linking an archive statically to an rlib, the compiler will extract all
contents of the archive and add them all to the rlib being generated. The
current method of extraction is to run ar x, dumping all files into a
temporary directory. Object archives, however, are allowed to have multiple
entries with the same file name, so there is no method for them to extract their
contents into a directory in a lossless fashion.

This commit adds iterator support to the ArchiveRO structure which hooks into
LLVM's support for reading object archives. This iterator is then used to
inspect each object in turn and extract it to a unique location for later
assembly.

@rust-highfive
Copy link
Collaborator

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

}
}

#[unsafe_destructor]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just here for stage0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately :(

@nrc
Copy link
Member

nrc commented Apr 20, 2015

@bors r+ de0f930

@bors
Copy link
Contributor

bors commented Apr 20, 2015

⌛ Testing commit de0f930 with merge 1673293...

@bors
Copy link
Contributor

bors commented Apr 20, 2015

⛄ The build was interrupted to prioritize another pull request.

@bors
Copy link
Contributor

bors commented Apr 21, 2015

⌛ Testing commit de0f930 with merge 844df9c...

@bors
Copy link
Contributor

bors commented Apr 21, 2015

⛄ The build was interrupted to prioritize another pull request.

@bors
Copy link
Contributor

bors commented Apr 21, 2015

⌛ Testing commit de0f930 with merge 98619b8...

@bors
Copy link
Contributor

bors commented Apr 21, 2015

💔 Test failed - auto-mac-32-opt

When linking an archive statically to an rlib, the compiler will extract all
contents of the archive and add them all to the rlib being generated. The
current method of extraction is to run `ar x`, dumping all files into a
temporary directory. Object archives, however, are allowed to have multiple
entries with the same file name, so there is no method for them to extract their
contents into a directory in a lossless fashion.

This commit adds iterator support to the `ArchiveRO` structure which hooks into
LLVM's support for reading object archives. This iterator is then used to
inspect each object in turn and extract it to a unique location for later
assembly.
@alexcrichton alexcrichton force-pushed the fix-archive-assembler branch from de0f930 to 9ab0475 Compare April 21, 2015 18:09
@alexcrichton
Copy link
Member Author

@bors: r=nrc 9ab0475

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 21, 2015
When linking an archive statically to an rlib, the compiler will extract all
contents of the archive and add them all to the rlib being generated. The
current method of extraction is to run `ar x`, dumping all files into a
temporary directory. Object archives, however, are allowed to have multiple
entries with the same file name, so there is no method for them to extract their
contents into a directory in a lossless fashion.

This commit adds iterator support to the `ArchiveRO` structure which hooks into
LLVM's support for reading object archives. This iterator is then used to
inspect each object in turn and extract it to a unique location for later
assembly.
@bors bors merged commit 9ab0475 into rust-lang:master Apr 22, 2015
@alexcrichton alexcrichton deleted the fix-archive-assembler branch April 30, 2015 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants