illegal instruction rtklib

marco
I get this error when run the rtkrcv server if the rtklib is compiled with

arm-none-linux-gnueabi-gcc -Wall -O0 -ansi -pedantic -msoft-float
-D__GCC_FLOAT_NOT_NEEDED  -march=armv4 -mtune=arm920t 

while no error if compile it with 

arm-linux-gcc -Wall -O0 -ansi -pedantic -msoft-float
-D__GCC_FLOAT_NOT_NEEDED  -march=armv4 -mtune=arm920t 

is it strange isn't it, any ideas?

Anyway even in the second case I didn't obtain the expected results.

The rtklib is working on BeagleBoard, I do not know why is not working on
mini2440

nils
Two toolchains installed and one is broken?

Find out with 'which arm-...'

marco
They belong to the same toolchain, and the compile process works perfect.
Only at runtime I get the "illegal instruction". 

the arm-none-linux-gnueabi- works perfectly while compiling other software
like the Qtopia libs...

Furthermore the  "arm-linux-gcc" is a script file contains:

#!/bin/bash

exec arm-none-linux-gnueabi-gcc -march=armv4t $*

so it is nothing more that a reference to the other compiler.

It is really strange

davef
Have you done a readelf -a <filename> on both files and do those files end
with the same: 

Tag_attributes (at the end of output).

I assume you have done a :
file <filename> to ensure they are both cross-compiled

willi
your march-option is wrong. Try

-march=armv4t (with lowercase t at the end).

hth

marco
arm-none-linux-gnueabi-gcc works perfectly on others compilation like the
QT library compilation etc. only on this case produces the illegal
instruction. 

I use your  march-option willi but without success

skip2816
hi marco,

can it be a bug in your software?
Ie a corrupted stack frame can lead in illegal instruction at function
return. Its fast happens by overwriting the boundary of a locale variable.

skip

marco
Hi Skip2816,
it could be, but a bug dose not general depends on the compiler used but on
the code itself. Furthermore in this case the compiler is the same...

I mean, I use the same arm-none-linux-gnueabi-gcc compile with the same
options, but one directly arm-none-linux-gnueabi-gcc (dose not work) and
one via script arm-linux-gcc (works without illegal instruction but
provides wrong results)

marco
Hi davef,
the programs are cross compiled and both two starts but one (compiled with
arm-none-linux-gnueabi-gcc) gives illegal instruction somewhere while other
(compiled with arm-linux-gcc)gives no errors.

marco
Hi davef,
I did your test with readelf and strangely the one compiled with
arm-linux-gcc produces CPU_name= 4T CPU_arch= v4T while the others with
arm-none-linux-gnueabi-gcc produces CPU_name=ARM10TDMI and CPU_arch=v5TE.
even if the compilation flags are the same.

marco
Ok I solved it, while linking the object file I miss the architecture
options.
Thanks you all

skip2816
hi marco,

Maybe the compiler has a problem, but in the almost cases is the problem
your own. 

I will say, look sharp on your buil process. Are the libraries you link
realy the same as on the board? 
Not every bug must crash a program, and if it does it not on all platforms.


skip

davef
Marco,

Could you explain how you change/set the architecture options in the
linker?

I am ending up with v5TE instead of v4t when I compile tslib. Maybe, have a
look at http://www.friendlyarm.net/forum/topic/2178 and see if you can
suggest anything.

Thanks,
Dave

ainiey
hye...currently i used rtklib but i got a problem when the signal cannot be
displayed on rtklib.how to overcome this problem?is it rtklib is compatible
with javad sigma receiver?

julio
dear all,

i am facing same "illegal instruction rtklib".
Nanopi arm 929ej-s,  cpu 5tej

i try -march=v5te and v4t  softfp

i appreciate any help about cflags or Makefiles changes

thx

julio

btw, the toolchain do not work under my Debian_8_x64
it works under Debian7_x32.

http://wiki.friendlyarm.com/wiki/index.php/NanoPi#Install_Cross_Compiler
PATH=/opt/FriendlyARM/toolschain/4.4.3/bin:$PATH