neurobin / shc

Shell script compiler
https://neurobin.org/projects/softwares/unix/shc/
GNU General Public License v3.0
2.04k stars 349 forks source link

Compiled shc not working on M2 Pro CPU #158

Open edtrud opened 1 year ago

edtrud commented 1 year ago

I compiled the bash executable on an intel Mac and had no issues running on other intel mac, M1, M2 processor macs. When I run the executable on an M2 Pro I receive the error:

unable to execute ./myprogram: Bad CPU type in executable

Spritzerland commented 1 year ago

shc converts the executable to an x86-64 architecture

mdeweerd commented 3 months ago

If it's related to a 32bit/64bit architecture, know that you can set compiler flags in the environment. (CFLAGS/LDDFLAGS/...). So then you could set -m32 (I believe that's the option) to compile.