Problems with illegal instruction
Hi all!
What is the reason behind this message: Code:
Program received signal SIGILL, Illegal instruction. |
Hmm the only time I've seen this was when I was using GCC to compile an app for an AMD CPU, but I chose an Intel CPU target.
This -might- be the cause of the "illegal instruction" you are getting - what happened to me whenever I tried to run the "Intel" binary on my AMD machine was that the binary tried to execute Intel specific instructions on an AMD architecture, which of course did not work. I. e. my CFLAGS sent to GCC were Code:
-O3 -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing -funroll-loops -funroll-all-loops -fforce-addr -finline-functions -frerun-loop-opt -falign-loops=4 -falign-jumps=4 -falign-functions=4 -march=pentium -mmmx -msse Code:
-O3 -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing -funroll-loops -funroll-all-loops -fforce-addr -finline-functions -frerun-loop-opt -falign-loops=4 -falign-jumps=4 -falign-functions=4 -march=athlon -mmmx -msse -m3dnow |
i use "file" command to check two executable files:
Code:
[root@localhost boa]#file boa |
This is GNU or GCC version for Linux.
|
Short answer - you are using a wrong toolchain, i.e. not the one that was used to compile your kernel and all the working applications.
Do you have the toolchain that came with this board ? |
Quote:
|
Are sure you use the same toolchain to compile both boa and appweb applications ? Same include path ?
|
It would also help if you could run "bt" in the gdb, to show us the exact line number of the problematic code
|
Floating point divide by zero
i have used gdb to debug my code. The reason it is crashing is a floating point divide by zero. The result should be NaN (or Infinity). It should not throw an exception. So, how to get this working.
My test code: Code:
#include <stdio.h> Code:
BEFORE Code:
Program received signal SIGILL, Illegal instruction. |
Try -msoft-float
|
The error code sent from kernel has limit reason, it hasn't NaN code.
|
Quote:
Thanks! |
Although the kernel should recognize NaN code, the NaN code can't return back to user space.
|
All times are GMT -5. The time now is 05:03 AM. |