tpoechtrager / osxcross

Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
GNU General Public License v2.0
2.85k stars 320 forks source link

install_name_tool makes binary not working on M1 #279

Open mmicko opened 3 years ago

mmicko commented 3 years ago

Hi, Working on cross compile environment for compiling various projects, and later package them with dylibbundler to package at the end.

On x64 it works nice, but for aarch64 (arm64) binary not working after being affected by dylibbundler (install_name_tool used by it)

Sending example files:

  1. original - directory contains original binary (uses macports installed on machine)
  2. cross - contains binary and libs after running ( dylibbundler -of -b -x bin/ecpprog -p @executable_path/../lib -d lib )
  3. real - contains binary and libs after running same command on M1 hardware

m1example.zip

Please tell if there is anything that I can try on my end in order to debug this issue.

So far I have noticed that install_name_tool on real hardware also affects file doing size alignment on 8 bytes, so its harder to track what else is changed in binary files.