[Pkg-cmake-team] Bug#915148: Bug#915148: cmake: regression in ros-ros-comm build

Jochen Sprickerhof jspricke at debian.org
Fri Dec 7 12:44:20 GMT 2018


* Brad King <brad.king at kitware.com> [2018-12-07 07:29]:
>On 12/6/18 4:16 PM, Jochen Sprickerhof wrote:
>> after reading up on this, I think this needs fixing in cmake.
>>
>> So neither adding -lpthread,
>> nor adding /usr/lib/x86_64-linux-gnu/libpthread.so
>> seems correct to me.
>
>Both are valid ways to link to the pthread library, which is all
>the `-pthread` flag does when used to drive linking.

I don't agree. Quoting from my mail:

* Jochen Sprickerhof <jspricke at debian.org> [2018-12-06 22:16]:
>| -pthread
>| | Define additional macros required for using the POSIX threads
>| library.  You should use this option consistently for both
>| compilation and linking.  This option is supported on GNU/Linux
>| targets, most other Unix derivatives, and also on x86 Cygwin and
>| MinGW targets.

"Define additional macros required"

see:

diff <(g++ -dM -E -x c++ - < /dev/null) <(g++ -pthread -dM -E -x c++ - < /dev/null)
106a107
> #define _REENTRANT 1

(But I'm not a compiler expert.)

>The patch here:
>
>  http://launchpadlibrarian.net/399812910/ros-catkin_0.7.14-7_0.7.14-7ubuntu1.diff.gz
>
>is not a workaround.  The input to that logic could contain -lfoo
>generated by other means for other libraries.  This case just
>happened to expose the existing bug in that logic.

I agree.

>Actually looking at the applied fix
>
>  https://sources.debian.org/src/ros-catkin/0.7.14-8/cmake/templates/pkgConfig.cmake.in/#L118
>
>that logic may need additional work to handle plain `-pthread`
>or other link flags.

I don't agree, -pthread should be in CXXFLAGS, whereas the 
pkgConfig.cmake process @PKG_CONFIG_LIBRARIES at .

>CMake's FindBoost and FindThreads could use some work to use
>`-pthread` more completely (perhaps with a policy to use it
>by default on appropriate compilers), and there is an issue
>related to this here:

+1.

Cheers Jochen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-cmake-team/attachments/20181207/57d97f60/attachment.sig>


More information about the Pkg-cmake-team mailing list