Skip to content

Commit

Permalink
{rolling} fastrtps: backport a patch for compatibility with old toolc…
Browse files Browse the repository at this point in the history
…hain on host

* building new version of rmw-fastrtps-shared-cpp-native fails on Ubuntu-18.04
  with gcc-7 with:
ERROR: rmw-fastrtps-shared-cpp-native-5.0.0-1-r0 do_compile: Execution of '/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/temp/run.do_compile.75430' failed with exit code 1:
[1/2] /jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/hosttools/g++ -DFOONATHAN_MEMORY=1 -DFOONATHAN_MEMORY_VERSION_MAJOR=0 -DFOONATHAN_MEMORY_VERSION_MINOR=6 -DFOONATHAN_MEMORY_VERSION_PATCH=2 -DRMW_FASTRTPS_SHARED_CPP_BUILDING_LIBRARY -DROS_PACKAGE_NAME=\"rmw_fastrtps_shared_cpp\" -Drmw_fastrtps_shared_cpp_EXPORTS -I/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/git/include -I/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/recipe-sysroot-native/usr/include/foonathan_memory/comp -I/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/recipe-sysroot-native/usr/include/foonathan_memory -isystem/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/recipe-sysroot-native/usr/include -O2 -pipe -fPIC -Wall -Wextra -Wpedantic -std=gnu++14 -MD -MT CMakeFiles/rmw_fastrtps_shared_cpp.dir/src/utils.cpp.o -MF CMakeFiles/rmw_fastrtps_shared_cpp.dir/src/utils.cpp.o.d -o CMakeFiles/rmw_fastrtps_shared_cpp.dir/src/utils.cpp.o -c /jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/git/src/utils.cpp
FAILED: CMakeFiles/rmw_fastrtps_shared_cpp.dir/src/utils.cpp.o
/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/hosttools/g++ -DFOONATHAN_MEMORY=1 -DFOONATHAN_MEMORY_VERSION_MAJOR=0 -DFOONATHAN_MEMORY_VERSION_MINOR=6 -DFOONATHAN_MEMORY_VERSION_PATCH=2 -DRMW_FASTRTPS_SHARED_CPP_BUILDING_LIBRARY -DROS_PACKAGE_NAME=\"rmw_fastrtps_shared_cpp\" -Drmw_fastrtps_shared_cpp_EXPORTS -I/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/git/include -I/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/recipe-sysroot-native/usr/include/foonathan_memory/comp -I/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/recipe-sysroot-native/usr/include/foonathan_memory -isystem/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/recipe-sysroot-native/usr/include -O2 -pipe -fPIC -Wall -Wextra -Wpedantic -std=gnu++14 -MD -MT CMakeFiles/rmw_fastrtps_shared_cpp.dir/src/utils.cpp.o -MF CMakeFiles/rmw_fastrtps_shared_cpp.dir/src/utils.cpp.o.d -o CMakeFiles/rmw_fastrtps_shared_cpp.dir/src/utils.cpp.o -c /jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/git/src/utils.cpp
/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/git/src/utils.cpp: In function ?bool rmw_fastrtps_shared_cpp::find_and_check_topic_and_type(const CustomParticipantInfo*, const string&, const string&, eprosima::fastdds::dds::TopicDescription**, eprosima::fastdds::dds::TypeSupport*)?:
/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/git/src/utils.cpp:107:71: error: use of deleted function ?eprosima::fastdds::dds::TypeSupport& eprosima::fastdds::dds::TypeSupport::operator=(const eprosima::fastdds::dds::TypeSupport&)?
   *returned_type = participant_info->participant_->find_type(type_name);
                                                                       ^
In file included from /jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/git/include/rmw_fastrtps_shared_cpp/utils.hpp:22:0,
                 from /jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/git/src/utils.cpp:17:
/jenkins/mjansa/build/ros/webos-rolling-hardknott/tmp-glibc/work/x86_64-linux/rmw-fastrtps-shared-cpp-native/5.0.0-1-r0/recipe-sysroot-native/usr/include/fastdds/dds/topic/TypeSupport.hpp:50:7: note: ?eprosima::fastdds::dds::TypeSupport& eprosima::fastdds::dds::TypeSupport::operator=(const eprosima::fastdds::dds::TypeSupport&)? is implicitly declared as deleted because ?eprosima::fastdds::dds::TypeSupport? declares a move constructor or move assignment operator
 class TypeSupport : public std::shared_ptr<fastdds::dds::TopicDataType>
       ^~~~~~~~~~~

  current code requires gcc-9.1 and newer as it targets Ubuntu-20.04 (officially
  supported platform of Foxy, Rolling, Galactic). gcc-cross in OE is new enough
  (9 in dunfell, 10.2 in gatesgarth and hardknott), but in this case it was building
  native, so using host's gcc-7.

  ros2/rmw_fastrtps#518 (comment)
  eProsima/Fast-DDS#1912

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
  • Loading branch information
shr-project committed Apr 17, 2021
1 parent 8da5b93 commit f2eeb53
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
From c717fe60e862b81a7aa3ed46e17114c36aafcd10 Mon Sep 17 00:00:00 2001
From: Miguel Company <miguelcompany@eprosima.com>
Date: Tue, 13 Apr 2021 15:02:54 +0200
Subject: [PATCH] Add missing operators to TypeSupport (#1912)

Upstream-Status: Backport [v2.3.01 https://github.com/eProsima/Fast-DDS/commit/d05d0cf2a78b8a1588e9f2d712e200fde62554dd]

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Martin Jansa <martin.jansa@lge.com>
---
include/fastdds/dds/topic/TypeSupport.hpp | 32 ++++++++++++++++-------
1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/include/fastdds/dds/topic/TypeSupport.hpp b/include/fastdds/dds/topic/TypeSupport.hpp
index a17c503b..12bfd6cf 100644
--- a/include/fastdds/dds/topic/TypeSupport.hpp
+++ b/include/fastdds/dds/topic/TypeSupport.hpp
@@ -57,25 +57,39 @@ public:
using Base::operator ->;
using Base::operator *;
using Base::operator bool;
- using Base::operator =;

/**
* @brief Constructor
*/
- RTPS_DllAPI TypeSupport()
- : std::shared_ptr<fastdds::dds::TopicDataType>(nullptr)
- {
- }
+ RTPS_DllAPI TypeSupport() noexcept = default;

/**
* @brief Copy Constructor
* @param type Another instance of TypeSupport
*/
RTPS_DllAPI TypeSupport(
- const TypeSupport& type)
- : std::shared_ptr<fastdds::dds::TopicDataType>(type)
- {
- }
+ const TypeSupport& type) noexcept = default;
+
+ /**
+ * @brief Move Constructor
+ * @param type Another instance of TypeSupport
+ */
+ RTPS_DllAPI TypeSupport(
+ TypeSupport&& type) noexcept = default;
+
+ /**
+ * @brief Copy Assignment
+ * @param type Another instance of TypeSupport
+ */
+ RTPS_DllAPI TypeSupport& operator = (
+ const TypeSupport& type) noexcept = default;
+
+ /**
+ * @brief Move Assignment
+ * @param type Another instance of TypeSupport
+ */
+ RTPS_DllAPI TypeSupport& operator = (
+ TypeSupport&& type) noexcept = default;

/*!
* \brief TypeSupport constructor that receives a TopicDataType pointer.
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ FILES_${PN} += "${prefix}/tools"
sysroot_stage_all_append() {
sysroot_stage_dir ${D}${bindir} ${SYSROOT_DESTDIR}${bindir}
}

FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
SRC_URI += "file://0001-Add-missing-operators-to-TypeSupport-1912.patch"

0 comments on commit f2eeb53

Please sign in to comment.