On Tue, Jan 22, 2019 at 12:15 PM Jakub Jelinek <ja...@redhat.com> wrote: > > On Tue, Jan 22, 2019 at 12:01:29PM +0100, Martin Liška wrote: > > I discussed with Jakub possibility of generating canonical triples that will > > be then used in Fortran FE to filter the 'GCC$ builtin' directives. However, > > the approach bring some possibilities and thus I enhanced the previous > > version of patch to catch x32 ABI (I call it lp64ilp32), similarly to > > Debian: > > lp64ilp32 makes no sense. long and pointer are 64-bit and integer, long and > pointer are 32-bit? That is impossible. Both ia32 and x32 are ilp32. > > What I was suggesting is either use normalized tuples like Debian > multi-arch, but as it would be exposed to users on all targets, it would > need to be something done for all targets. My suggestion was start with > the canonical triplet and adjust it for multilibs in a target hook if > needed. So, e.g. in config/i386, it would replace the first part of the > triplet with x86_64 if not ia32, if ia32 with i386, and append x32 to the > triplet if x32. For e.g. rs6000, it could modify the first part of the > triplet to powerpc{,64}{,le} depending on endianity and if it is 64-bit ABI > or not. For aarch64 it would modify the first part of the triplet to > aarch64{,be} depending on endianity, and append _ilp32 if 32-bit ABI, etc. > > Or instead just come up with target specific strings to determine the ABI, > say i386, x86_64 and x32 for the 3 ABIs on x86, powerpc{,64}{,le} on rs6000 > etc.
Yeah, I would even suggest to use a target hook multilib_ABI_active_p (const char *) for this ... (where the hook should diagnose unknown multilib specifiers). Richard. > Jakub