Page 1 of 1

Has anyone gotten zpugcc to compile?

Posted: Tue Oct 19, 2021 1:27 am
by cathrynmataga
This is needed for Atari800 core, maybe others? On Cygwin it barfs on configure, unable to determine host type. On Linux, I get further, but it fails here.

/usr/bin/ld: cp/except.o: in function `nothrow_libfn_p':
except.c:(.text+0x21c5): undefined reference to `libc_name_p'
collect2: error: ld returned 1 exit status


Is this the right site for this?

https://github.com/zylin/zpugcc

Re: Has anyone gotten zpugcc to compile?

Posted: Tue Oct 19, 2021 4:45 am
by cathrynmataga
Oh wait. There's a release directory with gcc.exe in it for Windows. Going to see if I can build with this next weekend when I get some time.

Re: Has anyone gotten zpugcc to compile?

Posted: Tue Oct 19, 2021 11:45 am
by robinsonb5
cathrynmataga wrote: Tue Oct 19, 2021 1:27 am This is needed for Atari800 core, maybe others? On Cygwin it barfs on configure, unable to determine host type. On Linux, I get further, but it fails here.
I noticed this a few weeks ago (I haven't used the ZPU for a while, and was curious to know how much bit-rot had set in) - I think it's the same problem referenced in this bug:
https://github.com/zylin/zpugcc/issues/10
And if so, there's a solution mentioned towards the end, namely typing

Code: Select all

export CC="gcc -fgnu89-inline"
before starting the build process.

I haven't had a chance to try it yet, though - do please let me know if it works for you.

Re: Has anyone gotten zpugcc to compile?

Posted: Tue Oct 19, 2021 7:41 pm
by robinsonb5
So now I have had a chance to try it, and it does work.
Furthermore there are a few outstanding pull requests to the zpugcc repo. I've applied these to my own fork, and verified that it compiles without error on Ubuntu LTS:
https://github.com/robinsonb5/zpugcc

Re: Has anyone gotten zpugcc to compile?

Posted: Wed Oct 20, 2021 3:40 am
by cathrynmataga
Well, it does build now and it gcc's all the .c files properly but it's failing on ld. I think likely I don't have files the right place, but not sure? Still fussing with this. Wait, I take that back. Instead of copying everything to bin, I put ~/zpugcc/toolchain/install/bin in the path.

Now it's just missing something called 'srec' -- I think I might be close here.

Re: Has anyone gotten zpugcc to compile?

Posted: Wed Oct 20, 2021 4:12 am
by cathrynmataga
It's right here in the Makefile. Not sure what this is or where it comes from.

SREC = srec

%.mif: %.bin
$(SREC) $< -binary -o $@ -mif 32

Re: Has anyone gotten zpugcc to compile?

Posted: Wed Oct 20, 2021 4:27 am
by cathrynmataga
oh wait, found a comment in a log file.

-- http://srecord.sourceforge.net/
--
-- Generated automatically by srec -o --mif
--

Re: Has anyone gotten zpugcc to compile?

Posted: Wed Oct 20, 2021 4:58 am
by cathrynmataga
And fedora includes srecord, but no, there's no 'srec' from this. Fedora includes srecord, which provides srec_cat, srec_info and srec_cmp. Maybe srec_cat is it, but not sure.

Re: Has anyone gotten zpugcc to compile?

Posted: Wed Oct 20, 2021 5:51 am
by cathrynmataga
Oof, and just naively replacing srec with srec_cat actually does succesffuly create zpu_rom_800.mif file. It's 28322 bytes and the original is 28703 bytes. Maybe it worked...