[CDRIVER-1171] pkgconfig libmongoc-1.0.pc: fix order of of libraries Created: 23/Mar/16  Updated: 10/Aug/16  Resolved: 18/Apr/16

Status: Closed
Project: C Driver
Component/s: packaging
Affects Version/s: 1.3.0
Fix Version/s: 1.4.0

Type: Bug Priority: Major - P3
Reporter: David Daly Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-1343 Incorrect pkgconfig files produced wh... Closed
Epic Link: Native TLS and SCRAM-SHA-1

 Description   

In libmongoc-1.0.pc the Libs line is

Libs: -lsasl2 -framework Security -framework CoreFoundation  -L${libdir} -lmongoc-1.0

Some systems or tool chains process libaries in order and only link used functions. For such systems the order of the libraries is significant. Since mongoc-1.0 depends on the other libraries, this ordering might be better:

Libs: -L${libdir} -lmongoc-1.0  -lsasl2 -framework Security -framework CoreFoundation 

I've had to edit the pc file manually recently to get a project to build properly.
I've been using r1.3. The file appears to be unchanged through recent master 26494954a.

Thanks.



 Comments   
Comment by Githook User [ 18/Apr/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1171 order of libraries in libmongoc-1.0.pc
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/898ad602ce0aa13f33af0f086576ac7b5fa07b86

Comment by David Daly [ 18/Apr/16 ]

I think I first ran into this on a vanilla Ubuntu 14.04 with gcc 4.8.4. I have a C++ project that I build using cmake, and it got linker errors.

Comment by Hannes Magnusson [ 18/Apr/16 ]

Out of curiosity, which system/toolchain are you using?

Comment by A. Jesse Jiryu Davis [ 23/Mar/16 ]

Good idea, thanks.

Generated at Wed Feb 07 21:11:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.