1

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

Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160
  • The only clue I can think of would be that (a) you're accidentally using a binary not compiled with those flags (b) the compiler accidentally emits code not suitable for the selected target ((b2) the architecture id is not exactly the right one for this revision of the processor) – sehe Mar 06 '18 at 01:22
  • 1
    https://stackoverflow.com/questions/110674/gcc-optimization-flags-for-intel-atom – sehe Mar 06 '18 at 01:24

0 Answers0