Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: yoshi13 on May 08, 2010, 08:54:53 pm

Title: arm-elf-gcc Compiling error
Post by: yoshi13 on May 08, 2010, 08:54:53 pm
I have been trying to compile the demo program in the ndless directory as per the instructions in Dev.txt but I can't get it to work

When I navigate msys to the directory and type make it gives the error:

Code: [Select]
arm-elf-gcc -mcpu=arm7dtmi - Os -Wall -W -fpic -fno-merge-constants -c -I../headers -D NON_CAS demo.c
make: arm-elf-gcc: Command not found
make: *** [demo.o] Error 127

I have installed the yagarto toolchain and
Code: [Select]
G:/Program Files/yagarto/bin and
Code: [Select]
G:/Program Files/yagarto/ is in the Path variable as well as this I also downloaded devkitARM and have put that into the Path variable as well.

How do i fix this?
Title: Re: arm-elf-gcc Compiling error
Post by: bwang on May 08, 2010, 09:29:13 pm
Go to a command prompt and run arm-elf-gcc. Does it give you a Command Not Found error?
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 08, 2010, 09:38:40 pm
It doesn't work. it gives the command not found error

Edit: After some experimenting I found that yagarto no longer contains arm-elf-gcc but has arm-none-eabi-gcc-4.5.0 which works instead and arm-none-eabi-objcopy which works instead of arm-elf-objcopy.

Now I just need to get it to read MakeTNS as it says it isn't found
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 08, 2010, 10:38:49 pm
Alright.. I've finally got it to read all the files it needs to compile it but now it says

Code: [Select]
$ make
arm-none-eabi-gcc-4.5.0 -mcpu=arm7tdmi - Os -Wall -W -fpic -fno-merge-constants
-T ../system/ldscript ../system/crt0.s test.o syscalls.o utils.o -o test.elf
arm-none-eabi-objcopy -O binary test.elf test.bin
mkdri -p ../../res/CAS
../../tools/MakeTNS test.bin ../../res/CAS/test.tns
Failed !
rm -f test.bin test.elf


How do I fix this??
Title: Re: arm-elf-gcc Compiling error
Post by: bwang on May 08, 2010, 10:42:11 pm
You need arm-elf-gcc. Try downloading an older version of Yagarto (the version I have installed under WINE says 23.12.2009).
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 09, 2010, 08:38:06 am
I installed the 23.12.2009 version but it returns alot of errors about the EABI version and other things.

Do I need to change yagarto versions and if so to what one?

The full message is this:

Code: [Select]
$ make
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants  -T ../system/ldscript ../system/crt0.s test.o syscalls.o utils.o -o test.elf
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2\libgcc.a(_arm_addsubsf3.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2\libgcc.a(_arm_addsubsf3.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2\libgcc.a(_arm_muldivsf3.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2\libgcc.a(_arm_muldivsf3.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2\libgcc.a(_arm_cmpsf2.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2\libgcc.a(_arm_cmpsf2.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-atexit.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-atexit.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-exit.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-exit.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-impure.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-impure.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-init.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-init.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-memset.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-memset.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-__atexit.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-__atexit.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-__call_atexit.o) has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/lib\libc.a(lib_a-__call_atexit.o)
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/crtend.o has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/crtend.o
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: error: Source object g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/crtn.o has EABI version 0, but target test.elf has EABI version 5
g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/../../../../arm-elf/bin/ld.exe: failed to merge target specific data of file g:/program files/yagarto/bin/../lib/gcc/arm-elf/4.4.2/crtn.o
collect2: ld returned 1 exit status
make: *** [test] Error 1
Title: Re: arm-elf-gcc Compiling error
Post by: DJ Omnimaga on May 11, 2010, 03:39:58 am
btw when there are over 6 hours since your last post, I recommend posting a new reply when you have more info to add, more problems or solved the issue, else, during days of high activity (especially when several topics get replied to), your post edit may get easily missed, since it won't bump the topic on top of the list.

Unfortunately, I cannot help, though, since I only did TI-83 Plus BASIC and Axe programming
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 11, 2010, 07:31:39 am
Ok. Thanks for the reply... I have had no further luck getting it to work as I spent most of my time trying to get it to work on Monday and have spent all of tonight installing ubuntu and trying to get that to work with it but it gives a CreateProcess error which I am gonna ignore and just continue to try and get it to work on Windows

I just tried on Windows and after some tinkering I now get the same error as on Ubuntu

Code: [Select]
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants  -T ../system/ldscript ../system/crt0.s main.o syscalls.o utils.o vector.o particle.o particle_system.o -o demo.elf
arm-elf-gcc.exe: CreateProcess: No such file or directory
make: *** [demo] Error 1

Edit: Just tried again after some tinkering........ the CreateProcess error is gone but in its place is the old EABI version error
Title: Re: arm-elf-gcc Compiling error
Post by: bwang on May 11, 2010, 03:53:43 pm
Do you still have Ubuntu installed? I used this page http://blog.nutaksas.com/2009/05/installing-gnuarm-arm-toolchain-on.html to install arm-elf-gcc. Then there is a workaround for a possible bug here: http://www.unitedti.org/forum/index.php?showtopic=9289.
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 12, 2010, 02:18:56 am
I looked at the bug fix but it doesn't help my current error. I tried again on Ubuntu and I now recieve this error:
Code: [Select]
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants  -T ../system/ldscript ../system/crt0.s main.o syscalls.o utils.o vector.o particle.o particle_system.o -o demo.elf
/media/Programs/gnuarm-4.0.2/bin/arm-elf-gcc: 1: cannot create �@@د@8: Invalid or incomplete multibyte or wide character
/media/Programs/gnuarm-4.0.2/bin/arm-elf-gcc: 1: ELF: not found
/media/Programs/gnuarm-4.0.2/bin/arm-elf-gcc: 2: Syntax error: "&" unexpected (expecting ")")
make: *** [demo] Error 2

I don't have time tonight to try install arm-elf-gcc from the link you got but if I can't find a fix for the current error I will try that maybe tomorrow
Title: Re: arm-elf-gcc Compiling error
Post by: bwang on May 12, 2010, 02:51:45 am
I see several characters in the codebox show up on Firefox 3.6.3 on Ubuntu 8.04 as little boxes. Does anyone else see this?
Title: Re: arm-elf-gcc Compiling error
Post by: DJ Omnimaga on May 12, 2010, 02:55:13 am
me (I use Opera 10.52 on Windows 7 64-bit)
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 12, 2010, 03:12:16 am
I see it too... in the terminal they show up as things that look like  this little box containing  00  and other random numbers and letters inside boxes
                                                                                                                             AE
Title: Re: arm-elf-gcc Compiling error
Post by: TIfanx1999 on May 12, 2010, 06:07:07 am
Yepp, same here. Firefox 3.6.3 Win 7.
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 12, 2010, 08:33:56 am
I just installed it from the link you gave bwang but it stil gives the same error with the same weird symbols
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 13, 2010, 04:49:45 am
I just got rid of the old installs of it and installed it with the link you gave bwang but now it has gone back to EABI version errors. Did you modify the build script before using it?

Here is the complete compiling output:
Code: [Select]
root@Ubuntu-Josh:/media/Windows/Programming/src/arm/Test# make
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants  -T ../system/ldscript ../system/crt0.s test.o syscalls.o utils.o -o test.elf
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/libc.a(lib_a-syscalls.o): In function `do_AngelSWI':
/home/joshua/build/arm-elf/newlib/libc/sys/arm/../../../../../../newlib-1.17.0/newlib/libc/sys/arm/syscalls.c:103: multiple definition of `_exit'
/tmp/ccW3j5Mx.o:(.text+0x0): first defined here
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld: ERROR: Source object test.o has EABI version 5, but target test.elf has EABI version 0
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld: failed to merge target specific data of file test.o
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld: ERROR: Source object syscalls.o has EABI version 5, but target test.elf has EABI version 0
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld: failed to merge target specific data of file syscalls.o
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld: ERROR: Source object utils.o has EABI version 5, but target test.elf has EABI version 0
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/bin/ld: failed to merge target specific data of file utils.o
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/libc.a(lib_a-syscalls.o): In function `_sbrk':
syscalls.c:(.text+0x478): undefined reference to `end'
collect2: ld returned 1 exit status
make: *** [test] Error 1

Thanks for all the help so far

P.S I just noticed that the EABI version error is in reverse now
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 13, 2010, 05:33:38 am
I feel like such an idiot but this sort of thing always happens to me (especially when trying to get code to run) I just realized that i needed to delete the old test.o etc files so that it would recreate them to the right version.

There are no longer any EABI version errors, however i now receive errors from what seems to be the actual files needing to be compiled.

Here is the latest compiler output:
Code: [Select]
joshua@Ubuntu-Josh:/media/Windows/Programming/src/arm/Test$ make
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants -c -I../headers -D CAS test.c
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants -c -I../headers -D CAS syscalls.c
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants -c -I../headers -D CAS utils.c
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants  -T ../system/ldscript ../system/crt0.s test.o syscalls.o utils.o -o test.elf
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/libc.a(lib_a-syscalls.o): In function `do_AngelSWI':
/home/joshua/build/arm-elf/newlib/libc/sys/arm/../../../../../../newlib-1.17.0/newlib/libc/sys/arm/syscalls.c:103: multiple definition of `_exit'
/tmp/ccs9eMe4.o:(.text+0x0): first defined here
/usr/local/arm/lib/gcc/arm-elf/4.3.3/../../../../arm-elf/lib/libc.a(lib_a-syscalls.o): In function `_sbrk':
syscalls.c:(.text+0x478): undefined reference to `end'
collect2: ld returned 1 exit status
make: *** [test] Error 1
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 13, 2010, 05:48:21 am
I found the fix to the above error and then changed MakeTNS to MakeTNS.exe so that it would find it but now I receive this error:

Code: [Select]
oshua@Ubuntu-Josh:/media/Windows/Programming/src/arm/Test$ make
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants -c -I../headers -D CAS test.c
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants -c -I../headers -D CAS syscalls.c
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants -c -I../headers -D CAS utils.c
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants  -T ../system/ldscript ../system/crt0.s test.o syscalls.o utils.o -o test.elf
arm-elf-objcopy -O binary test.elf test.bin
mkdir -p ../../res/CAS
../../tools/MakeTNS/MakeTNS.exe test.bin ../../res/CAS/test.tns
Failed !
rm -f test.bin test.elf

I am about to log off Ubuntu and try on Windows. I will update if anything happens.

Thanks,

Edit: I just tried on Windows and even after changing it back to MakeTNS instead of MakeTNS.exe it gives what appears to be the same error:
Code: [Select]

$ make
arm-elf-gcc -mcpu=arm7tdmi -Os -Wall -W -fpic -fno-merge-constants  -T ../system/ldscript ../system/crt0.s test.o syscalls.o utils.o -o test.elf
arm-elf-objcopy -O binary test.elf test.bin
mkdir -p ../../res/CAS
../../tools/MakeTNS/MakeTNS test.bin ../../res/CAS/test.tns
Failed !
rm -f test.bin test.elf
Title: Re: arm-elf-gcc Compiling error
Post by: DJ Omnimaga on May 13, 2010, 09:30:50 am
(http://www.omnimaga.org/Themes/omnimaga4/images/english/modify.gif)
Title: Re: arm-elf-gcc Compiling error
Post by: bwang on May 13, 2010, 04:07:55 pm
Try editing the Makefile to not delete test.bin after it finishes. Then try running ../../tools/MakeTNS/MakeTNS test.bin ../../res/CAS/test.tns and seeing what error message appears.
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 14, 2010, 04:23:56 am
I tried going to the MakeTNS directory and running
Code: [Select]
MakeTNS test.bin test.tns it but it just returns Failed! like before.


P.S Sorry for not using the modify button... but I hate long posts especially when it has heaps of code in it. I will try to use modify more often now
P.P.S The demo gives the error
Code: [Select]
make: *** No rule to make target 'gravity_particles.o', needed by 'demo'. Stop
Title: Re: arm-elf-gcc Compiling error
Post by: bwang on May 14, 2010, 03:02:02 pm
Is there a gravity_particles.c in the current directory?
Try with a fresh copy of Ndless.
Did you install arm-elf-gcc using the link I gave you?
Title: Re: arm-elf-gcc Compiling error
Post by: DJ Omnimaga on May 14, 2010, 05:45:03 pm
but I hate long posts especially when it has heaps of code in it.
Usually what I do for large posts is separate each edits with colored characters like

Quote
Post 1
##############################

EDIT:

Post 2
That helps distinguishing edits a bit
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 14, 2010, 06:13:09 pm
Thanks for the help bwang.... I just figured it out... I had never made MakeTNS i had always copied it from some other directory for some reason, so I did the makefile in the MakeTNS directory then ran the makefile in the demo directory and it works.

Thanks again for the continued help,
Title: Re: arm-elf-gcc Compiling error
Post by: bwang on May 14, 2010, 07:10:35 pm
So everything is working now? The demo compiles?
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 14, 2010, 07:14:14 pm
Yeah. It compiles for both NON_CAS and CAS and there are no errors or warnings in the compiling any more.

Thanks again, I can finally start developing something
Title: Re: arm-elf-gcc Compiling error
Post by: DJ Omnimaga on May 14, 2010, 07:21:29 pm
w00t! Glad it's fixed :)

Good luck programming
Title: Re: arm-elf-gcc Compiling error
Post by: bwang on May 14, 2010, 07:51:00 pm
Yay! Another Nspire developer :)
Title: Re: arm-elf-gcc Compiling error
Post by: yoshi13 on May 16, 2010, 12:06:27 am
Just a little addition:

I finally got it to work on windows by installing mingw then msys, if you don't install mingw first you get problems with MakeTNS.

Title: Re: arm-elf-gcc Compiling error
Post by: apcalc on July 04, 2010, 10:41:14 am
You need arm-elf-gcc. Try downloading an older version of Yagarto (the version I have installed under WINE says 23.12.2009).

For all new Nspire developers, I do not think the old version of Yagarto (23.12.2009) is available on the website anymore.  To switch to the new version, download and then, In the Makefile, replace "arm-elf-" with "arm-none-eabi-".  This should let you use the new versio (it worked for me).