kubilus1 / gendev

Genesis development environment for Linux.
BSD 3-Clause "New" or "Revised" License
208 stars 23 forks source link

Included examples (and some more projects) are not properly built #20

Closed doragasu closed 8 years ago

doragasu commented 8 years ago

I have been trying to build some projects: some of them build nicely, others (including the 3d_examples) build but the generated ROM does not work. I have been tracing the problem, and it's because sometimes the main() function included inside .text.startup section is placed on the ROM before the startup code (exception vectors and ROM header). Other times the sequence is correct: vectors+ROM header and then the main() function code in .text.startup.

Unfortunately I don't know what triggers the wrong behaviour and how to fix the it... The same makefile is used on proyects that build and that doesn't, the link step invocation is the same (boot, archives, objects, libraries). Why does this sometimes fail? Could it be fixed maybe by modifying the linker files (.ld files)?

kubilus1 commented 8 years ago

Interesting, no idea why this would be inconsistent. I'll try to reproduce. What is your build environment? OS, gcc version?

kubilus1 commented 8 years ago

I recall as well that certain changes to sgdk broke most of my 3d examples due to changing the number of allowed vertices per polygons, so this may have nothing to do with linker issues.

kubilus1 commented 8 years ago

Okay I think the deal is that the old 3d_example code has an old version of boot/sega.s. By copying the newer one in the sgdk/skeleton directory, I think this fixes the 'main' before rom header issue. I'll update the examples and try to clean a few things up.

doragasu commented 8 years ago

3D examples are working now, thanks!