Skip to contentSkip to conversation

gdb: package python support separately

PATCH In review Alexander Kanavin 2 participants 4 messages May 19, 2023 – May 20, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 gdb: package python support separately

This avoids pulling in the whole python stack if only the main package is installed.

---
 meta/recipes-devtools/gdb/gdb-common.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-devtools/gdb/gdb-common.inc +5 -1
index 9db61b785f3..d03f744a845 100644
@@ -33,13 +33,17 @@ EXTRA_OECONF = "--disable-gdbtk --disable-x --disable-werror \
 PACKAGECONFIG ??= "readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
 # Use --without-system-readline to compile with readline 5.
 PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline"
-PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python3,python3 python3-codecs"
+PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python3"
 PACKAGECONFIG[babeltrace] = "--with-babeltrace,--without-babeltrace,babeltrace"
 # ncurses is already a hard DEPENDS, but would be added here if it weren't
 PACKAGECONFIG[tui] = "--enable-tui,--disable-tui"
 PACKAGECONFIG[xz] = "--with-lzma --with-liblzma-prefix=${STAGING_DIR_HOST},--without-lzma,xz"
 PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils"
 
+PACKAGES =+ "${PN}-python"
+RDEPENDS:${PN}-python = "python3 python3-codecs"
+FILES:${PN}-python = "${datadir}/gdb/python/"
+
 GDBPROPREFIX = "--program-prefix=''"
 
 DISABLE_STATIC = ""
Signature · 1 line
2.30.2
#1 lore raw

PATCH v2 2/3 gdb: enable python PACKAGECONFIG

This is required by latest valgrind ptests.

---
 meta/recipes-devtools/gdb/gdb-common.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gdb/gdb-common.inc +1 -1
index d03f744a845..645672ed0b4 100644
@@ -30,7 +30,7 @@ EXTRA_OECONF = "--disable-gdbtk --disable-x --disable-werror \
                 --with-libgmp-prefix=${STAGING_EXECPREFIXDIR} \
 "
 
-PACKAGECONFIG ??= "readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
+PACKAGECONFIG ??= "readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)} python"
 # Use --without-system-readline to compile with readline 5.
 PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline"
 PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python3"
Signature · 1 line
2.30.2
#2 lore raw

PATCH v2 3/3 valgrind: update 3.20.0 -> 3.21.0

In reply to Alexander Kanavin

Drop patches merged upstream.

---
 ...01-drd-tests-Include-missing-cstdint.patch | 34 ----------
 ...efine-__THROW-if-not-already-defined.patch | 32 ---------
 ...inux-seg_override.c-add-missing-incl.patch | 30 ++++++++
 ...ck-x86-Define-__THROW-if-not-defined.patch | 32 ---------
 ...de-Replace-__modify_ldt-with-syscall.patch | 68 -------------------
 ...est-wrapper-to-support-PTEST-formats.patch | 52 +++++++-------
 .../valgrind/valgrind/fixed-perl-path.patch   | 38 ++---------
 ...{valgrind_3.20.0.bb => valgrind_3.21.0.bb} | 16 +----
 8 files changed, 66 insertions(+), 236 deletions(-)
 delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-drd-tests-Include-missing-cstdint.patch
 delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch
 create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-none-tests-x86-linux-seg_override.c-add-missing-incl.patch
 delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch
 delete mode 100644 meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch
 rename meta/recipes-devtools/valgrind/{valgrind_3.20.0.bb => valgrind_3.21.0.bb} (92%)
meta/recipes-devtools/valgrind/valgrind/0001-drd-tests-Include-missing-cstdint.patch deleted +0 -34
deleted file mode 100644
index fbee24a5389..00000000000
@@ -1,34 +0,0 @@
-From 687d9fb9e3de832379680e9d5268331011c92afa Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Thu, 26 Jan 2023 08:53:26 -0800
-Subject: [PATCH] drd/tests: Include missing <cstdint>
-
-gcc 13 moved some includes around and as a result <cstdint> is no longer
-transitively included [1]. Explicitly include it for uint{32,64}_t.
-
-Fixes
-tsan_thread_wrappers_pthread.h:91:9: error: 'int64_t' does not name a type
-
-[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
-
-Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=464859]
-Signed-off-by: Khem Raj <[email protected]>
----
- drd/tests/tsan_thread_wrappers_pthread.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/drd/tests/tsan_thread_wrappers_pthread.h b/drd/tests/tsan_thread_wrappers_pthread.h
-index f15e6ad..4cc8062 100644
---- a/drd/tests/tsan_thread_wrappers_pthread.h
-+++ b/drd/tests/tsan_thread_wrappers_pthread.h
-@@ -55,6 +55,7 @@
- #define NO_TLS
- #endif
- 
-+#include <cstdint>
- #include <string>
- using namespace std;
- 
--- 
-2.39.1
-
meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch deleted +0 -32
deleted file mode 100644
index a48d7db070f..00000000000
@@ -1,32 +0,0 @@
-From 3409dc35c15bb14c8a525239806322648e079ab1 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 5 Jul 2017 17:12:43 -0700
-Subject: [PATCH 1/3] memcheck/arm64: Define __THROW if not already defined
-
-Helps compiling with musl where __THROW is not available
-
-Signed-off-by: Khem Raj <[email protected]>
----
-Upstream-Status: Submitted
-
- memcheck/tests/arm64-linux/scalar.h | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/memcheck/tests/arm64-linux/scalar.h b/memcheck/tests/arm64-linux/scalar.h
-index 9008816..8ef050f 100644
---- a/memcheck/tests/arm64-linux/scalar.h
-+++ b/memcheck/tests/arm64-linux/scalar.h
-@@ -12,6 +12,10 @@
- #include <sys/types.h>
- #include <sys/mman.h>
- 
-+#ifndef __THROW
-+#define __THROW
-+#endif
-+
- // Since we use vki_unistd.h, we can't include <unistd.h>.  So we have to
- // declare this ourselves.
- extern long int syscall (long int __sysno, ...) __THROW;
--- 
-2.13.2
-
meta/recipes-devtools/valgrind/valgrind/0001-none-tests-x86-linux-seg_override.c-add-missing-incl.patch new file +30 -0
new file mode 100644
index 00000000000..5e36c28523e
@@ -0,0 +1,30 @@
+From 978d9ed7f857f2cdcd2a8632f3c2feb56b99c825 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <[email protected]>
+Date: Mon, 8 May 2023 11:56:35 +0200
+Subject: [PATCH] none/tests/x86-linux/seg_override.c: add missing include for
+ musl builds
+
+Otherwise SYS_modify_ldt is undefined.
+
+Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=382034]
+Signed-off-by: Alexander Kanavin <[email protected]>
+
+---
+ none/tests/x86-linux/seg_override.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/none/tests/x86-linux/seg_override.c b/none/tests/x86-linux/seg_override.c
+index ca8fbfe..4ef4394 100644
+--- a/none/tests/x86-linux/seg_override.c
++++ b/none/tests/x86-linux/seg_override.c
+@@ -3,6 +3,10 @@
+ #include <errno.h>
+ #include <string.h>
+ #include "../../../config.h"
++#if defined(MUSL_LIBC)
++#include <syscall.h>
++#include <unistd.h>
++#endif
+ 
+ 
+ /* Stuff from Wine. */
meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch deleted +0 -32
deleted file mode 100644
index 5433472291e..00000000000
@@ -1,32 +0,0 @@
-From 67d199dbdcbb3feff5f8928f87725fc64c0307d7 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Wed, 5 Jul 2017 17:36:42 -0700
-Subject: [PATCH 2/3] memcheck/x86: Define __THROW if not defined
-
-musl does not have __THROW, therefore make it null
-
-Signed-off-by: Khem Raj <[email protected]>
----
-Upstream-Status: Submitted
-
- memcheck/tests/x86-linux/scalar.h | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/memcheck/tests/x86-linux/scalar.h b/memcheck/tests/x86-linux/scalar.h
-index ef28b03..52f742e 100644
---- a/memcheck/tests/x86-linux/scalar.h
-+++ b/memcheck/tests/x86-linux/scalar.h
-@@ -11,6 +11,10 @@
- #include <sys/types.h>
- #include <sys/mman.h>
- 
-+#ifndef __THROW
-+#define __THROW
-+#endif
-+
- // Since we use vki_unistd.h, we can't include <unistd.h>.  So we have to
- // declare this ourselves.
- extern long int syscall (long int __sysno, ...) __THROW;
--- 
-2.13.2
-
meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch deleted +0 -68

68 lines not on this page · raw message

meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch +26 -26

165 lines not on this page · raw message

meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch +7 -31
index db6867f6259..b9804e74516 100644
@@ -1,4 +1,4 @@
-From d85cc45e0ddeda68adf594dead715964cb32d0e7 Mon Sep 17 00:00:00 2001
+From beaa5b64c60d501fa9cd59fdc563e5f5bccf6882 Mon Sep 17 00:00:00 2001
 From: Qing He <[email protected]>
 Date: Tue, 31 Aug 2010 22:51:58 +0800
 Subject: [PATCH] valgrind: fix perl scripts
@@ -17,34 +17,13 @@ a better fix would need:
 Upstream-Status: Inappropriate [configuration]
 
 Signed-off-by: Maxin B. John <[email protected]>
+
 ---
- cachegrind/cg_annotate.in | 2 +-
- cachegrind/cg_diff.in     | 2 +-
- massif/ms_print.in        | 2 +-
- perf/vg_perf.in           | 2 +-
- tests/vg_regtest.in       | 2 +-
- 5 files changed, 5 insertions(+), 5 deletions(-)
+ massif/ms_print.in  | 2 +-
+ perf/vg_perf.in     | 2 +-
+ tests/vg_regtest.in | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
 
-diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
-index fea114b..5e814fd 100644
---- a/cachegrind/cg_annotate.in
-+++ b/cachegrind/cg_annotate.in
-@@ -1,4 +1,4 @@
--#! @PERL@
-+#! /usr/bin/perl
- 
- ##--------------------------------------------------------------------##
- ##--- Cachegrind's annotator.                       cg_annotate.in ---##
-diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in
-index 9d9258e..d0f0ec7 100755
---- a/cachegrind/cg_diff.in
-+++ b/cachegrind/cg_diff.in
-@@ -1,4 +1,4 @@
--#! @PERL@
-+#! /usr/bin/perl
- 
- ##--------------------------------------------------------------------##
- ##--- Cachegrind's differencer.                         cg_diff.in ---##
 diff --git a/massif/ms_print.in b/massif/ms_print.in
 index a206ce4..df1bc31 100755
 --- a/massif/ms_print.in
@@ -66,7 +45,7 @@ index 90ee1d2..c585096 100644
  ##--- Valgrind performance testing script                  vg_perf ---##
  ##--------------------------------------------------------------------##
 diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
-index 0fe6341..1b45eb7 100755
+index 7152765..ad18800 100755
 --- a/tests/vg_regtest.in
 +++ b/tests/vg_regtest.in
 @@ -1,4 +1,4 @@
@@ -75,6 +54,3 @@ index 0fe6341..1b45eb7 100755
  ##--------------------------------------------------------------------##
  ##--- Valgrind regression testing script                vg_regtest ---##
  ##--------------------------------------------------------------------##
--- 
-2.29.2
-
meta/recipes-devtools/valgrind/valgrind_3.21.0.bb renamed from meta/recipes-devtools/valgrind/valgrind_3.20.0.bb +3 -13
similarity index 92%
rename from meta/recipes-devtools/valgrind/valgrind_3.20.0.bb
rename to meta/recipes-devtools/valgrind/valgrind_3.21.0.bb
index 4ea173ba803..8e5eed77593 100644
@@ -27,9 +27,6 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
            file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \
            file://0002-context-APIs-are-not-available-on-musl.patch \
            file://0003-correct-include-directive-path-for-config.h.patch \
-           file://0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch \
-           file://0002-memcheck-x86-Define-__THROW-if-not-defined.patch \
-           file://0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch \
            file://0001-fix-opcode-not-supported-on-mips32-linux.patch \
            file://0001-Make-local-functions-static-to-avoid-assembler-error.patch \
            file://0001-Return-a-valid-exit_code-from-vg_regtest.patch \
@@ -38,9 +35,9 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
            file://s390x_vec_op_t.patch \
            file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
            file://0001-docs-Disable-manual-validation.patch \
-           file://0001-drd-tests-Include-missing-cstdint.patch \
+           file://0001-none-tests-x86-linux-seg_override.c-add-missing-incl.patch \
            "
-SRC_URI[sha256sum] = "8536c031dbe078d342f121fa881a9ecd205cb5a78e639005ad570011bdb9f3c6"
+SRC_URI[sha256sum] = "10ce1618bb3e33fad16eb79552b0a3e1211762448a0d7fce11c8a6243b9ac971"
 UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
 
 COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux'
@@ -125,7 +122,7 @@ RDEPENDS:${PN} += "perl"
 RRECOMMENDS:${PN} += "${TCLIBC}-dbg"
 
 RDEPENDS:${PN}-ptest += " bash coreutils curl file \
-   gdb libgomp \
+   gdb gdb-python libgomp \
    perl \
    perl-module-file-basename perl-module-file-glob perl-module-getopt-long \
    perl-module-overloading perl-module-cwd perl-module-ipc-open3 \
@@ -207,13 +204,6 @@ do_install_ptest() {
 	\) \
         -exec rm {} \;
 
-    # These files need to be newer so touch them.
-    touch ${D}${PTEST_PATH}/cachegrind/tests/a.c -r ${D}${PTEST_PATH}/cachegrind/tests/cgout-test
-
-    # find *_annotate in ${bindir} for yocto build
-    sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann1.vgtest
-    sed -i s:\.\./\.\./cachegrind/cg_annotate:${bindir}/cg_annotate: ${D}${PTEST_PATH}/cachegrind/tests/ann2.vgtest
-
     sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann1.vgtest
     sed -i s:\.\./\.\./callgrind/callgrind_annotate:${bindir}/callgrind_annotate: ${D}${PTEST_PATH}/callgrind/tests/ann2.vgtest
 
Signature · 1 line
2.30.2
#3 lore raw
In reply to Alexander Kanavin

Hello,

This breaks package.PackageTests.test_gdb_hardlink_debug

https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/5204/steps/15/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/5154/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/5233/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/5196/steps/14/logs/stdio

Quoted 44 lines · Alexander Kanavin

This avoids pulling in the whole python stack if only the main package is installed.

---
 meta/recipes-devtools/gdb/gdb-common.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-devtools/gdb/gdb-common.inc +5 -1
index 9db61b785f3..d03f744a845 100644
@@ -33,13 +33,17 @@ EXTRA_OECONF = "--disable-gdbtk --disable-x --disable-werror \
 PACKAGECONFIG ??= "readline ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
 # Use --without-system-readline to compile with readline 5.
 PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline"
-PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python3,python3 python3-codecs"
+PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python3"
 PACKAGECONFIG[babeltrace] = "--with-babeltrace,--without-babeltrace,babeltrace"
 # ncurses is already a hard DEPENDS, but would be added here if it weren't
 PACKAGECONFIG[tui] = "--enable-tui,--disable-tui"
 PACKAGECONFIG[xz] = "--with-lzma --with-liblzma-prefix=${STAGING_DIR_HOST},--without-lzma,xz"
 PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils"
 
+PACKAGES =+ "${PN}-python"
+RDEPENDS:${PN}-python = "python3 python3-codecs"
+FILES:${PN}-python = "${datadir}/gdb/python/"
+
 GDBPROPREFIX = "--program-prefix=''"
 
 DISABLE_STATIC = ""
Signature · 11 lines
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#181543): https://lists.openembedded.org/g/openembedded-core/message/181543
Mute This Topic: https://lists.openembedded.org/mt/99009068/3617179
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com