Skip to content

Commit c7d5769

Browse files
author
git apple-llvm automerger
committed
Merge commit '1d5fcbce8c30' from swift/release/6.0 into stable/20230725
2 parents a11ae56 + 1d5fcbc commit c7d5769

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
$ cat test.c
2+
int main() {
3+
return 0;
4+
}
5+
6+
$ xcrun clang -O0 -target arm64-apple-unknown-macho test.c -c -o test.o
7+
$ xcrun ld -arch arm64 -o test.out test.o -platform_version firmware 0 0
8+
9+
RUN: dsymutil -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/firmware/test.out -o %t.dSYM
10+
RUN: llvm-objdump -h %t.dSYM/Contents/Resources/DWARF/test.out | FileCheck %s
11+
CHECK: file format mach-o arm64
Binary file not shown.
Binary file not shown.

llvm/tools/dsymutil/DwarfLinkerForBinary.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,9 @@ bool DwarfLinkerForBinary::linkImpl(
867867
return error(toString(std::move(E)));
868868
}
869869

870-
if (Map.getTriple().isOSDarwin() && !Map.getBinaryPath().empty() &&
870+
auto MapTriple = Map.getTriple();
871+
if ((MapTriple.isOSDarwin() || MapTriple.isOSBinFormatMachO()) &&
872+
!Map.getBinaryPath().empty() &&
871873
ObjectType == Linker::OutputFileType::Object)
872874
return MachOUtils::generateDsymCompanion(
873875
Options.VFS, Map, Options.Translator,

0 commit comments

Comments
 (0)