[PATCH] D101855: [lld-macho] Check simulator platforms to avoid issuing false positive errors.
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 5 14:49:03 PDT 2021
int3 added inline comments.
================
Comment at: lld/test/MachO/invalid/incompatible-arch.s:45
+# RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=CROSS-SIM2
+# CROSS-SIM2: {{.*}}test_x86_ios_sim.o has platform iOS, which is different from target platform watchOS Simulator
+
----------------
oontvoo wrote:
> int3 wrote:
> > why doesn't this say "iOS simulator"?
> It seems the "simulator" part was removed by llvm-mc. (Running `otool` on test_x86_ios_sim.oshows that it's only "IOS" and not IOS-simulator
Ah, that seems to happen when the specified iOS version is old enough to require LC_MIN_VERSION instead of LC_BUILD_VERSION. Using a modern iOS version should preserve the 'simulator' part:
```
> echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-ios14.0-simulator -o test_x86_ios_sim.o
> llvm-objdump --macho --all-headers test_x86_ios_sim.o
...
Load command 1
cmd LC_BUILD_VERSION
cmdsize 24
platform iossimulator
sdk n/a
minos 14.0
ntools 0
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101855/new/
https://reviews.llvm.org/D101855
More information about the llvm-commits
mailing list