Author Topic: ARM9 compilation?  (Read 5913 times)

0 Members and 1 Guest are viewing this topic.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
ARM9 compilation?
« on: July 10, 2010, 01:59:17 pm »
Does anyone know why nspire C programs are compiled into ARM7 binaries, rather than ARM9?

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: ARM9 compilation?
« Reply #1 on: July 10, 2010, 02:03:10 pm »
Does anyone know why nspire C programs are compiled into ARM7 binaries, rather than ARM9?
Must be some setting in the compiler. Not that it matters much anyway, since it produces usable code (and ARM9 doesn't offer all that much over ARM7)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: ARM9 compilation?
« Reply #2 on: July 10, 2010, 03:42:47 pm »
Well, the Makefile does say
Code: [Select]
ASFLAGS = -mcpu=arm7tdmi
GCCFLAGS = -mcpu=arm7tdmi

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: ARM9 compilation?
« Reply #3 on: July 10, 2010, 06:04:02 pm »
I changed this:
Code: [Select]
ASFLAGS = -mcpu=arm7tdmi
GCCFLAGS = -mcpu=arm7tdmi
to this:
Code: [Select]
ASFLAGS = -mcpu=arm9tdmi
GCCFLAGS = -mcpu=arm9tdmi
and the program I compiled ran just fine. We might as well use it, because we do have an ARM9 processor.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: ARM9 compilation?
« Reply #4 on: July 10, 2010, 06:29:36 pm »
I changed this:
Code: [Select]
ASFLAGS = -mcpu=arm7tdmi
GCCFLAGS = -mcpu=arm7tdmi
to this:
Code: [Select]
ASFLAGS = -mcpu=arm9tdmi
GCCFLAGS = -mcpu=arm9tdmi
and the program I compiled ran just fine. We might as well use it, because we do have an ARM9 processor.

Maybe you should try arm926ej-s, since that is the exact model of the Nspire (arm9tdmi is a little different)

Edit: typo
« Last Edit: July 10, 2010, 06:30:29 pm by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: ARM9 compilation?
« Reply #5 on: July 17, 2010, 03:29:20 pm »
That gives an error.

Code: [Select]
arm-elf-gcc -mcpu=arm926ej-s -O3 -Wall -W -fpie -fno-merge-constants -c -I./head
ers -D NON_CAS main.c
main.c: In function 'main':
main.c:66: warning: passing argument 2 of 'sprite' discards qualifiers from poin
ter target type
graphics.h:3: note: expected 'char *' but argument is of type 'const char *'
main.c:74: warning: passing argument 1 of '270019872u' discards qualifiers from
pointer target type
main.c:74: note: expected 'char *' but argument is of type 'const char *'
arm-elf-gcc -mcpu=arm926ej-s -O3 -Wall -W -fpie -fno-merge-constants -c -I./head
ers -D NON_CAS syscalls.c
arm-elf-gcc -mcpu=arm926ej-s -O3 -Wall -W -fpie -fno-merge-constants -c -I./head
ers -D NON_CAS utils.c
arm-elf-gcc -mcpu=arm926ej-s -O3 -Wall -W -fpie -fno-merge-constants  -T ./syste
m/ldscript ./system/crt0.s main.o syscalls.o utils.o -o demo.elf
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../a
rm-elf/lib\libc.a(lib_a-atexit.o) uses FPA instructions, whereas demo.elf does n
ot
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-atexit.o)
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../a
rm-elf/lib\libc.a(lib_a-exit.o) uses FPA instructions, whereas demo.elf does not

c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-exit.o)
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../a
rm-elf/lib\libc.a(lib_a-impure.o) uses FPA instructions, whereas demo.elf does n
ot
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-impure.o)
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../a
rm-elf/lib\libc.a(lib_a-init.o) uses FPA instructions, whereas demo.elf does not

c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-init.o)
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../a
rm-elf/lib\libc.a(lib_a-memset.o) uses FPA instructions, whereas demo.elf does n
ot
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-memset.o)
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../a
rm-elf/lib\libc.a(lib_a-__atexit.o) uses FPA instructions, whereas demo.elf does
 not
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-__atexit.o)
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../a
rm-elf/lib\libc.a(lib_a-__call_atexit.o) uses FPA instructions, whereas demo.elf
 does not
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-__call_atexit.o)
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/crtend.o uses
 FPA instructions, whereas demo.elf does not
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/crtend.o
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: error: c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/crtn.o uses F
PA instructions, whereas demo.elf does not
c:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld
.exe: failed to merge target specific data of file c:/program files/yagarto/bin/
../lib/gcc/arm-elf/4.4.2/crtn.o
collect2: ld returned 1 exit status
make: *** [demo] Error 1

It seems like the compiler and the linker are not on the same page.

Offline shrear

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 193
  • Rating: +17/-0
    • View Profile
Re: ARM9 compilation?
« Reply #6 on: August 26, 2011, 03:35:32 pm »
My first necropost I think ;)

Well I tried also to build for arm926ej-s...
and it works fine, seems as if the current release of Yagarto (29.04.2011) hasn't this problem any-more.
As of now I build ndless itself and a few smaller programs successfully ( as in no error at compile or runtime ).
Can someone confirm that it works? (To be sure I didn't mess up somewhere  :P )
« Last Edit: August 26, 2011, 03:36:38 pm by shrear »