summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-ar/llvm-ar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp')
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 6fbfc153808..66daba30a4a 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/LibDriver/LibDriver.h"
@@ -552,9 +553,14 @@ performWriteOperation(ArchiveOperation Operation, object::Archive *OldArchive,
std::vector<NewArchiveIterator> *NewMembersP) {
object::Archive::Kind Kind;
switch (FormatOpt) {
- case Default:
- // FIXME: change as the support for other formats improve.
- Kind = object::Archive::K_GNU;
+ case Default: {
+ Triple T(sys::getProcessTriple());
+ if (T.isOSDarwin())
+ Kind = object::Archive::K_BSD;
+ else
+ Kind = object::Archive::K_GNU;
+ break;
+ }
case GNU:
Kind = object::Archive::K_GNU;
break;
OpenPOWER on IntegriCloud