gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > gcc fails compilation at all...

#12893 - Dragonlord - Sat Nov 29, 2003 10:08 pm

i've downloaded the sources for gbadevkit under linux and compiled the bitch. worked after correcting a bugious patch file and compiled it, installed it.

now i tried a simple program of just 4 lines to test if the compiler works... but somehow it does not. the following happened.

Code:
> arm-agb-elf-gcc -o main.elf main.cpp
/opt/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/bin/ld: section .iwram [08000388 -> 0800044f] overlaps section .init [08000374 -> 0800038f]
/opt/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/lib/crt0.o: In function `jump_intr':
/opt/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/lib/crt0.o(.iwram+0xc4): undefined reference to `IntrTable'
collect2: ld returned 1 exit status


what's going on there? i've tried also with the precompiled version an got the same error.
anybody compiled/used devkitgba on linux and has encountered such a strange error?
_________________
Oh to be a dragon, of silkwork size or immense...

#12900 - poslundc - Sun Nov 30, 2003 6:51 am

Actually, according to your errors the compiler is working fine, it's in the stage of linking the output files that you are running into trouble.

The first part I'm unsure of... but it seems like there may be an error of some sort with your linker script.

The second part seems like you have interrupts enabled in your crt0.s file, which you should disable until you are prepared to support interrupts from within your code. If you open up crt0.s you will find it is quite easy to read. Just plough through until you find the line that enables interrupts and comment it out. (You might find you have to comment out a couple of other subsequent lines as well relating to interrupts, but I think the first one should probably be enough.)

Dan.

#12920 - Dragonlord - Sun Nov 30, 2003 7:36 pm

The strange thing is that on windows I tried out the binaries there and it works without problems. It would just interest me how the same compiler on windows works and on linux makes troubles... I've tried self compiled and precompiled and all failed.
_________________
Oh to be a dragon, of silkwork size or immense...

#12922 - poslundc - Sun Nov 30, 2003 9:01 pm

Well, like I said, it isn't the compiler, it's the linker.

My guess is that you are using a different crt0.s file on the other system, and possibly a different lnkscript as well. Try replacing those files over from the system that works to the system that doesn't, and see if it works then.

Dan.

#20998 - Articuno - Fri May 21, 2004 6:35 am

I am working on this source code since 2h P.M. (now its 2h AM ;_;) ...
I edited the patches, disabled interrupts, even removed C++ libraries, but this kind of error still happens!

Code:

/opt/devkitadv/bin/../lib/gcc-lib/arm-agb-elf/3.1/../../../../arm-agb-elf/bin/ld: section .iwram [08000388 -> 0800044f] overlaps section .init [08000374 -> 0800038f]


Not exactly this error (i copied the first post), but something similar ( .rodata [ xxxxxxxxx -> yyyyyyyyf] overlaps .data [ zzzzzzzz->yyyyyyf ] )

Note: i'm a beginner in gba development , under a linux network, with no root (admin) powers ;_; - and i was working on /tmp ('cause i have no enough quota) (this is just a warning, because i dont want windows or linux-as-root specific solutions ...)
Note 2: I was trying to compile the Tetris from this site: http://www.gbadev.org/sources_cd.html (4th in the list)


Wendel
_________________
---------------
Close the World, txEn eht nepO.