diff mbox series

valgrind: Fix build with clang

Message ID 20250514164742.2104915-1-raj.khem@gmail.com
State Accepted, archived
Commit fbf60d5077bcf37df96b7b6358db8c30e073a656
Headers show
Series valgrind: Fix build with clang | expand

Commit Message

Khem Raj May 14, 2025, 4:47 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...tax-for-pushsection-directive-in-inl.patch | 31 +++++++++++++++++++
 .../valgrind/valgrind_3.25.0.bb               |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch
new file mode 100644
index 00000000000..b59c5442231
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch
@@ -0,0 +1,31 @@ 
+From 2089383a0e3a50f527337ea05188b3e302069888 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 14 May 2025 09:29:33 -0700
+Subject: [PATCH] Use portable syntax for pushsection directive in inline
+ assembly
+
+'@' does not work with clang inline assembler, but '%' works with both
+gcc and clang. Therefore use '%' to make it more portable
+
+Fixes
+<inline asm>:1:41: error: expected '%<type>' or "<type>"
+
+Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=504222]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ coregrind/vg_preloaded.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c
+index 5bec51d..e4c2dbc 100644
+--- a/coregrind/vg_preloaded.c
++++ b/coregrind/vg_preloaded.c
+@@ -55,7 +55,7 @@
+ /* Note: The "MS" section flags are to remove duplicates.  */
+ #define DEFINE_GDB_PY_SCRIPT(script_name) \
+   asm("\
+-.pushsection \".debug_gdb_scripts\", \"MS\",@progbits,1\n\
++.pushsection \".debug_gdb_scripts\", \"MS\",%progbits,1\n\
+ .byte 1 /* Python */\n\
+ .asciz \"" script_name "\"\n\
+ .popsection \n\
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.25.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.25.0.bb
index 67166a4ef0e..6650dcedbfd 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.25.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.25.0.bb
@@ -25,6 +25,7 @@  SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
            file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
            file://0001-docs-Disable-manual-validation.patch \
            file://0001-tests-arm-Use-O-instead-of-O0.patch \
+           file://0001-Use-portable-syntax-for-pushsection-directive-in-inl.patch \
            "
 SRC_URI[sha256sum] = "295f60291d6b64c0d90c1ce645634bdc5361d39b0c50ecf9de6385ee77586ecc"
 UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"