I have C++ program that uses boost (Logger mainly). This programs compiles and runs well on Windows and Ubuntu. However, when I try to port it to Linux Yocto on an embedded system (Intel Atom processor), I got illegal instructions error at runtime.
The program itself is built on Ubuntu PC with Intel-i5.
I debugged the issue and it was some AVX instructions from another library (OpenCV). I disabled all AVX and the problem solved but another problem occurred.
It now tells me that (after reading the core dumb using gdb
):
Program terminated with signal SIGILL, Illegal instruction. 0x00007fe1aed03ade in boost::gregorian::date::date(boost::gregorian::greg_year, boost::gregorian::greg_month, boost::gregorian::greg_day) ()
- I did not use
boost::gregorian::date
explicitly - Is it possible that
boost::gregorian::date
use some optimized insruction?! like SSE or AVX? (seems non-logical) - Any clue about the issue?
P.S. the error occurs at run-time before anything else. Even a cout
at the first line of the main function is not executed before I got the error. So, I suspect some static constructor
inside boost causes the problem since there is no static constructor at my code.
Edit:
All librires and the program itself are compiled with -march=bonnell -mno-avx -O2