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

Issue with building m68k-toolchain-newlib #43

Open
Retro-Hax opened this issue Dec 1, 2023 · 9 comments
Open

Issue with building m68k-toolchain-newlib #43

Retro-Hax opened this issue Dec 1, 2023 · 9 comments

Comments

@Retro-Hax
Copy link

So the issue is that trying to build the m68k-toolchain-newlib as well as the toolchain without newlib is causing issues due to the server/website certificate being expired it seems.
Here is the log: (i am unsure if you are aware of that so i just thought id point that out just incase you werent)

[retro-hax@archlinux marsdev]$ make m68k-toolchain-newlib
make -C m68k-gcc-toolchain all install INSTALL_DIR=/home/retro-hax/Retro-Hax/Homebrew/MegaDrive/Tools/marsdev/mars/m68k-elf
make[1]: Entering directory '/home/retro-hax/Retro-Hax/Homebrew/MegaDrive/Tools/marsdev/m68k-gcc-toolchain'
--2023-12-01 11:13:44--  https://tenshi.skychase.zone/gcc-13.1.0.tar.xz
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving tenshi.skychase.zone (tenshi.skychase.zone)... 139.162.105.253, 2400:8902::f03c:93ff:fedc:76e0
Connecting to tenshi.skychase.zone (tenshi.skychase.zone)|139.162.105.253|:443... connected.
ERROR: The certificate of ‘tenshi.skychase.zone’ is not trusted.
ERROR: The certificate of ‘tenshi.skychase.zone’ has expired.
The certificate has expired
make[1]: *** [Makefile:132: gcc-13.1.0.tar.xz] Error 5
make[1]: Leaving directory '/home/retro-hax/Retro-Hax/Homebrew/MegaDrive/Tools/marsdev/m68k-gcc-toolchain'
make: *** [Makefile:25: m68k-toolchain-newlib] Error 2
@andwn
Copy link
Owner

andwn commented Dec 1, 2023

Seems the cron job set up to run certbot is no good... should be fixed now.

@Retro-Hax
Copy link
Author

Now it seems to work Thanks!

@Retro-Hax
Copy link
Author

so i installed m68k-toolchain-newlib as well as the sh-toolchain-newlib and i am unable to compile the 32x-skeleton example as it chooses the m68k compiler by default it seems unless i am somehow dumb and doing something wrong

[retro-hax@archlinux 32x-skeleton]$ source /opt/toolchains/mars/mars.sh
[retro-hax@archlinux 32x-skeleton]$ make -j8
/opt/toolchains/mars/m68k-elf/bin/m68k-elf-as -m68000 --register-prefix-optional m68k_crt0.s -o m68k_crt0.bin.o
/opt/toolchains/mars/m68k-elf/bin/m68k-elf-ld -T /opt/toolchains/mars/ldscripts/md.ld -nostdlib --oformat=binary m68k_crt0.bin.o -o m68k_crt0.bin
SHCC src/font.c
SHCC src/32x_images.c
SHCC src/hw_32x.c
MDCC src_md/main.c
SHCC src/main.c
SHAS boot.s
SHCC src/graphics.c
boot.s: Assembler messages:
boot.s:9: Error: file not found: m68k_crt0.bin
boot.s:25: Error: file not found: m68k_crt1.bin
/opt/toolchains/mars/m68k-elf/bin/m68k-elf-ld: cannot open linker script file /opt/toolchains/mars/ldscripts/md.ld: No such file or directory
make: *** [Makefile:152: boot.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:121: m68k_crt0.bin] Error 1
src/graphics.c:3:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
    3 | const static vu8 blankArray[8] = {0};
      | ^~~~~
src_md/main.c:20:33: warning: ‘vdp_ctrl_port’ defined but not used [-Wunused-const-variable=]
   20 | static volatile uint16_t* const vdp_ctrl_port = (uint16_t*) 0xC00004;
      |                                 ^~~~~~~~~~~~~
src_md/main.c:15:33: warning: ‘mars_comm0’ defined but not used [-Wunused-const-variable=]
   15 | static volatile uint16_t* const mars_comm0 = (uint16_t*) 0xA15120;
      |                                 ^~~~~~~~~~
src/32x_images.c: In function ‘drawLzssSprite2’:
src/32x_images.c:255:27: warning: variable ‘yCount’ set but not used [-Wunused-but-set-variable]
  255 |         int colPos,rowPos,yCount,xCount;
src/32x_images.c: In function ‘drawSpriteMaster’:
src/32x_images.c:399:13: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
  399 |         int p=0;
      |             ^
src/32x_images.c:381:170: warning: unused parameter ‘screenWrap’ [-Wunused-parameter]
  381 | int drawSpriteMaster(const vu8 *spriteBuffer, const int16 x, const int16 y, const int xWidth, const int yWidth, const int mirror, const int checkTransparency, const int screenWrap)
      |                                                                                                                                                                ~~~~~~~~~~^~~~~~~~~~
src/main.c: In function ‘handle_input’:
src/main.c:59:24: warning: variable ‘new_buttons’ set but not used [-Wunused-but-set-variable]
   59 |         unsigned short new_buttons, curr_buttons;
      |                        ^~~~~~~~~~~
[retro-hax@archlinux 32x-skeleton]$ ls /opt/toolchains/mars/
m68k-elf  mars.sh  sh-elf

@andwn
Copy link
Owner

andwn commented Dec 1, 2023

Try without -j8

@Retro-Hax
Copy link
Author

does not seem to work :(

[retro-hax@archlinux 32x-skeleton]$ source /opt/toolchains/mars/mars.sh
[retro-hax@archlinux 32x-skeleton]$ make clean
rm -f src_md/main.o   boot.o src/32x_images.o src/font.o src/graphics.o src/hw_32x.o src/main.o src/shared_objects.o src/slave.o src/string.o  src/lzss_decode.o
rm -f m68k_crt0.bin.o m68k_crt1.o m68k_crt0.bin m68k_crt1.bin
rm -f example.32x example.elf symbol.txt
[retro-hax@archlinux 32x-skeleton]$ make
/opt/toolchains/mars/m68k-elf/bin/m68k-elf-as -m68000 --register-prefix-optional m68k_crt0.s -o m68k_crt0.bin.o
/opt/toolchains/mars/m68k-elf/bin/m68k-elf-ld -T /opt/toolchains/mars/ldscripts/md.ld -nostdlib --oformat=binary m68k_crt0.bin.o -o m68k_crt0.bin
/opt/toolchains/mars/m68k-elf/bin/m68k-elf-ld: cannot open linker script file /opt/toolchains/mars/ldscripts/md.ld: No such file or directory
make: *** [Makefile:121: m68k_crt0.bin] Error 1

@dleslie
Copy link
Contributor

dleslie commented Apr 10, 2024

cannot open linker script file /opt/toolchains/mars/ldscripts/md.ld: No such file or directory

I'm trying to resurrect the Docker file and I'm running into this same issue.

@dleslie
Copy link
Contributor

dleslie commented Apr 10, 2024

@Retro-Hax @andwn perhaps it's a problem with -newlib variants?

@andwn
Copy link
Owner

andwn commented Apr 16, 2024

The example is outdated. The ld file from another of the md-* projects can be used until I get around to fixing it

@dleslie
Copy link
Contributor

dleslie commented Aug 4, 2024

@andwn @Retro-Hax FYI, I was able to build a docker container from current master, dleslie/marsdev and got the marsdev and sgdk examples to build almost in their entirety. Only the megawifi example failed because that's an optional, opt-in feature for SGDK.

To give it a shot, just clone this repo and run make. If you have docker installed and you're running from a sh shell you should be able to run it without issues:
https://github.com/dleslie/genesis-dev

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

3 participants