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

Makefile not work with the last SGDK #3

Open
kentosama opened this issue Aug 13, 2020 · 1 comment
Open

Makefile not work with the last SGDK #3

kentosama opened this issue Aug 13, 2020 · 1 comment

Comments

@kentosama
Copy link

Hi! A lot of things have been changed in SGDK and the makefile. I tried to adapt the Makefile that came with SGDK NIX, but I failed to compile a project. For now, here are the compilation errors:

Beginning release project build...
m68k-elf-gcc -m68000 -Wall -fno-builtin -Iinc -Isrc -Ires -I/opt/toolchains/genesis/sgdk2/inc -I/opt/toolchains/genesis/sgdk2/res -c src/boot/rom_head.c -o out/rom_head.o
m68k-elf-ld -T /opt/toolchains/genesis/sgdk2/md.ld -nostdlib --oformat binary -o out/rom_head.bin out/rom_head.o
m68k-elf-gcc -m68000 -Wall -fno-builtin -Iinc -Isrc -Ires -I/opt/toolchains/genesis/sgdk2/inc -I/opt/toolchains/genesis/sgdk2/res -c src/boot/sega.s -o out/sega.o
m68k-elf-gcc -MMD -m68000 -Wall -fno-builtin -Iinc -Isrc -Ires -I/opt/toolchains/genesis/sgdk2/inc -I/opt/toolchains/genesis/sgdk2/res -O3 -fuse-linker-plugin -fno-web -fno-gcse -fomit-frame-pointer -fno-unit-at-a-time -flto -c src/main.c -o out/src/main.o
src/main.c:12:5: warning: first argument of 'main' should be 'int' [-Wmain]
 int main(u16 hard)
     ^~~~
src/main.c:12:5: warning: 'main' takes only zero or two arguments [-Wmain]
m68k-elf-gcc -m68000 -n -Wl,--build-id=none -T /opt/toolchains/genesis/sgdk2/md.ld -nostdlib out/sega.o out/src/main.o /opt/toolchains/genesis/sgdk2/lib/libmd.a /opt/toolchains/genesis/sgdk2/lib/libgcc.a -o out/rom.out
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `registersDump':
(.text.keepboot+0x266): undefined reference to `registerState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x26c): undefined reference to `registerState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x272): undefined reference to `registerState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x278): undefined reference to `registerState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x27e): undefined reference to `registerState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o:(.text.keepboot+0x284): more undefined references to `registerState' follow
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `busAddressErrorDump':
(.text.keepboot+0x2ca): undefined reference to `ext1State'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2d2): undefined reference to `addrState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2da): undefined reference to `ext2State'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2e2): undefined reference to `srState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2ea): undefined reference to `pcState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `exception4WDump':
(.text.keepboot+0x2f6): undefined reference to `srState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x2fe): undefined reference to `pcState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x306): undefined reference to `ext1State'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `exceptionDump':
(.text.keepboot+0x312): undefined reference to `srState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: (.text.keepboot+0x31a): undefined reference to `pcState'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `WrongVersion':
(.text.keepboot+0x240): undefined reference to `_start_entry'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `SkipSetup':
(.text.keepboot+0x246): undefined reference to `_reset_entry'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Bus_Error':
(.text.keepboot+0x32c): undefined reference to `busErrorCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Address_Error':
(.text.keepboot+0x342): undefined reference to `addressErrorCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Illegal_Instruction':
(.text.keepboot+0x358): undefined reference to `illegalInstCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Zero_Divide':
(.text.keepboot+0x36e): undefined reference to `zeroDivideCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Chk_Instruction':
(.text.keepboot+0x384): undefined reference to `chkInstCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Trapv_Instruction':
(.text.keepboot+0x39a): undefined reference to `trapvInstCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Privilege_Violation':
(.text.keepboot+0x3b0): undefined reference to `privilegeViolationCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Trace':
(.text.keepboot+0x3c6): undefined reference to `traceCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Line_1010_Emulation':
(.text.keepboot+0x3dc): undefined reference to `line1x1xCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_Error_Exception':
(.text.keepboot+0x3f2): undefined reference to `errorExceptionCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_INT':
(.text.keepboot+0x404): undefined reference to `intCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_EXTINT':
(.text.keepboot+0x416): undefined reference to `internalExtIntCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_HINT':
(.text.keepboot+0x428): undefined reference to `internalHIntCB'
/opt/toolchains/genesis/m68k-elf/bin/../lib/gcc/m68k-elf/6.3.0/../../../../m68k-elf/bin/ld: out/sega.o: in function `_VINT':
(.text.keepboot+0x43a): undefined reference to `internalVIntCB'
collect2: error: ld returned 1 exit status
make: *** [Makefile:163 : out/rom.out] Erreur 1

I modified the Makefile of the lib in this way based on the latest version of SGDK, it is surely wrong.

I modified the Makefile of the lib from the latest version of SGDK, but it is surely wrong.

Can you update the Makefile? Would be very appreciable 👍

@kentosama
Copy link
Author

kentosama commented Aug 15, 2020

Hi, I took the time to modify the two makefiles and it works great.

I allowed myself to align the size of the ROM and thanks to the SIZEBND tool.

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

1 participant