diff options
author | Ben Dunbobbin <Ben.Dunbobbin@sony.com> | 2022-05-13 23:37:16 +0100 |
---|---|---|
committer | Ben Dunbobbin <Ben.Dunbobbin@sony.com> | 2022-05-13 23:50:10 +0100 |
commit | b074275067be3f6b10ef2f8bada21c2ec7b90f2e (patch) | |
tree | 2a95966f8bc027da7150d9d6092f0668370c0ea3 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | c7587080188e1f46ddf8b8274e99d4481361d5dc (diff) | |
download | llvm-b074275067be3f6b10ef2f8bada21c2ec7b90f2e.zip llvm-b074275067be3f6b10ef2f8bada21c2ec7b90f2e.tar.gz llvm-b074275067be3f6b10ef2f8bada21c2ec7b90f2e.tar.bz2 |
[llvm-ar][mri] Ensure CREATE commands overwrite the output file
The CREATE/CREATETHIN commands should overwrite the output file:
https://sourceware.org/binutils/docs/binutils/ar-scripts.html.
This fixes a regression for MRI scripts introduced in:
https://reviews.llvm.org/D123142 which put logic into
performWriteOperation. performWriteOperation is called for all MRI
commands that write an archive out (one's with a SAVE command).
performWriteOperation is unaware of MRI semantics and loads an
existing archive if present. If an existing archive is loaded, llvm-ar
checks the properties of the existing archive for decisions about the
output archive (for example making the output archive thin if the
existing one was). https://reviews.llvm.org/D123142 adds the following
logic...
if (OldArchive) {
if (Thin && !OldArchive->isThin())
fail("cannot convert a regular archive to a thin one");
if (OldArchive->isThin())
Thin = true;
}
... which errors for a script with CREATETHIN in effect if there is an
existing regular archive, and causes CREATE to output a thin archive
if there is an existing thin archive.
Differential Revision: https://reviews.llvm.org/D125439
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions