summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/valgrind
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-05-15 08:19:11 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-18 06:33:36 +0100
commitb62b82c02dae3af2a85cddbb5e37461144680339 (patch)
tree8da43b6d6381c9f2cc9e77a9f9b40910fa3b661d /meta/recipes-devtools/valgrind
parent3ad495ba92dcce1541fad630973be77c111d5a28 (diff)
downloadpoky-b62b82c02dae3af2a85cddbb5e37461144680339.tar.gz
valgrind: Backport upstream patch to fix __getauxval needs
Drop disabling outline-atomics since that was added to fix this issue in particular (From OE-Core rev: 702a1ae29c6a0f920bd67b7a7a41b886ac52a751) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/valgrind')
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-gcc10-arm64-build-needs-__getauxval-for-linking-with.patch144
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.15.0.bb3
2 files changed, 145 insertions, 2 deletions
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-gcc10-arm64-build-needs-__getauxval-for-linking-with.patch b/meta/recipes-devtools/valgrind/valgrind/0001-gcc10-arm64-build-needs-__getauxval-for-linking-with.patch
new file mode 100644
index 0000000000..9afa7f6a55
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-gcc10-arm64-build-needs-__getauxval-for-linking-with.patch
@@ -0,0 +1,144 @@
1From abbc0761fa0349d49b10dc8c0f10af6bc0578c40 Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Tue, 12 May 2020 16:58:36 +0200
4Subject: [PATCH 1/2] gcc10 arm64 build needs __getauxval for linking with
5 libgcc
6
7Provide a new library libgcc-sup-<platform>.a that contains symbols
8needed by libgcc. This needs to be linked after -lgcc to provide
9any symbols missing which would normally be provided by glibc.
10At the moment this only provides __getauxval on arm64 linux.
11
12https://bugs.kde.org/show_bug.cgi?id=421321
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15Upstream-Status: Backport [https://sourceware.org/git/?p=valgrind.git;a=commit;h=abbc0761fa0349d49b10dc8c0f10af6bc0578c40]
16
17---
18 Makefile.tool.am | 3 +-
19 coregrind/Makefile.am | 26 +++++++++++++++++
20 coregrind/m_libgcc_sup.c | 61 ++++++++++++++++++++++++++++++++++++++++
21 3 files changed, 89 insertions(+), 1 deletion(-)
22 create mode 100644 coregrind/m_libgcc_sup.c
23
24diff --git a/Makefile.tool.am b/Makefile.tool.am
25index cc2fa0ee6..2bf90de5d 100644
26--- a/Makefile.tool.am
27+++ b/Makefile.tool.am
28@@ -17,7 +17,8 @@ TOOL_DEPENDENCIES_@VGCONF_PLATFORM_SEC_CAPS@ = \
29 endif
30
31
32-TOOL_LDADD_COMMON = -lgcc
33+TOOL_LDADD_COMMON = -lgcc \
34+ $(top_builddir)/coregrind/libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
35 TOOL_LDADD_@VGCONF_PLATFORM_PRI_CAPS@ = \
36 $(TOOL_DEPENDENCIES_@VGCONF_PLATFORM_PRI_CAPS@) $(TOOL_LDADD_COMMON)
37 if VGCONF_HAVE_PLATFORM_SEC
38diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
39index 6a1a925fb..1753fb633 100644
40--- a/coregrind/Makefile.am
41+++ b/coregrind/Makefile.am
42@@ -542,6 +542,32 @@ libcoregrind_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_DEPENDENCIES = \
43 libnolto_coregrind-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
44 endif
45
46+#----------------------------------------------------------------------------
47+# libgcc-sup-<platform>.a
48+# Special supplemental library for functions normally supplied by glibc
49+# used by libgcc.
50+#----------------------------------------------------------------------------
51+
52+pkglib_LIBRARIES += libgcc-sup-@VGCONF_ARCH_PRI@-@VGCONF_OS@.a
53+if VGCONF_HAVE_PLATFORM_SEC
54+pkglib_LIBRARIES += libgcc-sup-@VGCONF_ARCH_SEC@-@VGCONF_OS@.a
55+endif
56+
57+libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_SOURCES = \
58+ m_libgcc_sup.c
59+libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CPPFLAGS = \
60+ $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
61+libgcc_sup_@VGCONF_ARCH_PRI@_@VGCONF_OS@_a_CFLAGS = \
62+ $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_PRI_CAPS@)
63+if VGCONF_HAVE_PLATFORM_SEC
64+libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_SOURCES = \
65+ m_libgcc_sup.c
66+libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CPPFLAGS = \
67+ $(AM_CPPFLAGS_@VGCONF_PLATFORM_SEC_CAPS@)
68+libgcc_sup_@VGCONF_ARCH_SEC@_@VGCONF_OS@_a_CFLAGS = \
69+ $(AM_CFLAGS_PSO_@VGCONF_PLATFORM_SEC_CAPS@)
70+endif
71+
72 #----------------------------------------------------------------------------
73 # libreplacemalloc_toolpreload-<platform>.a
74 #----------------------------------------------------------------------------
75diff --git a/coregrind/m_libgcc_sup.c b/coregrind/m_libgcc_sup.c
76new file mode 100644
77index 000000000..e29325459
78--- /dev/null
79+++ b/coregrind/m_libgcc_sup.c
80@@ -0,0 +1,61 @@
81+/* -*- mode: C; c-basic-offset: 3; -*- */
82+
83+/*--------------------------------------------------------------------*/
84+/*--- Supplemental functions for libgcc normally provided by glibc ---*/
85+/*--------------------------------------------------------------------*/
86+
87+/*
88+ This file is part of Valgrind, a dynamic binary instrumentation
89+ framework.
90+
91+ Copyright (C) 2020 Mark Wielaard
92+ mark@klomp.org
93+
94+ This program is free software; you can redistribute it and/or
95+ modify it under the terms of the GNU General Public License as
96+ published by the Free Software Foundation; either version 2 of the
97+ License, or (at your option) any later version.
98+
99+ This program is distributed in the hope that it will be useful, but
100+ WITHOUT ANY WARRANTY; without even the implied warranty of
101+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
102+ General Public License for more details.
103+
104+ You should have received a copy of the GNU General Public License
105+ along with this program; if not, see <http://www.gnu.org/licenses/>.
106+
107+ The GNU General Public License is contained in the file COPYING.
108+*/
109+
110+#include "config.h"
111+#include "pub_core_basics.h"
112+#include "pub_core_clientstate.h"
113+
114+/*====================================================================*/
115+/*=== arm64 libgcc support function for init_have_lse_atomics ===*/
116+/*====================================================================*/
117+
118+#if defined(VGP_arm64_linux)
119+struct auxv
120+{
121+ Word a_type;
122+ union {
123+ void *a_ptr;
124+ Word a_val;
125+ } u;
126+};
127+#define AT_NULL 0
128+
129+unsigned long int __getauxval (unsigned long int type);
130+unsigned long int __getauxval (unsigned long int type)
131+{
132+ struct auxv *p;
133+ for (p = (struct auxv *) VG_(client_auxv);
134+ p != NULL && p->a_type != AT_NULL;
135+ p++)
136+ if (p->a_type == type)
137+ return p->u.a_val;
138+
139+ return 0;
140+}
141+#endif
142--
1432.26.2
144
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
index 25837e4b44..a764d18177 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
@@ -42,6 +42,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
42 file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ 42 file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
43 file://0001-tests-Make-pthread_detatch-call-portable-across-plat.patch \ 43 file://0001-tests-Make-pthread_detatch-call-portable-across-plat.patch \
44 file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \ 44 file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
45 file://0001-gcc10-arm64-build-needs-__getauxval-for-linking-with.patch \
45 " 46 "
46SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975" 47SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975"
47SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1" 48SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1"
@@ -74,8 +75,6 @@ EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEIN
74# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option 75# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
75EXTRA_OECONF_append_arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}" 76EXTRA_OECONF_append_arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
76 77
77CFLAGS_append_aarch64 = " -mno-outline-atomics "
78
79EXTRA_OEMAKE = "-w" 78EXTRA_OEMAKE = "-w"
80 79
81CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" 80CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"