Skip to content

Fix install_name_tool argument (macos)#15

Open
PGGB wants to merge 1 commit intoMegus:mainfrom
PGGB:patch-1
Open

Fix install_name_tool argument (macos)#15
PGGB wants to merge 1 commit intoMegus:mainfrom
PGGB:patch-1

Conversation

@PGGB
Copy link

@PGGB PGGB commented Feb 9, 2026

The old path does not match the path linked in the executable, so the command doesn't work.
This means the app depends on Homebrew SDL2 and does not use the bundled library. If SDL2 is not installed via Homebrew you get the following error:

❯ ChipNomad.app/Contents/MacOS/chipnomad
dyld[70331]: Library not loaded: /opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib
  Referenced from: <D62710E5-38A2-394B-B5F9-7FC1C47FC916> /Users/danielnagel/Downloads/ChipNomad-2026-02-01-0.1.0b-macOS/ChipNomad.app/Contents/MacOS/chipnomad
  Reason: tried: '/opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib' (no such file), '/opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib' (no such file)

Old command:

@install_name_tool -change /opt/homebrew/lib/libSDL2-2.0.0.dylib @executable_path/../Frameworks/libSDL2-2.0.0.dylib $(BUILD)/$(APP_BUNDLE)/Contents/MacOS/chipnomad 2>/dev/null || true

Output from otool:

Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 72
         name /opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 3201.10.0
compatibility version 3201.0.0

New command matching the path linked in the executable:

@install_name_tool -change /opt/homebrew/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/../Frameworks/libSDL2-2.0.0.dylib $(BUILD)/$(APP_BUNDLE)/Contents/MacOS/chipnomad 2>/dev/null || true

Output from otool after the change:

Load command 14
          cmd LC_LOAD_DYLIB
      cmdsize 80
         name @executable_path/../Frameworks/libSDL2-2.0.0.dylib (offset 24)
   time stamp 2 Thu Jan  1 01:00:02 1970
      current version 3201.10.0
compatibility version 3201.0.0

The old path does not match the path linked in the executable, so the command doesn't work.
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

Successfully merging this pull request may close these issues.

1 participant