Help Getting Windows Toolchain Runningc.h Compile?


gp32rich

Never been accused of being subtle
Joined
Nov 16, 2003
Messages
840
Location
dev heck!
Website
www.geocities.com
So I'm bored for Easter and wedding and stuff and decided it's about time I got a build environment going.

So I grabbed files as per any instructions I could find
20100611-i686-linux-armv7a-linux-gnueabi-toolchain-openpandora.tar.bz2 (from Rockthesmurf's guide around here)
SDL-devel-1.2.14-mingw32.tar.gz (pandorawiki ?)
and downloaded
devkitProUpdater-1.5.0.exe

I copied libs and includes into pandora/include & .../lib
set paths so: path c:\devkitPro\msys\bin;c:\devkitPro\devkitARM\bin;c:\windows;c:\windows\system32 <-- Yes! It's windows! It would be W98TurboC if I had my way <_<

Grabbed some source (twin-e) from the archive and pointed the makefile to my inc&lib dirs and ran make -fmakefile.panda

It failed. So I remembered some extra defines and -w's from rockthesmurfs tips. It failed.

Report follows
Code:
C:\Users\Rich\Documents\source\pandora\twin-e\twin-e src>make -f makefile.panda
arm-eabi-gcc -Wall -O3 -Wextra -Wdeclaration-after-statement -fomit-frame-pointer -fsigned-char \
-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -DUNIX -Ic:/devkitpro/pandora/include/SDL \
-Ic:/devkitpro/pandora/include -Wno-deprecated -Wno-psabi -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ \
-D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -D__NEW__ -D__SGI_STL_INTERNAL_PAIR_H -D_PANDORA -DTCHAR=char \
-c actors.c -o actors.o
In file included from c:/devkitpro/pandora/include/SDL/SDL_main.h:26:0,
                 from c:/devkitpro/pandora/include/SDL/SDL.h:30,
                 from osystem.h:22,
                 from lba.h:200,
                 from actors.c:19:
c:/devkitpro/pandora/include/SDL/SDL_stdinc.h:151:1: error: size of array 'SDL_dummy_enum' is negative
make: *** [actors.o] Error 1
Line breaks [] added for non-scrolly clarity

Code around the error in SDL_stdinc.h is
Code:
122:#define SDL_COMPILE_TIME_ASSERT(name, x)               \
123:       typedef int SDL_dummy_ ## name[(x) * 2 - 1]

...

146:typedef enum {
147:	DUMMY_ENUM_VALUE
148:} SDL_DUMMY_ENUM;
149:
150:#ifndef __NDS__
151:SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
152:#endif
If I'm reading this right - (x) on line 123 needs to be non-zero
So what extra flags do I need to set for sizeof(enum) to be int sized?
Have I got the wrong SDL?
Have I missed something really REALLY simple :rolleyes: <-- most likely


Cheers
Rich
 
Last edited by a moderator:
hmmm just googling.... try compiling with "-fno-short-enums" ..
 
Also maybe this is the toolchain you should look at:
http://www.gp32x.de/board/index.php?/topic/58490-yactfeau/
It's the easiest in my opinion, as it has the environment setup automated and scripts for configure, cmake and qmake, that make things simple :) .

Edit: Sorry, didn't see, that you are on windows, but maybe still use it in an virtual machine,
 
Last edited by a moderator:
crow_riot said:
hmmm just googling.... try compiling with "-fno-short-enums" ..
See!?! That's the sort of reply I'd used to give to newbies!
But the scales are attaching to my eyes as I get older <_< Thought it went the other way round ...

I'm :angry: cos it worked :rolleyes: Thanks :)


Woo! All the files compile :huh: now to sort the libs ;)
 
Last edited by a moderator:
gp32rich said:
I'd used to give to newbies!
i wouldnt call myself a newbie ... but well glad to help you out :p


i'm hoping you're going to share your toolchain. i'd love to have one, maybe i could get it work with my beloved visual studio then :)
 
Last edited by a moderator:
crow_riot said:
gp32rich said:
I'd used to give to newbies!
i wouldnt call myself a newbie ... but well glad to help you out :p

i'm hoping you're going to share your toolchain. i'd love to have one, maybe i could get it work with my beloved visual studio then :)
I used to not be so newbie. I surely wasn't calling you a newbie and of course I'll share tips on getting it running .. as soon as I get it running.


Which brings me to the next problem ... here's the output of gcc -v
Code:
C:\Users\Rich\Documents\source\pandora\twin-e\twin-e src>make -fmakefile.panda
arm-eabi-gcc actors.o actorScript.o angle.o angleTable.o animAction.o anim.o bod
y.o comportementMenu.o costume.o cube.o extra.o fichePerso.o fireEffect.o fla.o
font.o fullRedraw.o hqr.o images.o inventory.o script.o main.o mainLoop.o mainMe
nu.o mainSDL.o moveActor.o music.o overlay.o renderer.o room.o samples.o save.o
shadow.o streamReader.o text.o vox.o zones.o -o twin-e -v -Wl,-rpath=c:/devkitpr
o/pandora/lib -Lc:/devkitpro/pandora/lib -lts -lpthread -lSDL -lSDL_mixer -lrt -
lstdc++ -Wl,--whole-archive -Wl,--no-whole-archive -Wl,--no-undefined -g -Wl,-rp
ath=libs
Using built-in specs.
COLLECT_GCC=c:\devkitPro\devkitARM\bin\arm-eabi-gcc.exe
COLLECT_LTO_WRAPPER=c:/devkitpro/devkitarm/bin/../libexec/gcc/arm-eabi/4.5.1/lto
-wrapper.exe
Target: arm-eabi
Configured with: ../../gcc-4.5.1/configure --enable-languages=c,c++,objc --with-
cpu=arm7tdmi --enable-interwork --enable-multilib --with-gcc --with-gnu-ld --wit
h-gnu-as --disable-dependency-tracking --disable-shared --disable-threads --disa
ble-win32-registry --disable-nls --disable-debug --disable-libmudflap --disable-
libssp --disable-libgomp --disable-libstdcxx-pch --target=arm-eabi --with-newlib
 --prefix=c:/devkitPro/devkitARM --enable-lto --with-bugurl=http://wiki.devkitpr
o.org/index.php/Bug_Reports --with-pkgversion='devkitARM release 32'
Thread model: single
gcc version 4.5.1 (devkitARM release 32)
COMPILER_PATH=c:/devkitpro/devkitarm/bin/../libexec/gcc/arm-eabi/4.5.1/;c:/devki
tpro/devkitarm/bin/../libexec/gcc/;c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eab
i/4.5.1/../../../../arm-eabi/bin/
LIBRARY_PATH=c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/;c:/devkitpro/
devkitarm/bin/../lib/gcc/;c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/.
./../../../arm-eabi/lib/
COLLECT_GCC_OPTIONS='-o' 'twin-e' '-v' '-Lc:/devkitpro/pandora/lib' '-g' '-mcpu=
arm7tdmi'
 c:/devkitpro/devkitarm/bin/../libexec/gcc/arm-eabi/4.5.1/collect2.exe -X -o twi
n-e c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/crti.o c:/devkitpro/dev
kitarm/bin/../lib/gcc/arm-eabi/4.5.1/crtbegin.o c:/devkitpro/devkitarm/bin/../li
b/gcc/arm-eabi/4.5.1/../../../../arm-eabi/lib/crt0.o -Lc:/devkitpro/pandora/lib
-Lc:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1 -Lc:/devkitpro/devkitarm/
bin/../lib/gcc -Lc:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/../../../.
./arm-eabi/lib actors.o actorScript.o angle.o angleTable.o animAction.o anim.o b
ody.o comportementMenu.o costume.o cube.o extra.o fichePerso.o fireEffect.o fla.
o font.o fullRedraw.o hqr.o images.o inventory.o script.o main.o mainLoop.o main
Menu.o mainSDL.o moveActor.o music.o overlay.o renderer.o room.o samples.o save.
o shadow.o streamReader.o text.o vox.o zones.o -rpath=c:/devkitpro/pandora/lib -
lts -lpthread -lSDL -lSDL_mixer -lrt -lstdc++ --whole-archive --no-whole-archive
 --no-undefined -rpath=libs --start-group -lgcc -lg -lc -lsysbase --end-group c:
/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/crtend.o c:/devkitpro/devkita
rm/bin/../lib/gcc/arm-eabi/4.5.1/crtn.o
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/../../../../arm-eabi/bin/ld
.exe: cannot find /lib/libpthread.so.0
collect2: ld returned 1 exit status
make: *** [twin-e] Error 1
I've set -L
I've set -rpath=
I've even added LIBRARY_PATH to the makefile
Hell! I added SET LIBRARY_PATH in my setup.bat

Why won't gcc find my lib directory when -I found the includes? :(
 
Last edited by a moderator:
After P-ing about with paths I decided to look at the file libpthread.so
Code:
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )
Take out the hard-coded paths and it fails on libc do similar on libc.so and it gets to
Code:
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/../../../../arm-eabi/bin/ld
.exe: warning: libdl.so.2, needed by c:/devkitpro/pandora/lib/libts.so, not foun
d (try using -rpath or -rpath-link)
Adding -rpath-link to the makefile
it now fails:
Code:
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/../../../../arm-eabi/bin/ld
.exe: warning: c:/devkitpro/pandora/lib\libc_nonshared.a(atexit.oS) uses 32-bit
enums yet the output is to use variable-size enums; use of enum values across ob
jects may fail
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/../../../../arm-eabi/lib/cr
t0.o: In function `start':
(.text+0xd4): undefined reference to `__libc_init_array'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/../../../../arm-eabi/lib/cr
t0.o: In function `start':
(.text+0x100): undefined reference to `__libc_fini_array'
collect2: ld returned 1 exit status
make: *** [twin-e] Error 1
Phew! I feel further along -- but still failing <_<
 
hey good to see you continuing, about your problem with libc stuff:

http://www.gp32x.de/board/index.php?/topic/52441-using-c-with-gp32-constructors-crt0-o/

i dont know though, if slaanesh resolved his issue ...
 
Last edited by a moderator:
Aaw crap! Thanks for the memory jog! I now remember having to recreate crt0.o etc for GP32 and copy it over places :/
Holy $#!+ that's six years ago! :eek:

adding -Wl,--no-enum-size-warning to the linker options gets rid of that warning!

Now to find a correct crt0.o etc. Sadly no source file in devkitpro :(
No-one else seems to have complained, so .. is it just me/windows
 
slaeshjag said:
crt0.o for running on the pandora?
Here's the latest fail report
gp32rich said:
it now fails:
Code:
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/../../../../arm-eabi/lib/cr
t0.o: In function `start':
(.text+0xd4): undefined reference to `__libc_init_array'
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.5.1/../../../../arm-eabi/lib/cr
t0.o: In function `start':
(.text+0x100): undefined reference to `__libc_fini_array'
collect2: ld returned 1 exit status
make: *** [twin-e] Error 1
Looks like it's looking in the right place : arm-eabi/lib/crt0.o


Wowowowow! Thanks for making me look slaeshjag! I suddenly spotted a linux-crt0.o and made a connection!
I think I got a compiled object! :0


Edit: Bah! I don't know what I made .. but it ain't a bash command; or a file or directory :(
Ooh I was sooo excited :rolleyes:

Taking a look in a hex editor: It's an ELF! with symbol info at the end. Nnng >_< so close I can feel it!
I'm guessing - chmod
 
Last edited by a moderator:
Back
Top