Assembler can't open a file?

support for the ARM toolchain
Post Reply
Gamer2020
Posts: 8
Joined: Fri Sep 09, 2011 7:22 pm

Assembler can't open a file?

Post by Gamer2020 » Thu Sep 15, 2011 5:18 am

I'm still fairly new to devkitARM but I really want to make some GBA games so I'm not giving up.
Today I decided to see if I could try to get music playing similar to how it's done in the official SDK.

I tried to assemble an .s but it says that it can't open MPlayDef.s even though it is in the same folder. What could be causing this?

Code: Select all

C:\Users\Gamer2020\Desktop\template>make
template.c
arm-eabi-gcc -MMD -MP -MF /c/Users/Gamer2020/Desktop/template/build/template.d -
g -Wall -O3 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mth
umb -mthumb-interwork  -I/c/devkitPro/libgba/include -I/c/Users/Gamer2020/Deskto
p/template/build -c /c/Users/Gamer2020/Desktop/template/source/template.c -o tem
plate.o
MPlayDef.s
arm-eabi-gcc -MMD -MP -MF /c/Users/Gamer2020/Desktop/template/build/MPlayDef.d -
x assembler-with-cpp -mthumb -mthumb-interwork -c /c/Users/Gamer2020/Desktop/tem
plate/source/MPlayDef.s -o MPlayDef.o
c:/Users/Gamer2020/Desktop/template/source/MPlayDef.s:78:32: warning: trigraph ?
?) ignored, use -trigraphs to enable [-Wtrigraphs]
c:/Users/Gamer2020/Desktop/template/source/MPlayDef.s:79:37: warning: trigraph ?
?) ignored, use -trigraphs to enable [-Wtrigraphs]
c:/Users/Gamer2020/Desktop/template/source/MPlayDef.s:85:39: warning: trigraph ?
?) ignored, use -trigraphs to enable [-Wtrigraphs]
song0.s
arm-eabi-gcc -MMD -MP -MF /c/Users/Gamer2020/Desktop/template/build/song0.d -x a
ssembler-with-cpp -mthumb -mthumb-interwork -c /c/Users/Gamer2020/Desktop/templa
te/source/song0.s -o song0.o
C:\Users\GAMER2~1\AppData\Local\Temp\ccvNnBcU.s: Assembler messages:
C:\Users\GAMER2~1\AppData\Local\Temp\ccvNnBcU.s:5: Error: can't open MPlayDef.s
for reading: No such file or directory
make[1]: *** [song0.o] Error 1
make: *** [build] Error 2
The files seem to assemble when I use the following .bat file however.

Code: Select all

PATH = c:\devkitPro\devkitARM\bin;
arm-eabi-as -o song0.o song0.s
pause
What am I doing wrong? Could someone maybe point me in the right direction?

I have added sample source code in case it is needed to help me solve this problem.

Thanks.
Attachments
template.zip
(9.12 KiB) Downloaded 405 times

WinterMute
Site Admin
Posts: 1862
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Assembler can't open a file?

Post by WinterMute » Thu Sep 15, 2011 1:11 pm

The default templates are set up to compile assembly source files through the gcc driver which gives access to the C preprocessor. Unfortunately this means that the .include and .incbin directives don't seem to get a valid include path which causes them to fail. This can probably be fixed by passing a path to the assembler using the -Wa directive but I haven't had the time or motivation to look into doing it this way. Ideally I'd like to just fix it so the assembler can just look in the same path as the source file - this means patching binutils.

You can work around this by using #include instead of .include which has the side benefit of giving you access to all the features of the C preprocessor like #define, C style comments etc. It appears to not recognise @ as a comment though and will give you some peculiar warnings related to comments occasionally.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Gamer2020
Posts: 8
Joined: Fri Sep 09, 2011 7:22 pm

Re: Assembler can't open a file?

Post by Gamer2020 » Sat Sep 17, 2011 2:26 am

Alright thanks. What if I were to include the already assembled .o file in my ROM. It seems that is the proper way to do it, how would I do so?

WinterMute
Site Admin
Posts: 1862
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Assembler can't open a file?

Post by WinterMute » Sun Sep 18, 2011 11:01 am

No, the proper way is to have your build system create the object file from the source code.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests