-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
llvm-objcopy does not work on Rust .rlib
archive files
#53395
Comments
@llvm/issue-subscribers-tools-llvm-objcopy-strip |
I've not given this much thought, but we could probably demote this error to a warning, in the case of archives. I'm not sure we want to remove the error entirely, as that could hide genuine issues people run into with their build-system (e.g. they try to use llvm-objcopy on an archive consisting entirely of unsupported outputs). An alternative option would be to add specific "support" for .rmeta files, whereby llvm-objcopy ignores them specifically. I'm unfamiliar with Rust though, so I don't know if this would be safe to do. Someone with more Rust familiarity would have to sort that out. |
Since rust-lang/rust#91604 the crate metadata is wrapped in a regular object file on most platforms. Wasm being the notable exception. |
Rust
.rlib
archive files contains object files and.rmeta
files. Tools for working with.rlib
file has been requested for several years but there's still no work on it yet. (rust-lang/rust#25820)Most of the commands like
nm
,objdump
, etc. work on.rlib
file, although there is an error message about unrecognized format of.rmeta
files.objcopy
is one of them, and commands likeobjcopy -W foo libxxx.rlib
still work, even though it complains about unrecognized.rmeta
file.But it seems that
llvm-objcopy
does not commit the changes to.rlib
files if an error occurs.I don't know if the policy is to mimic GNU tools' behavior, but it would be a lot more convenient if
llvm-objcopy
would behave similarly toobjcopy
in cases like this, provided that the side-effects caused by this change is expected to be small.Otherwise, I have to extract the archive, apply the change to individual object files, and recreate the archive.
The text was updated successfully, but these errors were encountered: