Skip to content

Consider RPATH-ing native library name on OS X #55

Closed
@Therzok

Description

@Therzok

Currently, doing otool -L on the native library gives us this output:

otool -L libgit2-15e1193.dylib 
libgit2-15e1193.dylib:
    /Users/travis/build/libgit2/libgit2sharp.nativebinaries/libgit2/build/libgit2-15e1193.26.dylib (compatibility version 26.0.0, current version 0.26.0)
    /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 8.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57337.40.83)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

That means that the library will fail to resolve if it's copied to the output directory without special DYLD_* env vars.

Stripping the path at build time or using @loader_path (CMAKE_INSTALL_RPATH @loader_path) would fix this or post-build with install_name_tool -id would allow the library to be used out of the box on Mono on OS X.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions