Skip to content
Snippets Groups Projects

[3.0.x] build: use DYLD_LIBRARY_PATH on macOS

Merged Marvin Scholz requested to merge ePirat/vlc:epirat-3.0.x-use-dyld-library-path into 3.0.x

cf. https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryUsageGuidelines.html#//apple_ref/doc/uid/TP40001928-SW12

""" When the library name is a filename (that is, when it doesn’t include directory names), the dynamic loader searches for the library in several locations until it finds it, in the following order:

  • $LD_LIBRARY_PATH
  • $DYLD_LIBRARY_PATH
  • The process’s working directory
  • $DYLD_FALLBACK_LIBRARY_PATH

When the library name contains at least one directory name, that is, when the name is a pathname (relative or fully qualified), the dynamic loader searches for the library in the following order:

  • $DYLD_LIBRARY_PATH using the filename
  • The given pathname
  • $DYLD_FALLBACK_LIBRARY_PATH using the filename """

Conclusion: DYLD_LIBRARY_PATH on macOS behave like LD_LIBRARY_PATH on Linux but LD_LIBRARY_PATH on macOS has a different behavior than LD_LIBRARY_PATH on Linux, so DYLD_LIBRARY_PATH should be used on macOS. Specially since we can't really control if the library name will include a path or not (relative or absolute).

(cherry picked from commit abbe7f3b) Signed-off-by: Marvin Scholz epirat07@gmail.com

Edited by Marvin Scholz

Merge request reports

Merge request pipeline #164801 passed

Merge request pipeline passed for db55aaa0

Merged by Hugo Beauzée-LuyssenHugo Beauzée-Luyssen 3 years ago (Dec 2, 2021 8:58am UTC)

Loading

Pipeline #164805 passed

Pipeline passed for db55aaa0 on 3.0.x

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading