Jo Engine Forum

Sega Saturn Development => General Jo Engine Help => Topic started by: Xavi92 on October 22, 2017, 04:32:17 am

Title: Compiling Jo Engine under GCC 7.2.0
Post by: Xavi92 on October 22, 2017, 04:32:17 am
Hi there,

I heard about your game engine a few days ago thanks to the guys in Sega Saturno forums. As a Linux user, I was a bit puzzled when the README file suggested me to use Wine, so I recompiled GCC version 7.2.0 for the sh-elf target (Jo Engine originally is meant for sh-coff, which seems to be currently deprecated). Surprisingly though, Jo Engine could be easily compiled, but when linking "demo1" against libjoengine.a and SGL libs, GCC complains about not finding "-lc" (standard C library). I haven't extensively read JoEngine's source code, but is it actually supposed to use libc? If so, where can I find an implementation for it?

Thanks for reading.
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: mindslight on October 23, 2017, 09:33:20 am
Hi Xavi92,

I'll check that :)
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: Xavi92 on November 02, 2017, 02:50:25 pm
Hi,
Any news on this topic? :)
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: mindslight on November 02, 2017, 04:00:59 pm
Can you give me links with your compiled version of GCC ? I will test it asap
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: mindslight on November 03, 2017, 07:07:29 am
Hi, forget the link, I forget that you are a Linux user. I'll try to check this weekend
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: neoraph on February 07, 2018, 05:16:12 am
Hello  :)

Any news about that question?

I am working on a Mac, and I wonder to use a docker image based on a linux (probably debian) and if I can use the latest gcc, it should be nice :)
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: mindslight on February 07, 2018, 08:23:08 am
Hi, I'm sorry, I don't have enough time to work on the Engine today, but It will change. I hope  :)
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: mindslight on February 18, 2018, 05:04:15 pm
You have to recompile the standard C library and add the path in your environment.

The library currently used in the project is available here: "Compiler\SH_COFF\sh-coff\sh-coff\lib\libc.a"

If you look closer into the "compile.bat script", you will see paths :

Code: [Select]
SET PATH=%COMPILER_DIR%\SH_COFF\Other Utilities;%COMPILER_DIR%\SH_COFF\sh-coff\bin;%COMPILER_DIR%\TOOLS;%PATH%

You will find in attachement the C library compiled (ELF Format) (old version but enough)
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: deevus on July 29, 2018, 09:19:32 am
Any luck with this? I'm interested in compiling on linux without wine. However I'm not very familiar with compilation for different targets.
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: abrasive on August 02, 2018, 10:42:11 am
I was able to do this without much fuss with GCC 7.3.0 (sh-none-elf).

You can use the included COFF libc.a. You need to make sure -lc comes after all the $(LIBS) though. In my case I used:

LIBS += -L./lib/joengine/Compiler/SH_COFF/sh-coff/sh-coff/lib/ -lc -Wl,--format=elf32-sh -lgcc
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: abrasive on August 02, 2018, 10:43:58 am
I should mention that I also had to patch a few files to handle building on a case-sensitive system -

https://github.com/abrasive/joengine/commit/7e72a5d235e3808f5446fb66d40d393741c3d915
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: Miracoli on December 22, 2018, 09:52:39 pm
@abrasive: Is there any particular reason you are using sh-none-elf instead of sh-elf?
Title: Re: Compiling Jo Engine under GCC 7.2.0
Post by: Miracoli on December 31, 2018, 03:34:46 pm
Nevermind. I figured it out for myself. For everyone whos interested: There is no difference bewtween sh-elf and sh-none-elf (see https://wiki.osdev.org/Target_Triplet)