Posts: 270 | Thanked: 239 times | Joined on Dec 2009 @ Czech Republic
#11
 
Posts: 2,802 | Thanked: 4,490 times | Joined on Nov 2007
#12
Right, I think that's a qemu limitation rather than any compiler issue.
 

The Following User Says Thank You to lma For This Useful Post:
Posts: 270 | Thanked: 239 times | Joined on Dec 2009 @ Czech Republic
#13
So is there any way how compile it, because I run program from real device.

Last edited by Figa; 2010-09-06 at 14:20.
 
Posts: 270 | Thanked: 239 times | Joined on Dec 2009 @ Czech Republic
#14
Ok I am trying building it from device, but I get many includes errors about math.h fcntl.h etc. so i have to add them

Last edited by Figa; 2010-09-06 at 15:28.
 
Posts: 2,802 | Thanked: 4,490 times | Joined on Nov 2007
#15
Not sure I understand, does it also crash with SIGILL on a real N900?
 
Posts: 270 | Thanked: 239 times | Joined on Dec 2009 @ Czech Republic
#16
Yes, it does...
 
javispedro's Avatar
Posts: 2,351 | Thanked: 5,243 times | Joined on Jan 2009 @ Barcelona
#17
Originally Posted by Figa View Post
Ok I am trying building it from device, but I get many includes errors about math.h fcntl.h etc. so i have to add them
Build in scratchbox, copy binary and run on device.
 
Posts: 2,802 | Thanked: 4,490 times | Joined on Nov 2007
#18
Oh sorry, I didn't pay attention to exactly what you were compling and assumed "emulator" referred to qemu in scrathbox's ARMEL target :-( What compilation flags are you using? You should avoid thumb in particular (see http://wiki.maemo.org/Packaging/Guid...debian.2Frules).
 

The Following 2 Users Say Thank You to lma For This Useful Post:
Posts: 270 | Thanked: 239 times | Joined on Dec 2009 @ Czech Republic
#19
Thanks, but it doesn´t help. This is my makefile:
Code:
# gpSP makefile
# Gilead Kutnick - Exophase
# GP2X port(ion) - Z

# Global definitions

PREFIX  = /scratchbox/users/figa/targets/FREMANTLE_ARMEL/
CC        = gcc
STRIP     = strip

OBJS      = main.o cpu.o memory.u video.o input.o sound.o gui.o        \
            cheats.o zip.o cpu_threaded.z arm_stub.o     \
	    warm.o
BIN       = gpsp 

DEB_BUID_OPTIONS = thumb

# Platform specific definitions 

VPATH      += ..
CFLAGS     += -DARM_ARCH -DARM_BUILD -g
# NOTE: -funroll-loops will slow down compiling considerably
# 		-fno-common was required to get games to start
#		-finline-functions breaks cpu_threaded.c
#		-fno-strength-reduce is needed to save time compiling
#                 cpu_threaded.c
#CFLAGS     += -O3 -std=c99 -msoft-float -funsigned-char -fno-common           \
#              -fstrength-reduce -falign-functions -fomit-frame-pointer        \
#              -ffast-math -fexpensive-optimizations -finline                  \
#              -fstrict-aliasing -finline-functions -fweb -fno-builtin

CFLAGS     += -O1 -std=c99 -msoft-float -funsigned-char -fno-common           \
              -fno-builtin

#INCLUDES   = `/scratchbox/users/figa/home/figa/workspace/gpsp/SDL/bin/sdl-config --cflags` -I/scratchbox/users/figa/home/figa/workspace/gpsp/SDL//include
#LIBS       = `/scratchbox/users/figa/home/figa/workspace/gpsp/SDL/bin/sdl-config --libs`                \
#              -lm -ldl -lpthread -lasound -lz

INCLUDES   = `/scratchbox/users/figa/targets/FREMANTLE_ARMEL/usr/bin/sdl-config --cflags` -I/scratchbox/users/figa/targets/FREMANTLE_ARMEL/usr//include
LIBS       = `/scratchbox/users/figa/targets/FREMANTLE_ARMEL/usr//bin/sdl-config --libs`                \
              -lm -ldl -lpthread -lasound -lz

#LIBS       += -static

#SDL_LIBS=-L/scratchbox/users/figa/home/figa/workspace/gpsp/SDL//lib -Wl,-rpath,/scratchbox/users/figa/home/figa/workspace/gpsp/SDL//lib -lSDL -lpthread -ldl -lasound -lm
#SDL_CFLAGS=-I/scratchbox/users/figa/home/figa/workspace/gpsp/SDL//include/SDL -D_GNU_SOURCE=1 -D_REENTRANT

# Compilation:

.SUFFIXES: .c

%.z: %.c
	$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<

%.u: %.c
	$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<

%.o: %.c
	$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<

%.o: %.S
	$(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<

%.o: %.s
	$(CC) $(ASFLAGS) $(INCLUDES) -c -o $@ $<

all:	$(OBJS)
	$(CC) $(OBJS) $(LIBS) -o $(BIN)  
	#$(STRIP) $(BIN)

clean:
	rm -f *.o *.u *.z $(BIN)

Last edited by Figa; 2010-09-06 at 16:33.
 
Posts: 2,802 | Thanked: 4,490 times | Joined on Nov 2007
#20
Some random suggestions:
  • pay heed to the "-finline-functions breaks cpu_threaded.c" comment
  • I wonder what -DGP2X_BUILD does, might be worth greping the source for it
  • try -O2 instead of -O3, just in case
  • Use -mfpu=vfp (even though it's supposed to be on by default)

If all else fails, try getting a core dump and see exactly what illegal instruction it's trying to execute when it dies. See here for details
 

The Following User Says Thank You to lma For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 18:08.