Details
- Reviewers
int3 - Group Reviewers
Restricted Project - Commits
- rG7d4f70f8e598: Reland 3nd attempt: [lld-macho] Fix bug in reading cpuSubType field.
rGb08acee42393: Reland 2nd attempt: [lld-macho] Fix bug in reading cpuSubType field.
rGf472da190b65: Reland [lld-macho] Fix bug in reading cpuSubType field.
rGe54cfa48d2d5: [lld-macho] Fix bug in reading cpuSubType field.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Is there a test we could write here? How do the other bits in cpusubtype get set?
lld/MachO/InputFiles.cpp | ||
---|---|---|
234 |
lld/MachO/InputFiles.cpp | ||
---|---|---|
234 | also cpuType, cpuSubtype |
Added the test to fat-arch.s
(Without this, it'd throw an error when linking the %t.fat.bundle : ld64.lld: error: unable to find matching architecture in fat-arch.s.tmp.fat.exec.out )
lld/test/MachO/fat-arch.s | ||
---|---|---|
15 ↗ | (On Diff #481272) | (removed because this doesn't work for arm and we don't really need it) |
@oontvoo the test you added is failing if the AArch64 target is not built: https://lab.llvm.org/buildbot/#/builders/139/builds/32439
@thakis What kind of Mac do you have? Is it arm64? Just curious since I can't seem to reproduce the crash on my machines ( Mac (x86) and Linux)
Thanks!
P.S: oh, never mind - I think this test is bad because otool doesn't really guarantee which slice it picks when printing.
reland 2nd attempt
New changes:
Fix tests to dump both slices in the fat-archive because otool isn't deterministic about which slice it prints across different archs. (It printed x86 on x86 machines but arm64 on arm64, this was why the test failed on arm64)
Fingers crossed - 3rd time is 🍀
Thanks! Looking at the error more closely, it doesn't make a lot of sense. This bundle (%t.fat.bundle was created with -arch x86_64), and yet it ended up being an arm64 (ie., with CPU=16777228) ...
I suspect we have a bug somewhere that causes the target to be whatever host machine's arch rather than what was passed via -arch 🤔
Reland #3: temporarily disabled checking cpu type after link due to suspected bug (described above).
(The current test that the link succeeded should be sufficient because
the link would have failed prior to this patch).