GP32 Recompiling Parts Of Sdk


pea

developer
Joined
Oct 3, 2004
Messages
1,089
Age
45
Location
New Zealand
Website
www.projectitis.com
Hi there,

I'm not new to programming, but I am definately new to command line compilers and GCC etc.

I have recently got the src for the smc lib as Frodo uses with long file name support, and am trying to replace Mr.Mirkos one.

My setup is win XP with the dev kit put together by bobintrees specially for use with Mr.Mirkos SDK. I have been able to succesfully compile and run the examples that come with the SDK replacement. It is stored in C:\gp32_MrMirko.

Sorry, I don't know if this is devkitadv based or not, anyone?

To start with I have:
1) Copied the smc source to a directory (C:\gp32_MrMirko\gp32_SDK\smfs_ext)
2) Edited the makefile to remove full paths from CC, LD and AS (whatever they are??) to make them the same as the makefiles in the examples that I am able to compile.
Code:
CC = arm-agb-elf-gcc
LD = arm-agb-elf-gcc
AS = arm-agb-elf-as
AR = arm-elf-ar

CFLAGS = -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi

OBJS = $(addsuffix .o, $(basename $(wildcard *.c)))

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

%.o: %.cpp
	$(CC) $(CPPFLAGS) -c $<

%.gxb: %.elf
	$(OBJCOPY) -v -O binary $< $@

%.o: %.s
	$(AS) -o $@ $<
 

all: libsm.a

libsm.a : $(OBJS)
	ar r libsm.a $(OBJS)

clean:
	rm -f *.o *.a
3) Dropped in a batch file that runs 'Make'
Code:
@echo off
c:\gp32_MrMirko\bin\make
c:\gp32_MrMirko\bin\rm -f *.o *~ Test.map *.bin *.elf
4) 
@echo:
pause
4) Run the batch file! What I get is:
Code:
arm-agb-elf-gcc -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_buf.c
process_begin: CreateProcess((null), arm-agb-elf-gcc -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_buf.c, ...) failed.
make (e=2): The system cannot find the file specified.
c:\gp32_MrMirko\bin\make: *** [smf_buf.o] Error 2

Press any key to continue . . .

My question is first of all -
a ) What is the file it can't find, and why?
b ) I have left all the default compile flags. Are these correct? My other makefiles (for the Mr.Mirko examples) are so much simpler than these!

TIA
 
Last edited by a moderator:
I believe the smf_buf.o file is part of the Samsung smc lib. If you read the readme.txt in the C:\gp32_MrMirko\gp32_SDK\lib.src\smfs directory you will see Mr Mirko has mentioned this.

"The Samsung smc lib is NOT free, so i can not provide you with the source.
Dont worry, the compiled version is included :)"

The only place I could find the compiled versions was in the C:\gp32_MrMirko\gp32_SDK\lib\gp_smc.a file. I have no idea if its possbile to extract them from the file though, thats why I haven't re-compiled Mr Mirkos smc lib.

The compiler settings look ok to me, but I'm no expert.
 
This looks DevKitAdv based as you are using arm-agb-elf-gcc


The error may be some other file that can't be found when trying to create the smf_buf.o?
Code:
CreateProcess((null), arm-agb-elf-gcc ...) failed.

Copy/Paste this line to the command line and see what you get.
Code:
arm-agb-elf-gcc -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_buf.c
 
did you put it in the "path"?

Yes I did - I can compile my own stuff fine, and also the Mr.Mirko examples.

Copy/Paste this line to the command line and see what you get

It couldn't find arm-agb-elf-gcc! I checked my other Makefiles, and they only use arm-elf-gcc.

Now the question is - are any of the compiler flags not compatible between 'arm-agb-elf-gcc' and 'arm-elf-gcc' ?
 
Now I get:

Code:
arm-elf-gcc -I../lib.src/include -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_buf.c
arm-elf-gcc -I../lib.src/include -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_conf.c

arm-elf-gcc -I../lib.src/include -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_fat.c
arm-elf-gcc -I../lib.src/include -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_io.c
arm-elf-gcc -I../lib.src/include -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_lpt.c
arm-elf-gcc -I../lib.src/include -Os -DLITTLE_ENDIAN -DGP32 -fno-common -fno-builtin -ffreestanding -fno-exceptions -mcpu=arm9tdmi -mtune=arm9tdmi -c smf_uni.c
smf_uni.c: In function `sm_ConvertCharToUnicode':
smf_uni.c:37: warning: comparison is always true due to limited range of data type
ar r libsm.a smf_buf.o smf_conf.o smf_fat.o smf_io.o smf_lpt.o smf_uni.o
process_begin: CreateProcess((null), ar r libsm.a smf_buf.o smf_conf.o smf_fat.o
 smf_io.o smf_lpt.o smf_uni.o, ...) failed.
make (e=2): The system cannot find the file specified.
c:\gp32_MrMirko\bin\make: *** [libsm.a] Error 2

Press any key to continue . . .

So as I understand it, the Makefile isn't building libsm.a, but requires it in order to build the project?

Mr.Mirko has a file called gp_smc.a, but who knows if this is the same file?
 
Woohoo - got it. It was trying to run 'ar' directly instead of the variable $(AR) which points to 'arm-elf-ar'.

Code:
AR = arm-elf-ar
...
libsm.a : $(OBJS)
	$(AR) r libsm.a $(OBJS)

Now I have a nice little 'libsm.a' (94kb) sitting in the directory. Hopefully it works :)
 
Back
Top