• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Linking against a re-exported library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking against a re-exported library


  • Subject: Re: Linking against a re-exported library
  • From: Michael Babin <email@hidden>
  • Date: Tue, 31 Dec 2013 08:52:24 -0600

On Dec 31, 2013, at 3:08 AM, Kyle Sluder <email@hidden> wrote:

> The install name for libpq.5.6.dylib is actually "libpq.5.dylib", and it
> is configured to look for libssl and libcrypto in "@loader_path/../lib".
> Since I can't seem to change libpq's install name, I'm copying all three
> dylibs to a "lib" subdirectory in the framework wrapper, and using a Run
> Script build phase to generate a wrapper PostgreSQL.dylib that
> re-exports the symbols from libpq:
>
> #--snip--
> EXECUTABLE_PATH="$TARGET_BUILD_DIR/$CONTENTS_FOLDER_PATH/$EXECUTABLE_NAME"
> ld -dylib -arch "$CURRENT_ARCH" -reexport_library
> "$TARGET_BUILD_DIR/$WRAPPER_NAME/lib/libpq.5.6.dylib" -o
> "$EXECUTABLE_PATH" -install_name "$LD_DYLIB_INSTALL_NAME"
> #--snip--
>
> This results in a framework with the following structure:
>
> PostgreSQL.framework/
> Versions/
>   A/
>     PostgreSQL
>     lib/
>       libpq.5.6.dylib
>       libssl.1.0.0.dylib
>       libcrypto.1.0.0.dylib
>
> Then, because libpq's install name was just plain "libpq.5.dylib" at the
> time my ld command created the wrapper dylib, my Run Script phase needs
> to patch up the wrapper dylib's load commands:
>
> #--snip--
> install_name_tool -change "libpq.5.dylib"
> "@rpath/$CONTENTS_FOLDER_PATH/lib/libpq.5.6.dylib" "$EXECUTABLE_PATH"
> #--snip--
>
> otool shows the result:
>
> % otool -L PostgreSQL.framework/Versions/A/PostgreSQL
> PostgreSQL.framework/Versions/A/PostgreSQL:
>   @rpath/PostgreSQL.framework/Versions/A/PostgreSQL (compatibility
>   version 0.0.0, current version 0.0.0)
>   @rpath/PostgreSQL.framework/Versions/A/Libraries/libpq.5.6.dylib
>   (compatibility version 5.0.0, current version 5.6.0)
>
> That seems all well and good until my app's model library tries to link
> against this framework. Then ld complains:
>
> File not found:
> @rpath/PostgreSQL.framework/Versions/A/Libraries/libpq.5.6.dylib for
> architecture x86_64

Not sure if this is a typo or editing error in composing this message or reflects an actual discrepancy in paths, but the framework structure provided uses "lib" as the directory name while the otool output and link error contains "Libraries" as the directory name.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Linking against a re-exported library
      • From: Kyle Sluder <email@hidden>
References: 
 >Linking against a re-exported library (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Linking against a re-exported library
  • Next by Date: Re: Linking against a re-exported library
  • Previous by thread: Re: Linking against a re-exported library
  • Next by thread: Re: Linking against a re-exported library
  • Index(es):
    • Date
    • Thread