macos clang linking with framework set LC_LOAD_DYLIB to a specific path

Viewed 75

Trying to link with framework as:

/Users/Username/Application/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-Wl,
-arch,arm64,
-syslibroot,/Users/Username/Application/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk,
-rpath,@loader_path,
-no_deduplicate,
-dead_strip
-target arm64-apple-macosx10.12-macho
-o /pathToArtifact/executable /SomePath/obj.o
-framework some_framework

otool -L output is:

@rpath/some_framework.framework/Versions/A.B.C.D/some_framework (compatibility version 0.0.0, current version A.B.C)

and I expeted it as:

@rpath/some_framework.framework/Versions/Current/some_framework (compatibility version 0.0.0, current version A.B.C)

or

@rpath/some_framework.framework/some_framework (compatibility version 0.0.0, current version A.B.C)

The framework has the next structure:

Headers -> Versions/Current/Headers
Resources -> Versions/Current/Resources
Versions -
           2.1.1.0 -
                     Headers
                     Resources
                     some_framework
           Current -> 2.1.1.0
some_framework -> Versions/Current/some_framework

Am I wrong with clang args or it's the only correct way?

0 Answers
Related