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

Separate the library and the toolchain #105

Open
LukeUsher opened this issue Jan 2, 2018 · 6 comments
Open

Separate the library and the toolchain #105

LukeUsher opened this issue Jan 2, 2018 · 6 comments

Comments

@LukeUsher
Copy link

In order to allow easier updates when using an alternative toolchain, for example, using Linux with the gendev script, I think it would be much more convenient if the SGDK libraries could be in their own repository, separate from the precompiled toolchain binaries. This way it would be possible to integrate SGDK as a sub-module in another repository and keep it synced with upstream.

The current behavior of including windows binaries is nice for Windows users, and could be preserved by providing an SGDK-windows repository that brings in the parent SGDK repository as a submodule, alongside the precompiled tools

@minerscale
Copy link

minerscale commented Jan 2, 2018 via email

@Sentient68k
Copy link

Also a Gendev user here and I think this would be a good idea too.

@doragasu
Copy link

I agree. Even when using Windows, sometimes you might not want to use the compiler included in SGDK (I use other with newlib support).

@doragasu
Copy link

doragasu commented Dec 19, 2021

I am willing to work in this direction and submit pull-requests, but I do not know if @Stephane-D would be interested in merging these kind of changes. Any words about it?

@jagiella
Copy link
Contributor

jagiella commented Jun 22, 2022

I am developing on ubuntu (22.10) and use the default m68k compiler/toolchain from the ubuntu repository (currently version 11.3.0):
sudo apt install gcc-m68k-linux-gnu g++-m68k-linux-gnu

For the build I installed the package of gendev bundling SGDK and another (9.3.0 = in my opinion outdated) m68k toolchain (omitting in favor of ubuntu one).

The SGDK provided Makefile for building roms just needs to be changed for the toolchain part:

BIN := /usr/bin/m68k-linux-gnu-

CC := $(BIN)gcc
CPP := $(BIN)g++
LD := $(BIN)ld
NM := $(BIN)nm
OBJCPY := $(BIN)objcopy

Compiling c and c++ code into a rom worked flawlessly until now. Roms start and run.

So the parts really required from SGDK are:

  • sega.s
  • rom_head.c (as a template)
  • md.ld
  • libgcc.a (optional! can be replaced by ubuntu one: /usr/lib/gcc-cross/m68k-linux-gnu/11/libgcc.a)
  • libmd.a (optional? currently required to build sega.s)

@Stephane-D
Copy link
Owner

@jagiella latest SGDK does already allow toolchain separation with the common.mk file used to define the compiler path.
It should almost work out of the box for you, except maybe the missing g++ binding (it can be added eventually even if SGDK is 100% C for now)

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

6 participants