32-bit App with dynamic library crash on 64-bit device

别等时光非礼了梦想. 提交于 2019-12-08 05:00:56

问题


I am facing the following scenario:

  • 32 bit device + app armv7 + dynamic library armv7 arm64 = work
  • 64 bit device + app armv7 + dynamic library armv7 arm64 = doesn't work

doesn't work - app crashes on load with the following error:

dyld error message library not loaded reason no suitable image found

Any explanations?


回答1:


Explanation: 32 bit binaries loaded on 64 bit devices fail to do so since the 32 bit pagesize has been changed from 4096 bytes to 16384 bytes in iOS 9.

Conclusion: 32-bit apps with dynamic libraries cannot run on 64-bit devices.

Solutions (one of the two is enough):

  • Add a new entry to Other linker flags in the dynamic library project:

    -Wl,-segalign,4000

  • Update app itself to support arm64 architecture


来源:https://stackoverflow.com/questions/34707643/32-bit-app-with-dynamic-library-crash-on-64-bit-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!