[CDRIVER-2175] libbson cmake: pthreads not correctly compiled in Created: 05/Jun/17 Updated: 28/Oct/23 Resolved: 12/Jun/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.7.0 |
| Fix Version/s: | 1.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hannes Magnusson | Assignee: | Hannes Magnusson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Epic Link: | convenient-static | ||||||||||||
| Description |
|
Our CMake check for pthreads is incorrect. cmake 3.1 adds a easy way to do this: https://cmake.org/cmake/help/latest/module/FindThreads.html
The c++ driver requires cmake 3.2, so I think it would be fine if we bump our dependency to 3.1. |
| Comments |
| Comment by Githook User [ 12/Jun/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 12/Jun/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 12/Jun/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'username': 'bjori', 'name': 'Hannes Magnusson', 'email': 'bjori@php.net'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 05/Jun/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It looks the find_package(FOOBAR) usually exposes FOOBAR_LIBRARIES FOOBAR_FLAGS variables we should be catching to build up our secondary list of compiler and linker flags. Then we don't need to do the aggressive platform assumptions when building that CONFIG_LIBS string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 05/Jun/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
this patch now fails the static linking evergreen task as our alternative compiler and linker flag strings no longer hardcode pthreads for the linker stage. I think that is a separate bug though, we shouldn't need to be maintaining secondary lists of all the compiler and linker flags? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 05/Jun/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think the way -lpthread was added to the linker flags also caused the confusion when the .cmake and .pc files were being created.
that flag contained -lpthread, while it was the only flag in the manually created CONFIG_LIBS string that contained -l, which resulted in those prefix checks later added |