mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Make llvm-ar behave like ar, if you create an empty archive, ar creates an empty archive. llvm-ar would not generate an output file in this case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f3c630e3fc
commit
63b8c1f6f1
@ -348,7 +348,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
|
|||||||
{
|
{
|
||||||
// Make sure they haven't opened up the file, not loaded it,
|
// Make sure they haven't opened up the file, not loaded it,
|
||||||
// but are now trying to write it which would wipe out the file.
|
// but are now trying to write it which would wipe out the file.
|
||||||
if (members.empty() && mapfile->size() > 8) {
|
if (members.empty() && mapfile && mapfile->size() > 8) {
|
||||||
if (ErrMsg)
|
if (ErrMsg)
|
||||||
*ErrMsg = "Can't write an archive not opened for writing";
|
*ErrMsg = "Can't write an archive not opened for writing";
|
||||||
return true;
|
return true;
|
||||||
|
@ -717,6 +717,7 @@ int main(int argc, char **argv) {
|
|||||||
if (!Create)
|
if (!Create)
|
||||||
std::cerr << argv[0] << ": creating " << ArchivePath.toString() << "\n";
|
std::cerr << argv[0] << ": creating " << ArchivePath.toString() << "\n";
|
||||||
TheArchive = Archive::CreateEmpty(ArchivePath);
|
TheArchive = Archive::CreateEmpty(ArchivePath);
|
||||||
|
TheArchive->writeToDisk();
|
||||||
} else {
|
} else {
|
||||||
std::string Error;
|
std::string Error;
|
||||||
TheArchive = Archive::OpenAndLoad(ArchivePath, &Error);
|
TheArchive = Archive::OpenAndLoad(ArchivePath, &Error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user