Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes on compiling preForth on Ubuntu 2404LTS #18

Open
cstrotm opened this issue Jun 13, 2024 · 2 comments
Open

Notes on compiling preForth on Ubuntu 2404LTS #18

cstrotm opened this issue Jun 13, 2024 · 2 comments

Comments

@cstrotm
Copy link

cstrotm commented Jun 13, 2024

I was able to compile PreForth and seedForth under Ubuntu 24.04LTS with these steps:

apt install emacs-nox git build-essential tmux fasm gforth
dpkg --add-architecture i386
apt update
apt install libc6-dev-i386

git clone https://github.com/uho/preForth
cd preForth/src

edit Makefile and change the "ld" linker command to:

# assemble and link executable on linux
%.Linux: %.asm
        fasm $< [email protected]
        LDEMULATION=elf_i386 ld -melf_i386  -o $@ \
           -dynamic-linker /lib32/ld-linux.so.2 \
           /usr/lib32/crt1.o /usr/lib32/crti.o \
           [email protected] \
           -lc /usr/lib32/crtn.o
        # rm [email protected]  

Then compile:

make clean
make

and start seedForth

./seed
..................................................
.
seedForth/interactive 2.2.0
---------------------------
380005 bytes free
0 echo ! 0 input-echo !
⓪
①
......................
ready
② ......
③ .....
➍


The 10001 st prime is 104743
Adjust your terminal to have 1 lines.
Δ has codepoint 916
Δ..
Interactive decompiler: Use single letter commands n d l c b s

ok: if line, ok: next line
ok: else line, ok: other line
ok: afterwords .
18 headers removed

Welcome!  ok 
>   ok 
>   ok 
>
@znmeb
Copy link

znmeb commented Jun 13, 2024

Ah ... the trick is to have the i386 headers - that's why it didn't work here. Thanks!!

@znmeb
Copy link

znmeb commented Jun 13, 2024

OK - I have it compiling but it segfaulted - I'll try with gdb tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants