Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth


devel / comp.lang.forth / Re: Building and running gforth-0.2.1 on Debian 11 AMD64

SubjectAuthor
* Building and running gforth-0.2.1 on Debian 11 AMD64Anton Ertl
`* Re: Building and running gforth-0.2.1 on Debian 11 AMD64Brian Fox
 +* Re: Building and running gforth-0.2.1 on Debian 11 AMD64Hans Bezemer
 |`* Re: Building and running gforth-0.2.1 on Debian 11 AMD64Brian Fox
 | +* Re: Building and running gforth-0.2.1 on Debian 11 AMD64dxforth
 | |+- Re: Building and running gforth-0.2.1 on Debian 11 AMD64Brian Fox
 | |`* Re: Building and running gforth-0.2.1 on Debian 11 AMD64none
 | | `- Re: Building and running gforth-0.2.1 on Debian 11 AMD64Brian Fox
 | `- Re: Building and running gforth-0.2.1 on Debian 11 AMD64Hans Bezemer
 +* Re: Building and running gforth-0.2.1 on Debian 11 AMD64Stephen Pelc
 |`- Re: Building and running gforth-0.2.1 on Debian 11 AMD64Brian Fox
 `* Re: Building and running gforth-0.2.1 on Debian 11 AMD64Anton Ertl
  `- Re: Building and running gforth-0.2.1 on Debian 11 AMD64Brian Fox

1
Building and running gforth-0.2.1 on Debian 11 AMD64

<2022May2.194432@mips.complang.tuwien.ac.at>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17788&group=comp.lang.forth#17788

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Building and running gforth-0.2.1 on Debian 11 AMD64
Date: Mon, 02 May 2022 17:44:32 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 29
Message-ID: <2022May2.194432@mips.complang.tuwien.ac.at>
Injection-Info: reader02.eternal-september.org; posting-host="67bf3c9f3c5f566b32e4161ec27af61c";
logging-data="16127"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PMmyopaR4dHyQKrpczTOR"
Cancel-Lock: sha1:zfR8Kf+WLYBNkE889NezrrDRVcc=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Mon, 2 May 2022 17:44 UTC

For some reason I wanted to run gforth-0.2.1 (from 1996). My old
binary no longer works (it's an a.out binary), so I had a go at
rebuilding it. And I got it to work, and in 64-bit mode, too (AMD64
only appeared in 2003, but we had already ported Gforth to the Alpha
when we released 0.2.1).

Here's how I built it:

../configure
make

That's just what the documentation says. Running it is a little more
involved, though. From the build directory:

setarch `uname -m` -R ./gforth -p.

The "setarch -R" is there to disable ASLR (gforth-0.2.1 was released
shortly before that became fashionable), the "-p." is there so it
takes the gforth.fi image from the build directory rather than the
32-bit image that I have installed elsewhere.

That was surprisingly painless.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17789&group=comp.lang.forth#17789

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:e102:0:b0:69f:8463:cbdd with SMTP id c2-20020a37e102000000b0069f8463cbddmr13129404qkm.766.1651605661600;
Tue, 03 May 2022 12:21:01 -0700 (PDT)
X-Received: by 2002:a05:622a:606:b0:2f3:9740:d80b with SMTP id
z6-20020a05622a060600b002f39740d80bmr16545089qta.166.1651605661423; Tue, 03
May 2022 12:21:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 3 May 2022 12:21:01 -0700 (PDT)
In-Reply-To: <2022May2.194432@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fea8:2a60:9ae:467:f691:b073:ca00;
posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 2607:fea8:2a60:9ae:467:f691:b073:ca00
References: <2022May2.194432@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
From: brian....@brianfox.ca (Brian Fox)
Injection-Date: Tue, 03 May 2022 19:21:01 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 34
 by: Brian Fox - Tue, 3 May 2022 19:21 UTC

On Monday, May 2, 2022 at 1:53:38 PM UTC-4, Anton Ertl wrote:
> For some reason I wanted to run gforth-0.2.1 (from 1996). My old
> binary no longer works (it's an a.out binary), so I had a go at
> rebuilding it. And I got it to work, and in 64-bit mode, too (AMD64
> only appeared in 2003, but we had already ported Gforth to the Alpha
> when we released 0.2.1).
>
> Here's how I built it:
>
> ./configure
> make
>
> That's just what the documentation says. Running it is a little more
> involved, though. From the build directory:
>
> setarch `uname -m` -R ./gforth -p.
>
> The "setarch -R" is there to disable ASLR (gforth-0.2.1 was released
> shortly before that became fashionable), the "-p." is there so it
> takes the gforth.fi image from the build directory rather than the
> 32-bit image that I have installed elsewhere.
>
> That was surprisingly painless.
>
> - anton
> --

This makes me want to ask the group a question.
If you have a program that you build with a Forth cross-compiler, how
do you provide the user with the type of compiler switches that Anton
is demonstrating?

I have typically just written a Forth "script" to control everything but
command line switches are pretty convenient . I am curious how
others people handle this in a Forth cross-compiler environment.

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17790&group=comp.lang.forth#17790

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:e102:0:b0:69f:8463:cbdd with SMTP id c2-20020a37e102000000b0069f8463cbddmr13523977qkm.766.1651613377389;
Tue, 03 May 2022 14:29:37 -0700 (PDT)
X-Received: by 2002:a05:620a:17ac:b0:69e:b8d5:3fd2 with SMTP id
ay44-20020a05620a17ac00b0069eb8d53fd2mr13693000qkb.227.1651613377248; Tue, 03
May 2022 14:29:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 3 May 2022 14:29:37 -0700 (PDT)
In-Reply-To: <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <2022May2.194432@mips.complang.tuwien.ac.at> <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Tue, 03 May 2022 21:29:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 27
 by: Hans Bezemer - Tue, 3 May 2022 21:29 UTC

On Tuesday, May 3, 2022 at 9:21:02 PM UTC+2, Brian Fox wrote:
> This makes me want to ask the group a question.
> If you have a program that you build with a Forth cross-compiler, how
> do you provide the user with the type of compiler switches that Anton
> is demonstrating?
>
> I have typically just written a Forth "script" to control everything but
> command line switches are pretty convenient . I am curious how
> others people handle this in a Forth cross-compiler environment.

I've cross-compiled 4tH on more platforms than I care to count. In general,
it's not difficult. It merely depends on the platform. I have "about" two platforms,
Microschoft based and *Nix based.

It merely concentrates on things like directory separators and the odd popen() call.
Predefined #macros figure most of that stuff out, like __GNU__, __TURBO_C__,
__WIN32__, etc.

Then there is embedded bytecode, which comes in two versions, 32bit and 64bit.
When *not* cross compiling, the Makefile can figure out how to build these. It requires
a "dummy", intermediate compiler (which "make" creates as well) which is discarded
later.

Since the generated files are ordinary, valid C files, cross compilation just requires
inclusion of these files - and all will be fine. No "dummy" compiler needed.

Hans Bezemer

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<40708e60-bd6c-49b9-9a97-539cb8de3aa8n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17791&group=comp.lang.forth#17791

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:5754:0:b0:2e1:eee8:be0b with SMTP id 20-20020ac85754000000b002e1eee8be0bmr16896091qtx.349.1651617974881;
Tue, 03 May 2022 15:46:14 -0700 (PDT)
X-Received: by 2002:a05:6214:d85:b0:449:96f7:6194 with SMTP id
e5-20020a0562140d8500b0044996f76194mr15669151qve.48.1651617974705; Tue, 03
May 2022 15:46:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Tue, 3 May 2022 15:46:14 -0700 (PDT)
In-Reply-To: <c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=99.242.210.36; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 99.242.210.36
References: <2022May2.194432@mips.complang.tuwien.ac.at> <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
<c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <40708e60-bd6c-49b9-9a97-539cb8de3aa8n@googlegroups.com>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
From: brian....@brianfox.ca (Brian Fox)
Injection-Date: Tue, 03 May 2022 22:46:14 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 27
 by: Brian Fox - Tue, 3 May 2022 22:46 UTC

On Tuesday, May 3, 2022 at 5:29:38 PM UTC-4, the.bee...@gmail.com wrote:

> It merely concentrates on things like directory separators and the odd popen() call.
> Predefined #macros figure most of that stuff out, like __GNU__, __TURBO_C__,
> __WIN32__, etc.
>
> Then there is embedded bytecode, which comes in two versions, 32bit and 64bit.
> When *not* cross compiling, the Makefile can figure out how to build these. It requires
> a "dummy", intermediate compiler (which "make" creates as well) which is discarded
> later.
>
> Since the generated files are ordinary, valid C files, cross compilation just requires
> inclusion of these files - and all will be fine. No "dummy" compiler needed.
>
> Hans Bezemer

That part I am clear on. (at least until I find my next bug) :-)
But do you use the O/S command line typically ?
Do you use "compiler switches" on the command line? ( Like -R -o2 and the rest)

For example my hobby cross-compiler is used like this:

c:> XFC99 FLOAD CC9900\SRC.ITC\FORTHITC.MAK

But I don't provide the user with any way to switch what will happen on the
command line. Once the compiler begins reading the file it just runs.

Just wondering if that is ever done with Forth.

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<t4sk0g$2hb$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17792&group=comp.lang.forth#17792

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
Date: Wed, 4 May 2022 11:13:52 +1000
Organization: Aioe.org NNTP Server
Message-ID: <t4sk0g$2hb$1@gioia.aioe.org>
References: <2022May2.194432@mips.complang.tuwien.ac.at>
<be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
<c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com>
<40708e60-bd6c-49b9-9a97-539cb8de3aa8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="2603"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.8.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: dxforth - Wed, 4 May 2022 01:13 UTC

On 4/05/2022 08:46, Brian Fox wrote:
>
> That part I am clear on. (at least until I find my next bug) :-)
> But do you use the O/S command line typically ?
> Do you use "compiler switches" on the command line? ( Like -R -o2 and the rest)
>
> For example my hobby cross-compiler is used like this:
>
> c:> XFC99 FLOAD CC9900\SRC.ITC\FORTHITC.MAK
>
> But I don't provide the user with any way to switch what will happen on the
> command line. Once the compiler begins reading the file it just runs.
>
> Just wondering if that is ever done with Forth.

Not that I've seen. 'command line and switch' being an OS-related feature
may exist or not. Typically what one finds in forth is a 'load block'
(however that is implemented) and 'electives' i.e. blocks of code it loads
or not. One might call it a 'make' file. Whether it's worth adding command-
line control depends on number of variables/targets etc. IIRC Moore said
didn't care for 'conditional compilation' as being an unnecessary complication.
YMMV

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<t4tgl8$d0v$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17793&group=comp.lang.forth#17793

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: step...@vfxforth.com (Stephen Pelc)
Newsgroups: comp.lang.forth
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
Date: Wed, 4 May 2022 09:22:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <t4tgl8$d0v$1@dont-email.me>
References: <2022May2.194432@mips.complang.tuwien.ac.at> <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 4 May 2022 09:22:48 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="19f95033a0d40cb72dc50a2b620a79ce";
logging-data="13343"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tV5N3pdKiz9utOd4FUjsV"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:bQMB5bKJbs4tYOKMKY/HT5sciSk=
X-Usenapp: v1.19/l - Full License
 by: Stephen Pelc - Wed, 4 May 2022 09:22 UTC

On 3 May 2022 at 21:21:01 CEST, "Brian Fox" <brian.fox@brianfox.ca> wrote:

> If you have a program that you build with a Forth cross-compiler, how
> do you provide the user with the type of compiler switches that Anton
> is demonstrating?
>
> I have typically just written a Forth "script" to control everything but
> command line switches are pretty convenient . I am curious how
> others people handle this in a Forth cross-compiler environment.

Firstly, a cross compiler is a Forth app and its tools are only buried by
vocabulary/wordlist selection.

Secondly.most cross compilers support EQU, e.g
5 EQU MACHINE-TYPE
An equ is a constant that uses no target space and is ideal for
defining target switches. The MPE compiler has switches such
as
TASKING? \ true for multitasking
FAST-CMOVE? \ true for huge but fast CMOVE
as well as configuration values such as
SP-SIZE \ data stack size

The words available during interpretation include directives that
can change configuration.

Fine names/paths can also be used with macros, e.g.
ms" myproj/%arch%/floats.fth"
where %arch% may give x86 or x64 or ARM32 or ARM64.
Text Macros are also available in hosted systems.

The tools are designed with the knowledge that they will be
used in a cross-compiler. The techniques can be mixed as required.
The following programs the target Flash after compilation.

\ Define device, speed (0=auto) and project file
\ Download the target image when compilation finishes
jlink LPC4078 0 Project.jlink \ JLINK and device setup
useSWD \ use SWD rather than the
default JTAG
-download-prompts \ no prompting for download
afterwards download-sections \ download image after completion.

--
Stephen Pelc, stephen@vfxforth.com
MicroProcessor Engineering, Ltd. - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612, +34 649 662 974
http://www.mpeforth.com - free VFX Forth downloads

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<7732aa47-b1b0-4461-a870-83c8e25c0a7en@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17795&group=comp.lang.forth#17795

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:258e:b0:680:f33c:dbcd with SMTP id x14-20020a05620a258e00b00680f33cdbcdmr16331339qko.542.1651667924862;
Wed, 04 May 2022 05:38:44 -0700 (PDT)
X-Received: by 2002:a05:620a:444b:b0:69f:f94e:78f6 with SMTP id
w11-20020a05620a444b00b0069ff94e78f6mr7913603qkp.742.1651667924685; Wed, 04
May 2022 05:38:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Wed, 4 May 2022 05:38:44 -0700 (PDT)
In-Reply-To: <40708e60-bd6c-49b9-9a97-539cb8de3aa8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.174.47.232; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 77.174.47.232
References: <2022May2.194432@mips.complang.tuwien.ac.at> <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
<c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com> <40708e60-bd6c-49b9-9a97-539cb8de3aa8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7732aa47-b1b0-4461-a870-83c8e25c0a7en@googlegroups.com>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Wed, 04 May 2022 12:38:44 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: Hans Bezemer - Wed, 4 May 2022 12:38 UTC

On Wednesday, May 4, 2022 at 12:46:15 AM UTC+2, Brian Fox wrote:
> Do you use "compiler switches" on the command line? ( Like -R -o2 and the rest)
> Just wondering if that is ever done with Forth.

Just the usual suspects, like -O3, -fsigned-char (yeah, I know - ported TC2 code),
-s, -L., -I., -o, -l4th, -Wall, the occasional -D to force specific behavior.

Nothing special or fancy. And no - the user gets to choose his Makefile. Unless
he goes editing that one himself, he's got not much of a choice.

Hans Bezemer

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<2022May4.164057@mips.complang.tuwien.ac.at>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17796&group=comp.lang.forth#17796

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ant...@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups: comp.lang.forth
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
Date: Wed, 04 May 2022 14:40:57 GMT
Organization: Institut fuer Computersprachen, Technische Universitaet Wien
Lines: 51
Message-ID: <2022May4.164057@mips.complang.tuwien.ac.at>
References: <2022May2.194432@mips.complang.tuwien.ac.at> <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
Injection-Info: reader02.eternal-september.org; posting-host="d5a190789c99223a639c94656f95f0f9";
logging-data="6493"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19O8Gdn1vyXlH8LV/Moo4tW"
Cancel-Lock: sha1:N/xnC0+x1kjTQVYgnsiZOLe9iiQ=
X-newsreader: xrn 10.00-beta-3
 by: Anton Ertl - Wed, 4 May 2022 14:40 UTC

Brian Fox <brian.fox@brianfox.ca> writes:
>On Monday, May 2, 2022 at 1:53:38 PM UTC-4, Anton Ertl wrote:
>> For some reason I wanted to run gforth-0.2.1 (from 1996). My old
>> binary no longer works (it's an a.out binary), so I had a go at
>> rebuilding it. And I got it to work, and in 64-bit mode, too (AMD64
>> only appeared in 2003, but we had already ported Gforth to the Alpha
>> when we released 0.2.1).
>>
>> Here's how I built it:
>>
>> ./configure
>> make
>>
>> That's just what the documentation says. Running it is a little more
>> involved, though. From the build directory:
>>
>> setarch `uname -m` -R ./gforth -p.
>>
>> The "setarch -R" is there to disable ASLR (gforth-0.2.1 was released
>> shortly before that became fashionable), the "-p." is there so it
>> takes the gforth.fi image from the build directory rather than the
>> 32-bit image that I have installed elsewhere.

And the `unane -m` is unnecessary.

>This makes me want to ask the group a question.
>If you have a program that you build with a Forth cross-compiler, how
>do you provide the user with the type of compiler switches that Anton
>is demonstrating?
>
>I have typically just written a Forth "script" to control everything but
>command line switches are pretty convenient . I am curious how
>others people handle this in a Forth cross-compiler environment.

Most Forth systems allow putting Forth code on the OS command line, so
you can mix between having some parameters in a configuration file,
and some on the OS command line.

That being said, gforth usually passes a configuration file name on
the command line, but not individual parameters, e.g.:

../preforth -p ".:~+:." -e 's" arch/8086/mach.fs" include ./kernel-ec/main.fs' -e "save-cross kernl-8086.fi- /usr/local/bin/gforth-0.7.9_20220428 bye"

The configuration file is arch/8086/mach.fs.

- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2021: https://euro.theforth.net/2021

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<a2f2873f-414a-4d3a-b598-ff1a815f2ddan@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17812&group=comp.lang.forth#17812

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:5cb:b0:2f3:a081:e470 with SMTP id d11-20020a05622a05cb00b002f3a081e470mr20805686qtb.58.1651761772030;
Thu, 05 May 2022 07:42:52 -0700 (PDT)
X-Received: by 2002:a05:6214:e63:b0:45a:a61b:4aee with SMTP id
jz3-20020a0562140e6300b0045aa61b4aeemr10911661qvb.117.1651761771856; Thu, 05
May 2022 07:42:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 5 May 2022 07:42:51 -0700 (PDT)
In-Reply-To: <t4tgl8$d0v$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=99.242.210.36; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 99.242.210.36
References: <2022May2.194432@mips.complang.tuwien.ac.at> <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
<t4tgl8$d0v$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a2f2873f-414a-4d3a-b598-ff1a815f2ddan@googlegroups.com>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
From: brian....@brianfox.ca (Brian Fox)
Injection-Date: Thu, 05 May 2022 14:42:52 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 45
 by: Brian Fox - Thu, 5 May 2022 14:42 UTC

On Wednesday, May 4, 2022 at 5:22:50 AM UTC-4, Stephen Pelc wrote:

> Secondly.most cross compilers support EQU, e.g
> 5 EQU MACHINE-TYPE
> An equ is a constant that uses no target space and is ideal for
> defining target switches. The MPE compiler has switches such
> as
> TASKING? \ true for multitasking
> FAST-CMOVE? \ true for huge but fast CMOVE
> as well as configuration values such as
> SP-SIZE \ data stack size
>
> The words available during interpretation include directives that
> can change configuration.
>
> Fine names/paths can also be used with macros, e.g.
> ms" myproj/%arch%/floats.fth"
> where %arch% may give x86 or x64 or ARM32 or ARM64.
> Text Macros are also available in hosted systems.
>
> The tools are designed with the knowledge that they will be
> used in a cross-compiler. The techniques can be mixed as required.
> The following programs the target Flash after compilation.
>
> \ Define device, speed (0=auto) and project file
> \ Download the target image when compilation finishes
> jlink LPC4078 0 Project.jlink \ JLINK and device setup
> useSWD \ use SWD rather than the
> default JTAG
> -download-prompts \ no prompting for download
> afterwards download-sections \ download image after completion.
>
>
> --
> Stephen Pelc, ste...@vfxforth.com
> MicroProcessor Engineering, Ltd. - More Real, Less Time
> 133 Hill Lane, Southampton SO15 5AF, England
> tel: +44 (0)23 8063 1441, +44 (0)78 0390 3612, +34 649 662 974
> http://www.mpeforth.com - free VFX Forth downloads

OK. So that's is what I have done as well.
I used VALUE definitions in the COMPILER vocabulary rather than EQU.
I can do that because VALUE is not in the final target Camel Forth at this time.
I may re-think that when the time comes.

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<348aa8cd-c093-4653-9e96-e2c4479eaaf3n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17813&group=comp.lang.forth#17813

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:4488:b0:6a0:2aab:a736 with SMTP id x8-20020a05620a448800b006a02aaba736mr2858889qkp.717.1651762106027;
Thu, 05 May 2022 07:48:26 -0700 (PDT)
X-Received: by 2002:a05:620a:6c8:b0:69c:7adc:7370 with SMTP id
8-20020a05620a06c800b0069c7adc7370mr19419491qky.49.1651762105854; Thu, 05 May
2022 07:48:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 5 May 2022 07:48:25 -0700 (PDT)
In-Reply-To: <2022May4.164057@mips.complang.tuwien.ac.at>
Injection-Info: google-groups.googlegroups.com; posting-host=99.242.210.36; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 99.242.210.36
References: <2022May2.194432@mips.complang.tuwien.ac.at> <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
<2022May4.164057@mips.complang.tuwien.ac.at>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <348aa8cd-c093-4653-9e96-e2c4479eaaf3n@googlegroups.com>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
From: brian....@brianfox.ca (Brian Fox)
Injection-Date: Thu, 05 May 2022 14:48:26 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: Brian Fox - Thu, 5 May 2022 14:48 UTC

On Wednesday, May 4, 2022 at 11:01:52 AM UTC-4, Anton Ertl wrote:

> Most Forth systems allow putting Forth code on the OS command line, so
> you can mix between having some parameters in a configuration file,
> and some on the OS command line.
>
> That being said, gforth usually passes a configuration file name on
> the command line, but not individual parameters, e.g.:
>
> ./preforth -p ".:~+:." -e 's" arch/8086/mach.fs" include ./kernel-ec/main.fs' -e "save-cross kernl-8086.fi- /usr/local/bin/gforth-0.7.9_20220428 bye"
>
> The configuration file is arch/8086/mach.fs.

Ok, so you have both. That's what I was wondering about.
You demonstrate more command line control than I would ever need for the single target I play with. :-)
I will take a look at that configuration file.

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<ffa0a84f-8734-43eb-92b3-f754ab93e56dn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17814&group=comp.lang.forth#17814

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:c64:b0:449:7011:569d with SMTP id t4-20020a0562140c6400b004497011569dmr22038478qvj.90.1651762731317;
Thu, 05 May 2022 07:58:51 -0700 (PDT)
X-Received: by 2002:a37:9bcb:0:b0:69f:f3a7:4cab with SMTP id
d194-20020a379bcb000000b0069ff3a74cabmr12815651qke.457.1651762731129; Thu, 05
May 2022 07:58:51 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Thu, 5 May 2022 07:58:50 -0700 (PDT)
In-Reply-To: <t4sk0g$2hb$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=99.242.210.36; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 99.242.210.36
References: <2022May2.194432@mips.complang.tuwien.ac.at> <be40a9d8-ccd4-4b68-94ad-43162dce6c5dn@googlegroups.com>
<c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com> <40708e60-bd6c-49b9-9a97-539cb8de3aa8n@googlegroups.com>
<t4sk0g$2hb$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ffa0a84f-8734-43eb-92b3-f754ab93e56dn@googlegroups.com>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
From: brian....@brianfox.ca (Brian Fox)
Injection-Date: Thu, 05 May 2022 14:58:51 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 18
 by: Brian Fox - Thu, 5 May 2022 14:58 UTC

On Tuesday, May 3, 2022 at 9:13:55 PM UTC-4, dxforth wrote:
> Not that I've seen. 'command line and switch' being an OS-related feature
> may exist or not. Typically what one finds in forth is a 'load block'
> (however that is implemented) and 'electives' i.e. blocks of code it loads
> or not. One might call it a 'make' file. Whether it's worth adding command-
> line control depends on number of variables/targets etc. IIRC Moore said
> didn't care for 'conditional compilation' as being an unnecessary complication.
> YMMV

No question, in a traditional block based Forth I would do the same.

I am in my cross-compiler environment build on a Forth system that uses
text files.
LOL. So HsForth (1994) heavily modified, makes another Retro Forth.

I opted to make the cross-compiler into a saved system program
and kick it off from the command line with a file path.

Thus the question on industry practice.

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<nnd$67e9cd3f$7917b5b7@ec24ded40436de7c>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17831&group=comp.lang.forth#17831

 copy link   Newsgroups: comp.lang.forth
Newsgroups: comp.lang.forth
References: <2022May2.194432@mips.complang.tuwien.ac.at> <c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com> <40708e60-bd6c-49b9-9a97-539cb8de3aa8n@googlegroups.com> <t4sk0g$2hb$1@gioia.aioe.org>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: alb...@cherry (none)
Originator: albert@cherry.(none) (albert)
Message-ID: <nnd$67e9cd3f$7917b5b7@ec24ded40436de7c>
Organization: KPN B.V.
Date: Sat, 07 May 2022 20:39:12 +0200
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 57
Injection-Date: Sat, 07 May 2022 20:39:12 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2965
 by: none - Sat, 7 May 2022 18:39 UTC

In article <t4sk0g$2hb$1@gioia.aioe.org>, dxforth <dxforth@gmail.com> wrote:
>On 4/05/2022 08:46, Brian Fox wrote:
>>
>> That part I am clear on. (at least until I find my next bug) :-)
>> But do you use the O/S command line typically ?
>> Do you use "compiler switches" on the command line? ( Like -R -o2 and the rest)
>>
>> For example my hobby cross-compiler is used like this:
>>
>> c:> XFC99 FLOAD CC9900\SRC.ITC\FORTHITC.MAK
>>
>> But I don't provide the user with any way to switch what will happen on the
>> command line. Once the compiler begins reading the file it just runs.
>>
>> Just wondering if that is ever done with Forth.
>
>Not that I've seen. 'command line and switch' being an OS-related feature
>may exist or not. Typically what one finds in forth is a 'load block'
>(however that is implemented) and 'electives' i.e. blocks of code it loads
>or not. One might call it a 'make' file. Whether it's worth adding command-
>line control depends on number of variables/targets etc. IIRC Moore said
>didn't care for 'conditional compilation' as being an unnecessary complication.
>YMMV

I have turnkey manx. You run it with (bitbanging the parallel port)

tmanx song.sco

If you are on linux machine with no parallel port, I purchased a
ser/par board on pci, now that parallel port is on C030.

In linux I do now

tmanx -p C030 song.sco

-p is a regular Forth word, say

\ Execute the only option in existance -p : set the port
: -p SHIFT-ARGS 1 ARG[] HEX EVALUATE ATTACH-PARALLEL-PORT DECIMAL
SHIFT-ARGS ;

\ Handle all options
: MANX-OPTIONS ARGC 1 > IF 1 ARG[] DROP C@ &- = IF -p THEN THEN ;

Prerequisites are ARG[] ARGC and SHIFT-ARGS. These are left as an
exercise for the reader. (Hint:it fits in one screen, with space
to spare for environment stuff)

Groetjes Albert

In MS-Windows I could define /p instead of -p.
--
"in our communism country Viet Nam, people are forced to be
alive and in the western country like US, people are free to
die from Covid 19 lol" duc ha
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

Re: Building and running gforth-0.2.1 on Debian 11 AMD64

<83d7afac-5607-44d2-9eb0-df28486ec7c6n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17832&group=comp.lang.forth#17832

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:fd8d:0:b0:456:3481:603c with SMTP id p13-20020a0cfd8d000000b004563481603cmr10125278qvr.69.1652018597407;
Sun, 08 May 2022 07:03:17 -0700 (PDT)
X-Received: by 2002:ae9:eb8d:0:b0:69f:c005:265d with SMTP id
b135-20020ae9eb8d000000b0069fc005265dmr8644186qkg.764.1652018597173; Sun, 08
May 2022 07:03:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 8 May 2022 07:03:17 -0700 (PDT)
In-Reply-To: <nnd$67e9cd3f$7917b5b7@ec24ded40436de7c>
Injection-Info: google-groups.googlegroups.com; posting-host=99.242.210.36; posting-account=2z7GawoAAADc70p5SM5AbaCyzjLblS3g
NNTP-Posting-Host: 99.242.210.36
References: <2022May2.194432@mips.complang.tuwien.ac.at> <c672e87e-aa93-4d58-aafc-2630366e05dbn@googlegroups.com>
<40708e60-bd6c-49b9-9a97-539cb8de3aa8n@googlegroups.com> <t4sk0g$2hb$1@gioia.aioe.org>
<nnd$67e9cd3f$7917b5b7@ec24ded40436de7c>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <83d7afac-5607-44d2-9eb0-df28486ec7c6n@googlegroups.com>
Subject: Re: Building and running gforth-0.2.1 on Debian 11 AMD64
From: brian....@brianfox.ca (Brian Fox)
Injection-Date: Sun, 08 May 2022 14:03:17 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Brian Fox - Sun, 8 May 2022 14:03 UTC

On Saturday, May 7, 2022 at 2:39:15 PM UTC-4, none albert wrote:
> In article <t4sk0g$2hb$1...@gioia.aioe.org>, dxforth <dxf...@gmail.com> wrote:
> >On 4/05/2022 08:46, Brian Fox wrote:
> >>
> >> That part I am clear on. (at least until I find my next bug) :-)
> >> But do you use the O/S command line typically ?
> >> Do you use "compiler switches" on the command line? ( Like -R -o2 and the rest)
> >>
> >> For example my hobby cross-compiler is used like this:
> >>
> >> c:> XFC99 FLOAD CC9900\SRC.ITC\FORTHITC.MAK
> >>
> >> But I don't provide the user with any way to switch what will happen on the
> >> command line. Once the compiler begins reading the file it just runs.
> >>
> >> Just wondering if that is ever done with Forth.
> >
> >Not that I've seen. 'command line and switch' being an OS-related feature
> >may exist or not. Typically what one finds in forth is a 'load block'
> >(however that is implemented) and 'electives' i.e. blocks of code it loads
> >or not. One might call it a 'make' file. Whether it's worth adding command-
> >line control depends on number of variables/targets etc. IIRC Moore said
> >didn't care for 'conditional compilation' as being an unnecessary complication.
> >YMMV
> I have turnkey manx. You run it with (bitbanging the parallel port)
>
> tmanx song.sco
>
> If you are on linux machine with no parallel port, I purchased a
> ser/par board on pci, now that parallel port is on C030.
>
> In linux I do now
>
> tmanx -p C030 song.sco
>
> -p is a regular Forth word, say
>
> \ Execute the only option in existance -p : set the port
> : -p SHIFT-ARGS 1 ARG[] HEX EVALUATE ATTACH-PARALLEL-PORT DECIMAL
> SHIFT-ARGS ;
>
> \ Handle all options
> : MANX-OPTIONS ARGC 1 > IF 1 ARG[] DROP C@ &- = IF -p THEN THEN ;
>
> Prerequisites are ARG[] ARGC and SHIFT-ARGS. These are left as an
> exercise for the reader. (Hint:it fits in one screen, with space
> to spare for environment stuff)
>
> Groetjes Albert
>
> In MS-Windows I could define /p instead of -p.
> --
> "in our communism country Viet Nam, people are forced to be
> alive and in the western country like US, people are free to
> die from Covid 19 lol" duc ha
> albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

That's exactly the kind of thing I was thinking about.
Adding compiling control words that are sent to the job via the command line.
So I am not totally crazy. OK, maybe a little.
I will move along these lines. If I ever give this cross-compiler to the wider
hobbyist world it's probably easier to adopt if I provide some familiar
concepts.

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor