Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1343

Incorrect pkgconfig files produced when linking with static OpenSSL library

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.4.0
    • Affects Version/s: 1.3.5
    • Component/s: libmongoc
    • Environment:
      Linux, clang

      When building against a static OpenSSL library, the lib/pkgconfig/libmongoc-{1.0,priv}.pc files produced by the make install command contain the incorrect order for the libraries specified by the linker flags.

      The Libs line of those files looks like this:

      -L/usr/local/dy/openssl/lib -lssl -lcrypto -ldl   -lrt -L${libdir} -lmongoc-1.0
      

      However, that link order is incorrect because `mongoc-1.0` requires symbols from the OpenSSL libraries, so the current ordering of the mongoDB library and the OpenSSL libraries is backwards. Therefore, the `Libs` line should look like this instead:

      Libs: -L${libdir} -lmongoc-1.0 -L/usr/local/dy/openssl/lib -lssl -lcrypto -ldl -lrt
      

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            jwang Jonathan Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: