diff --git a/llvm/test/tools/llvm-libtool-darwin/no-symbols-warning.test b/llvm/test/tools/llvm-libtool-darwin/no-symbols-warning.test --- a/llvm/test/tools/llvm-libtool-darwin/no-symbols-warning.test +++ b/llvm/test/tools/llvm-libtool-darwin/no-symbols-warning.test @@ -9,7 +9,7 @@ # RUN: llvm-libtool-darwin -static -o %t.lib %t-x86_64-empty.o 2>&1 | \ # RUN: FileCheck --check-prefix=WARNING %s -DPREFIX=%basename_t.tmp -# WARNING: warning: [[PREFIX]]-x86_64-empty.o has no symbols +# WARNING: warning: for architecture x86_64 file: '[[PREFIX]]-x86_64-empty.o' has no symbols # RUN: llvm-libtool-darwin -no_warning_for_no_symbols -static -o %t.lib \ # RUN: %t-x86_64-empty.o 2>&1 | \ diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp --- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp +++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp @@ -361,8 +361,9 @@ auto *O = dyn_cast(ObjOrErr->get()); uint32_t FileCPUType, FileCPUSubtype; + StringRef ArchName = O->getArchTriple().getArchName(); std::tie(FileCPUType, FileCPUSubtype) = MachO::getCPUTypeFromArchitecture( - MachO::getArchitectureFromName(O->getArchTriple().getArchName())); + MachO::getArchitectureFromName(ArchName)); // If -arch_only is specified then skip this file if it doesn't match // the architecture specified. @@ -371,7 +372,7 @@ } if (!NoWarningForNoSymbols && O->symbols().empty()) - WithColor::warning() << Member.MemberName + " has no symbols\n"; + WithColor::warning() << "for architecture " + ArchName + " file: '" + Member.MemberName + "' has no symbols\n"; uint64_t FileCPUID = getCPUID(FileCPUType, FileCPUSubtype); Builder.Data.MembersPerArchitecture[FileCPUID].push_back(