This repository was archived by the owner on May 31, 2025. It is now read-only.
Protection against double -l#998
Merged
dirk-thomas merged 1 commit intoros:kinetic-develfrom Mar 12, 2019
Merged
Conversation
Member
|
Thanks for the patch. I verified that the problem exists in e.g. Ubuntu Disco (which has a new enough CMake version to export |
Contributor
Author
|
Not solving yet all the issues :-( |
Member
This report wasn't used the latest state of all patches. |
Contributor
Author
|
well, I was using the 0.3.4 version that seem that is the version in melodic: what about to release a 0.3.5 with all that patches? |
Member
Sounds good: ros/rosdistro#20577 |
sloretz
added a commit
to sloretz/catkin
that referenced
this pull request
Aug 3, 2019
FindBoost.cmake blindly adds `${CMAKE_THREAD_LIBS_INIT}` to
`${Boost_LIBRARIES}` when the component `thread` is found.
On Debian buster the `FindThreads.cmake` sets that to `-pthread`.
This breaks a bunch of stuff becakse `-pthread` is a linker flag, not a
library.
There were earlier fixes for `-lpthread`.
This PR expands upon them.
First this PR modifies the fix from ros#998 to not add `-l` to any linker flag.
Second it adds to the fix in ros#975 to make sure `-pthread` is passed to
downstream users.
There's no standard cmake variable for linker flags, so this PR opts to
create an interface target with just the flag, and add that to
`${PROJECT_NAME}_LIBRARIES` instead.
Both this PR and ros-visualization/python_qt_binding#68 are required to strip or `qt_gui_cpp` will fail at link time.
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
dirk-thomas
pushed a commit
that referenced
this pull request
Oct 7, 2019
* Fix -pthread handling in Debian buster
FindBoost.cmake blindly adds `${CMAKE_THREAD_LIBS_INIT}` to
`${Boost_LIBRARIES}` when the component `thread` is found.
On Debian buster the `FindThreads.cmake` sets that to `-pthread`.
This breaks a bunch of stuff becakse `-pthread` is a linker flag, not a
library.
There were earlier fixes for `-lpthread`.
This PR expands upon them.
First this PR modifies the fix from #998 to not add `-l` to any linker flag.
Second it adds to the fix in #975 to make sure `-pthread` is passed to
downstream users.
There's no standard cmake variable for linker flags, so this PR opts to
create an interface target with just the flag, and add that to
`${PROJECT_NAME}_LIBRARIES` instead.
Both this PR and ros-visualization/python_qt_binding#68 are required to strip or `qt_gui_cpp` will fail at link time.
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* math() output actually used
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* dummyN -> wrapped-linker-optionsN
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Fix pre-3.13.0 target property setting
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Add test for propagation of linker options
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Force add CMakeLists.txt
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Indent using 2 spaces
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
* Increment until target is unique
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have been working rebuilding ROS Melodic for Stretch using the debian packages
and I have been blocked in an error in qt_gui_cpp:
/usr/bin/ld: cannot find -l-lpthread
that error have been found in several places:
https://aur.archlinux.org/packages/ros-melodic-qt-gui-cpp/
ros/ros-overlay#711
and probably more places.
You have been working in a patch for something similar:
#975
But I think that the problems comes from another place and @ipa-mdl point me to
the error when here said:
ipa-mdl commented on 2 Jan
@dirk-thomas: TL;DR: Upstream CMake just started to inject -lpthread into
Boost_LIBRARIES .
The problem comes from the the .pc files. It's strange to me because from all
the pc files generated by catkin that we have in debian (Buster/Sid), I have
only detected rosconsole.pc that had -l-lpthread.
But, in the backported version that I have, there are more. I'm using
cmake-3.13.2-1 and maybe, it comes because that version. The vast majority of
debian packages were generated before cmake 3.12 or 3.13 arrived to the archive.
In Ubuntu bionic cmake is 3.10.2.
The solution is simple, is this patch.
I have to admit that in gazebo, Jose Rivero incorporated a patch from Bas
Couwenberg solving a very similar issue.
What do you think?