This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] [PECOFF] Use a "pc" vendor name in aarch64 triples
ClosedPublic

Authored by mstorsjo on Oct 14 2019, 4:17 AM.

Details

Summary

This matches all other architectures listed in the same file.

This fixes debugging aarch64 executables with lldb-server, which otherwise fails, with log messages like these:

Target::SetArchitecture changing architecture to aarch64 (aarch64-pc-windows-msvc)
Target::SetArchitecture Trying to select executable file architecture aarch64 (aarch64-pc-windows-msvc)

ArchSpec::SetArchitecture sets the vendor to llvm::Triple::PC for any coff/win32 combination, and if this doesn't match the triple set by the PECOFF module, things doesn't seem to work with when using lldb-server.

Diff Detail

Event Timeline

mstorsjo created this revision.Oct 14 2019, 4:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2019, 4:17 AM

Would you say that "pc" is a reasonable value for the "vendor" field for the win+aarch64 combo? I am asking because I don't have a clue about that, and given that this platform is being brought up right now, changing this now would be way easier than doing it later. (The reason why things don't work is the incompatibility between the two things that compute the ArchSpec, but that can also be fixed by changing the other mechanism, if that is better/more correct.) My guess is the other mechanism is ArchSpec::SetArchitecture function, line 928...

Would you say that "pc" is a reasonable value for the "vendor" field for the win+aarch64 combo? I am asking because I don't have a clue about that, and given that this platform is being brought up right now, changing this now would be way easier than doing it later. (The reason why things don't work is the incompatibility between the two things that compute the ArchSpec, but that can also be fixed by changing the other mechanism, if that is better/more correct.) My guess is the other mechanism is ArchSpec::SetArchitecture function, line 928...

I'd say "pc" is fine here; such machines are available for sale (although with a bit scarce availability) as normal power efficient laptops - google for e.g. HP Envy X2, for one that is available with both arm and x86 cpu options.

labath accepted this revision.Oct 14 2019, 6:45 AM

Would you say that "pc" is a reasonable value for the "vendor" field for the win+aarch64 combo? I am asking because I don't have a clue about that, and given that this platform is being brought up right now, changing this now would be way easier than doing it later. (The reason why things don't work is the incompatibility between the two things that compute the ArchSpec, but that can also be fixed by changing the other mechanism, if that is better/more correct.) My guess is the other mechanism is ArchSpec::SetArchitecture function, line 928...

I'd say "pc" is fine here; such machines are available for sale (although with a bit scarce availability) as normal power efficient laptops - google for e.g. HP Envy X2, for one that is available with both arm and x86 cpu options.

So, am I correct to assume that "pc" is used/can be used for any "personal computer"? I was under the impression that pc stands for the PCs which are descended/compatible with the original IBM PCs...

This revision is now accepted and ready to land.Oct 14 2019, 6:45 AM

Would you say that "pc" is a reasonable value for the "vendor" field for the win+aarch64 combo? I am asking because I don't have a clue about that, and given that this platform is being brought up right now, changing this now would be way easier than doing it later. (The reason why things don't work is the incompatibility between the two things that compute the ArchSpec, but that can also be fixed by changing the other mechanism, if that is better/more correct.) My guess is the other mechanism is ArchSpec::SetArchitecture function, line 928...

I'd say "pc" is fine here; such machines are available for sale (although with a bit scarce availability) as normal power efficient laptops - google for e.g. HP Envy X2, for one that is available with both arm and x86 cpu options.

So, am I correct to assume that "pc" is used/can be used for any "personal computer"? I was under the impression that pc stands for the PCs which are descended/compatible with the original IBM PCs...

I don't really know TBH - in that case it should only be valid on x86... Is there any canonical definition anywhere? Not sure if it has any practical effect anywhere though, other than making the triples different, messing up this case.

I guess the alternative would be to remove line 928 in ArchSpec.cpp. I can test that to see if it fixes the issue later tonight.

Removing line 928 in ArchSpec.cpp or changing it to unknown doesn't seem to help though, so apparently there's something else forcing a pc vendor as well, somewhere.

This revision was automatically updated to reflect the committed changes.