RSDKModding / Sonic-Mania-Decompilation

A complete decompilation of Sonic Mania (2017)
Other
632 stars 116 forks source link

Building fails on Ubuntu 22.04 results in failure #33

Closed ShadowXeldron closed 2 years ago

ShadowXeldron commented 2 years ago

Attempting to run Make under Ubuntu 22.04 results in the following issues:

compiling SonicMania/Game.c...
compiling SonicMania/Objects/All.c...
In file included from ./SonicMania/Game.h:75,
                 from SonicMania/Objects/AIZ/AIZEggRobo.c:8,
                 from SonicMania/Objects/All.c:1:
SonicMania/Objects/Global/ReplayRecorder.c: In function ‘ReplayRecorder_AddReplayID’:
SonicMania/Objects/Global/ReplayRecorder.c:1454:58: warning: zero-length gnu_printf format string [-Wformat-zero-length]
 1454 |         sprintf_s(createTime, (int32)sizeof(createTime), "");
      |                                                          ^~
./SonicMania/GameLink.h:14:41: note: in definition of macro ‘sprintf_s’
   14 | #define sprintfs(x, , ...) sprintf(x, VA_ARGS)
      |                                         ^~~
done SonicMania/Game.c
done SonicMania/Objects/All.c
linking game...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `TMC_END' can not be used when making a shared object
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:128: bin/Linux/SonicMania.so] Error 

After running the build, a broken symbolic link labeled Game appears in the repository. I cannot tell whether or not this is an issue on my part however, since multiple users have also reported a similar issue on a Discord thread.

grindersky commented 2 years ago

same issue here!

itsmattkc commented 2 years ago

For some reason, the Makefile variable STATIC is set to 1 while -shared is provided as an LDFLAG.

Compile with make STATIC=0, that worked for me.

Robmike27 commented 2 years ago

Manjaro here, I'm a bit similar.

compiling SonicMania/Game.c...
done SonicMania/Game.c
compiling SonicMania/Objects/All.c...
done SonicMania/Objects/All.c
linking game...
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:128: bin/Linux/SonicMania.so] Error 1

RSDKv5 builds and runs though.

For some reason, the Makefile variable STATIC is set to 1 while -shared is provided as an LDFLAG.

Compile with make STATIC=0, that worked for me.

It doesn't give me an error but it doesn't exactly build an executable either.

MisterSheeple commented 2 years ago

For some reason, the Makefile variable STATIC is set to 1 while -shared is provided as an LDFLAG.

Compile with make STATIC=0, that worked for me.

thanks Matt! Great videos btw.

itsmattkc commented 2 years ago

It doesn't give me an error but it doesn't exactly build an executable either.

You need to combine it with this: https://github.com/Rubberduckycooly/RSDKv5-Decompilation

Compile both, then place the library (renamed to Game.so if necessary) with the executable and asset pack

I believe you can also combine the Game.o generated by this repo with RSDK to produce a statically linked executable, but I haven't tried that myself yet.

Robmike27 commented 2 years ago

Ah, thank you. I got confused (or maybe I still am) since compiling RSDKv5 gave me a Game.so with it.

ShadowXeldron commented 2 years ago

I can confirm that I got a sucessful build with STATIC=0.