gforth
[Top][All Lists]
Advanced

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

Re: Cross compiling


From: Anton Ertl
Subject: Re: Cross compiling
Date: Sun, 28 Feb 2021 19:31:01 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Sun, Feb 28, 2021 at 05:04:16PM +0100, Francesco Ariis wrote:
> Hello forthers,
> 
>     I was reading the manual section on cross-compiling [1], but the
> documentation seems a bit outdated (e.g. `kernl-8086.fi` target is not
> present in my `gforth-0.7.3`).

I think the 8086 files are not distributed in the tarball, but you can
get them from our git <http://git.savannah.gnu.org/cgit/gforth.git/>.

Doing "make kernl-8086.fi" on a recent development version works.

> Generally speaking, how difficult is it to cross compile the interpreter
> for another architecture?
> Can I do that even for older hardware as the Z80 or the Sharp LH79520?

Bernd Paysan can:-) The Sharp LH79520 has an ARM7 core, so you can
generate primitives using gcc, but the system is probably too small
(and without enough POSIX support) for regular Gforth, so you would be
a pioneer in marrying the gcc part of regular Gforth with Gforth EC.
Or maybe you can port Mecrisp Stellaris to it.

> Or would I be better off bootstrapping forth myself in assembly?

It depends on your goals and on your current knowledge.

Assembly language is not a particularly nice way of writing Forth
code, though (and most of a Forth system is written in Forth); OTOH,
it saves you from having to work out Forth cross-compiling if you want
to bootstrap yourself from Forth.  There are three well-known
implementations distributed in assembly language: fig-Forth, Ting's
version of eForth, and JonesForth.  eForth was first developed in
Forth using a cross-compiler and only translated to assembly by Ting.
AFAIK the story for fig-Forth is similar; I don't know about
JonesForth.

Going with eForth might be a better approach than using assembly from
scratch if Gforth EC does not work out for you.

- anton



reply via email to

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