gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] Running Gforth on Mips64el


From: David Kuehling
Subject: Re: [gforth] Running Gforth on Mips64el
Date: Sun, 25 May 2014 05:03:51 +0200

>>>>> "David" == David Kuehling <address@hidden> writes:

> I googled around on the topic and it does not look like something
> usable exists in autoconf.  I think the cleanest way would be to check
> (via configure?) for the corresponding C-compiler #defines.  Of course
> that would have to be implemented for every (supported) machine-type
> and ABI.  I'd volunteer for the MIPS part.  I think the topic would
> also be relevant for at least i386 (i386 vs. X32 ABIs) and ARM (eabi
> vs. oabi, although these are pretty subtile, ABI-CALL may not even
> show any differences).  Maybe amd64 also (windows vs. linux ABI, do
> these have names?)

After some more googeling I think the right approach would be to give
Gforth programs access to the host triplet that defines CPU, OS and ABI.
The autoconf support for detecting host triplet (AC_CANONICAL_HOST [1])
seems to be completely broken and unusable (e.g. it returns
'mips64el-unknown-linux-gnu' for both mipsel and mips64el/N64).  However
'gcc -dumpmachine' seems to reliably give host triplets that encode all
information relevant to code generation:

  mipsel-linux-gnu                (mipsel) 
  mips64el-linux-gnuabi64         (mips64el/N64)
  x86_64-linux-gnu                (amd64)

There seem to be efforts to standardize on host triplets [2], so I'd say
we piggyback on these efforts instead of trying to reinvent the wheel.  

Shall we just expose the full value returned by 'gcc -dumpmachine' or
split it into CPU and OS components as done by AC_CANONICAL_HOST?  In
the examples above cpu would be 'mipsel', 'mips64el', 'x86_64'.
'vendor' would be 'unknown' and OS would be 'linux-gnu', or
'linux-gnuabi64'.

David

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Canonicalizing
[2] https://wiki.debian.org/Multiarch/Tuples 
-- 
GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk2.gpg
Fingerprint: B63B 6AF2 4EEB F033 46F7  7F1D 935E 6F08 E457 205F

Attachment: pgptDjEpSyT2s.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]