"Illegal Instruction" error after remastering the Debian OS to include the Asterisk out of the box

I have remastered a Debian(Debian buster) OS and I’ve installed some packages on it including Asterisk. When I install this remastered OS on my own hypervisor, it works perfectly fine, however, when I install it on a hypervisor on a computer other than mine, everything still works fine except for the Asterisk.

For instance, when I install PHP and Apache, they work fine on another machine as well. The same thing is also true about Python. But when I try Asterisk (I install it from source using ./configure && make && make install && make config && make samples), the generated OS will only be installable on my own computer’s hypervisor.

Also, I’ve tried the remastering both on Virtualbox and VMWare Workstation thinking this might fix it but it was irrelevant and gave the same error.

I’m not a system development guru but I guess the issue is probably related to the stage when I run make since it’s creating the objects and it’s probably considering my system’s information(CPU architecture and etc.), but testing the output OS even on computers very similar to mine gives the same Illegal Instruction error when running the asterisk command. Any thoughts on what might be wrong? Is there a way I can get it to work on systems other than mine as well? (I’m using the Asterisk 13.37.0-rc1)

Disable the “BUILD_NATIVE” option in “Compiler Flags” of “make menuselect”. This can also be done from the command line[1].

[1] https://wiki.asterisk.org/wiki/display/AST/Using+Menuselect+to+Select+Asterisk+Options#UsingMenuselecttoSelectAsteriskOptions-ControllingMenuselect

1 Like

Great! Thanks, I’ll give this a try right now! Could you please explain why that flag is enabled by default?

Because, on machines that provide correct CPU information, it can generate better code. Some virtual machines appear to misrepresent the CPU capabilities.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.