The silent failures had confused me a few times.
I haven't added a similar check for platform yet as we don't yet have logic to
infer the platform automatically, and so adding that check would require
updating dozens of test files.
Differential D97209
[lld-macho] Check for arch compatibility when loading ObjFiles and TBDs int3 on Feb 22 2021, 11:13 AM. Authored by
Details
The silent failures had confused me a few times. I haven't added a similar check for platform yet as we don't yet have logic to
Diff Detail
Event TimelineComment Actions ELF and COFF do this a bit earlier, COFF in SymbolTable::addFile() which has the nicer diag I suggest below -- but otherwise I don't like the COFF approach much, since it parses the whole InputFile, which adds its symbols, and only after that it checks the arch. Checking the arch first and returning early if it doens't match, like this does, seems better. ELF does it in doParseFile(), with a similar timing to this patch. Maybe we could make it look a bit more like the ELF port, to keep the different lld ports consistent in parts where they don't need to be different?
Comment Actions
Yup, that's the plan :) I'll tackle that when I add support for arch inference: https://bugs.llvm.org/show_bug.cgi?id=49277 Comment Actions Hi. (in case you didn't know already) This is failing on one of our bots: This bot only enables ARM and AArch64 targets so I think you need a "REQUIRES" line for the new tests, like lld/test/MachO/header.s has. |
should the diag mention the arch of the source file too? "file has architecture x86 which is incompatible with output architecture x64" or similar?