Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS build creates symlinks for dylibs, leading to incorrect linkage #1560

Open
fatcerberus opened this issue May 29, 2024 · 0 comments
Open

Comments

@fatcerberus
Copy link
Contributor

fatcerberus commented May 29, 2024

Building Allegro for macOS creates several dylibs for each Allegro component, like this:

liballegro.dylib
liballegro.5.2.dylib
liballegro.5.2.10.dylib
etc.

with the one having the full version number being the real one and the rest being symlinks. However this causes problems because:

Load command 4
          cmd LC_ID_DYLIB
      cmdsize 56
         name @rpath/liballegro.5.2.dylib (offset 24)
   time stamp 1 Wed Dec 31 19:00:01 1969
      current version 5.2.10
compatibility version 5.2.0

The install name in the dylib refers to one of the symlinks. Then, when one of these is imported into e.g. an Xcode project, Xcode follows the symlink and pulls in the real file - which, if dylibs are bundled with the app, leads to the OS being unable to load them because the name the linker used in the executable (taken from LC_ID_DYLIB) doesn't match the name of the file that actually got bundled. In other words, liballegro.5.2.10.dylib is what gets bundled, but the OS tries to load liballegro.5.2.dylib at runtime, and the app crashes on startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant