summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libeigen
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2021-09-29 17:31:11 +0200
committerKhem Raj <raj.khem@gmail.com>2021-09-29 11:47:22 -0700
commit6448ff99822e19942cf3a6bf67bd92bc38757e77 (patch)
tree9b7301b86d24072a667837d4c9ba4bbc670b4ee9 /meta-oe/recipes-support/libeigen
parentcafcc65e746763b22407a13ce7aad9e098018c11 (diff)
downloadmeta-openembedded-6448ff99822e19942cf3a6bf67bd92bc38757e77.tar.gz
libeigen: backport fix for -Werror=class-memaccess issues when NEON is enabled
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/libeigen')
-rw-r--r--meta-oe/recipes-support/libeigen/libeigen/0001-Default-eigen_packet_wrapper-constructor.patch72
-rw-r--r--meta-oe/recipes-support/libeigen/libeigen_3.4.0.bb4
2 files changed, 75 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/libeigen/libeigen/0001-Default-eigen_packet_wrapper-constructor.patch b/meta-oe/recipes-support/libeigen/libeigen/0001-Default-eigen_packet_wrapper-constructor.patch
new file mode 100644
index 000000000..84b5a4da9
--- /dev/null
+++ b/meta-oe/recipes-support/libeigen/libeigen/0001-Default-eigen_packet_wrapper-constructor.patch
@@ -0,0 +1,72 @@
1From cb507309937958c632147de87e8f1231d6698847 Mon Sep 17 00:00:00 2001
2From: Antonio Sanchez <cantonios@google.com>
3Date: Tue, 14 Sep 2021 10:57:22 -0700
4Subject: [PATCH] Default eigen_packet_wrapper constructor.
5
6This makes it trivial, allowing use of `memcpy`.
7
8Fixes #2326
9
10Upstream-Status: Backport [https://gitlab.com/libeigen/eigen/-/merge_requests/645/diffs?commit_id=cb507309937958c632147de87e8f1231d6698847]
11Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
12
13* fixes build failures for arm targets with NEON enabled (e.g. -mfpu=neon-vfpv4)
14 for recipes with -Werror enabled and gcc-11, e.g. fuse-core, robot-localization,
15 prbt-ikfast-manipulator-plugin, rm-chassis-controllers in meta-ros1-noetic:
16
17In file included from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/Core:214,
18 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/macros.h:63,
19 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/loss.h:37,
20 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/constraint.h:37,
21 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/src/constraint.cpp:34:
22/jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h: In function 'Packet Eigen::internal::pload(const typename Eigen::internal::unpacket_traits<T>::type*) [with Packet = Eigen::internal::eigen_packet_wrapper<int, 2>; typename Eigen::internal::unpacket_traits<T>::type = signed char]':
23/jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h:1671:9: error: 'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'Eigen::internal::Packet4c' {aka 'struct Eigen::internal::eigen_packet_wrapper<int, 2>'} from an array of 'const int8_t' {aka 'const signed char'} [-Werror=class-memaccess]
24 1671 | memcpy(&res, from, sizeof(Packet4c));
25 | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26In file included from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/Core:172,
27 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/macros.h:63,
28 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/loss.h:37,
29 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/constraint.h:37,
30 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/src/constraint.cpp:34:
31/jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/src/Core/GenericPacketMath.h:159:8: note: 'Eigen::internal::Packet4c' {aka 'struct Eigen::internal::eigen_packet_wrapper<int, 2>'} declared here
32 159 | struct eigen_packet_wrapper
33 | ^~~~~~~~~~~~~~~~~~~~
34In file included from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/Core:214,
35 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/macros.h:63,
36 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/loss.h:37,
37 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/constraint.h:37,
38 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/src/constraint.cpp:34:
39/jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h: In function 'Packet Eigen::internal::ploadu(const typename Eigen::internal::unpacket_traits<T>::type*) [with Packet = Eigen::internal::eigen_packet_wrapper<int, 2>; typename Eigen::internal::unpacket_traits<T>::type = signed char]':
40/jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h:1716:9: error: 'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'Eigen::internal::Packet4c' {aka 'struct Eigen::internal::eigen_packet_wrapper<int, 2>'} from an array of 'const int8_t' {aka 'const signed char'} [-Werror=class-memaccess]
41 1716 | memcpy(&res, from, sizeof(Packet4c));
42 | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43In file included from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/Core:172,
44 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/macros.h:63,
45 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/loss.h:37,
46 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/include/fuse_core/constraint.h:37,
47 from /jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/git/src/constraint.cpp:34:
48/jenkins/mjansa/build/ros/webos-noetic-honister/tmp-glibc/work/raspberrypi4-webos-linux-gnueabi/fuse-core/0.4.2-1-r0/recipe-sysroot/usr/include/eigen3/Eigen/src/Core/GenericPacketMath.h:159:8: note: 'Eigen::internal::Packet4c' {aka 'struct Eigen::internal::eigen_packet_wrapper<int, 2>'} declared here
49 159 | struct eigen_packet_wrapper
50 | ^~~~~~~~~~~~~~~~~~~~
51cc1plus: all warnings being treated as errors
52
53---
54 Eigen/src/Core/GenericPacketMath.h | 2 +-
55 1 file changed, 1 insertion(+), 1 deletion(-)
56
57diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h
58index 8f8f64f15..72234288e 100644
59--- a/Eigen/src/Core/GenericPacketMath.h
60+++ b/Eigen/src/Core/GenericPacketMath.h
61@@ -162,7 +162,7 @@ struct eigen_packet_wrapper
62 {
63 EIGEN_ALWAYS_INLINE operator T&() { return m_val; }
64 EIGEN_ALWAYS_INLINE operator const T&() const { return m_val; }
65- EIGEN_ALWAYS_INLINE eigen_packet_wrapper() {}
66+ EIGEN_ALWAYS_INLINE eigen_packet_wrapper() = default;
67 EIGEN_ALWAYS_INLINE eigen_packet_wrapper(const T &v) : m_val(v) {}
68 EIGEN_ALWAYS_INLINE eigen_packet_wrapper& operator=(const T &v) {
69 m_val = v;
70--
712.17.1
72
diff --git a/meta-oe/recipes-support/libeigen/libeigen_3.4.0.bb b/meta-oe/recipes-support/libeigen/libeigen_3.4.0.bb
index 54b6f74d8..9682f7a8e 100644
--- a/meta-oe/recipes-support/libeigen/libeigen_3.4.0.bb
+++ b/meta-oe/recipes-support/libeigen/libeigen_3.4.0.bb
@@ -9,7 +9,9 @@ LIC_FILES_CHKSUM = "file://COPYING.MPL2;md5=815ca599c9df247a0c7f619bab123dad \
9 file://COPYING.MINPACK;md5=71d91b0f75ce79a75d3108a72bef8116 \ 9 file://COPYING.MINPACK;md5=71d91b0f75ce79a75d3108a72bef8116 \
10" 10"
11 11
12SRC_URI = "git://gitlab.com/libeigen/eigen.git;protocol=http;nobranch=1" 12SRC_URI = "git://gitlab.com/libeigen/eigen.git;protocol=http;branch=3.4 \
13 file://0001-Default-eigen_packet_wrapper-constructor.patch \
14"
13 15
14SRCREV = "3147391d946bb4b6c68edd901f2add6ac1f31f8c" 16SRCREV = "3147391d946bb4b6c68edd901f2add6ac1f31f8c"
15 17