Skip to content

Fix install_name_tool argument (macos)#15

Merged
Megus merged 1 commit intoMegus:mainfrom
PGGB:patch-1
Mar 22, 2026
Merged

Fix install_name_tool argument (macos)#15
Megus merged 1 commit intoMegus:mainfrom
PGGB:patch-1

Conversation

@PGGB
Copy link
Copy Markdown
Contributor

@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.
@Megus Megus merged commit 22134ef into Megus:main Mar 22, 2026
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.

2 participants