systemd: Freezing execution in intel ATOM processor
We have a legacy device with following configurations:
Chipset Architecture : Intel NM10 express
OS : Yocto warrior
CPU : Atom D2250 Dual Core
Volatile Memory : 2GB DDR3
CPU core : 4
I have generated 64-bit core-image-sato and run on my device but *systemd* freezes execution with SIGILL (as shown below). I have set MACHINE to “intel-corei7-64”.
systemd: Set hostname to <panther1>.
traps: systemd trap invalid opcode ip:7f257b9b8bd7 sp:7ffe7bc63090 error:0 in libsystemd-shared-241.so[7f257b8b4000+12f000]
systemd: Caught <ILL>, core dump failed (child 77, code=killed, status=4/ILL).
systemd: Freezing execution.
PLEASE NOTE, THE ISSUE IS NOT OBSERVED WITH 32-BIT IMAGE(where MACHINE is set to “intel-core2-32”).
From @Peter Cordes,
… Obviously the assembly instruction that faulted would be more relevant than the source code. If your GCC compiled with anything that -march=native doesn't include, your binaries can include instructions that your CPU doesn't support. https://ark.intel.com/content/www/us/en/ark/products/65470/intel-atom-processor-d2550-1m-cache-1-86-ghz.html says your CPU only supports up to SSSE3, and thus not popcnt or SSE4.1 which GCC certainly can use when optimizing / auto-vectorizing pure C code. (SSE4.2 doesn't tend to get used automatically, unless you count popcnt as part of that.) So that easily accounts for GCC emitting code that will SIGILL on your machine. BTW, if you're cross-compiling, you need -march=atom not native…
I tried with “-march=atom” but build fails with “unable to find CPU model 'atom'”. I also tried other ways(like changing DEFAULTTUNE, passing -msse3 parameter etc) but got compilation issues and nothing worked out.