[PATCH] D52050: [Driver] Fix architecture triplets and search paths for Linux x32

Jessica Clarke via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 22 09:52:57 PST 2020


jrtc27 added a comment.

In D52050#2466874 <https://reviews.llvm.org/D52050#2466874>, @glaubitz wrote:

> In D52050#2441164 <https://reviews.llvm.org/D52050#2441164>, @glaubitz wrote:
>
>> In D52050#2441141 <https://reviews.llvm.org/D52050#2441141>, @jrtc27 wrote:
>>
>>> What gets done currently for i386? That suffers potentially the same problem given both /usr/lib/gcc/x86_64-linux-gnu/$V/32 and /usr/lib/gcc/i386-linux-gnu/$V are possible locations for an i386 GCC toolchain.
>>
>> Very good suggestion. I will look into that tomorrow. Thanks for the pointer!
>
> I have been wrapping my head around this for some time and I have run into one problem trying to apply the suggested approach.
>
> The problem is that I don't know how to tell whether I'm on an x86_64 system or an x32 system there is no ```case llvm::Triple::x32:``` which would be needed here (we have it for x86).
>
> x32 takes the switch case for x86_64, so x32 and x86_64 targeting x32 are identical.
>
> However, that's not the same as whether we're on an x86_64 system or on an x32 system determines which GNU triplet to use and which include and library search paths are our primary ones.

But `Triple.getEnvironment()` will give you `llvm::Triple::GNUX32` that you can check?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D52050/new/

https://reviews.llvm.org/D52050



More information about the cfe-commits mailing list