Skip to contentSkip to conversation

package/valgrind: fix compilation for uclibc

PATCH Applied Dario Binacchi via buildroot 2 participants 2 messages Apr 21, 2022 – Apr 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/valgrind: fix compilation for uclibc

- Add upstream patch ([1]) to fix compilation for uclibc

- Add autoreconf as the patch touches configure.ac

[1] https://sourceware.org/git/?p=valgrind.git;a=commit;h=9c9fd9ae24b45f915f0759d32f662835c26d37c3

---
 ...coregrind-fix-compilation-for-uclibc.patch | 65 +++++++++++++++++++
 package/valgrind/valgrind.mk                  |  1 +
 2 files changed, 66 insertions(+)
 create mode 100644 package/valgrind/0003-coregrind-fix-compilation-for-uclibc.patch
package/valgrind/0003-coregrind-fix-compilation-for-uclibc.patch new file +65 -0
new file mode 100644
index 0000000000..ff8dc974d8
@@ -0,0 +1,65 @@
+From 9c9fd9ae24b45f915f0759d32f662835c26d37c3 Mon Sep 17 00:00:00 2001
+From: Dario Binacchi <[email protected]>
+Date: Fri, 8 Apr 2022 12:36:33 +0200
+Subject: [PATCH] coregrind: fix compilation for uclibc
+
+It fixes a known iusse whose details are described at [1] and more
+generally it guarantees that Valgrind is properly compiled for ulibc.
+
+[1] https://www.mail-archive.com/[email protected]/msg05295.html
+
+Suggested-by Michael Trimarchi <[email protected]>
+Co-developed-by: Michael Trimarchi <[email protected]>
+Signed-off-by: Dario Binacchi <[email protected]>
+---
+ configure.ac                        | 2 ++
+ coregrind/m_debuginfo/minilzo-inl.c | 4 ++++
+ coregrind/vg_preloaded.c            | 4 ++++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 6f51dfd9f8fb..c627a9c17a4a 100755
+--- a/configure.ac
++++ b/configure.ac
+@@ -1204,6 +1204,8 @@ AC_SUBST(DEFAULT_SUPP)
+ AC_CHECK_HEADER([features.h])
+ 
+ if test x$ac_cv_header_features_h = xyes; then
++  AC_DEFINE([HAVE_HEADER_FEATURES_H], 1,
++          [Define to 1 if you have the `features.h' header.])
+   rm -f conftest.$ac_ext
+   cat <<_ACEOF >conftest.$ac_ext
+ #include <features.h>
+diff --git a/coregrind/m_debuginfo/minilzo-inl.c b/coregrind/m_debuginfo/minilzo-inl.c
+index 153d008fd44f..b45ec92eaa85 100644
+--- a/coregrind/m_debuginfo/minilzo-inl.c
++++ b/coregrind/m_debuginfo/minilzo-inl.c
+@@ -1875,6 +1875,10 @@ extern "C" {
+ 
+ #endif
+ 
++#ifdef HAVE_HEADER_FEATURES_H
++#include <features.h>
++#endif
++
+ #undef LZO_HAVE_CONFIG_H
+ #include "minilzo.h"
+ 
+diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c
+index 5e2098390847..3809811aede7 100644
+--- a/coregrind/vg_preloaded.c
++++ b/coregrind/vg_preloaded.c
+@@ -45,6 +45,10 @@
+ #include "pub_core_debuginfo.h"  // Needed for pub_core_redir.h
+ #include "pub_core_redir.h"      // For VG_NOTIFY_ON_LOAD
+ 
++#ifdef HAVE_HEADER_FEATURES_H
++#include <features.h>
++#endif
++
+ #if defined(VGO_linux) || defined(VGO_solaris) || defined(VGO_freebsd)
+ 
+ /* ---------------------------------------------------------------------
+-- 
+2.32.0
+
package/valgrind/valgrind.mk +1 -0
index 52f2a04ffa..a5600a81b8 100644
@@ -14,6 +14,7 @@ VALGRIND_CONF_OPTS = \
 	--disable-ubsan \
 	--without-mpicc
 VALGRIND_INSTALL_STAGING = YES
+VALGRIND_AUTORECONF=YES
 
 # Valgrind must be compiled with no stack protection, so forcefully
 # pass -fno-stack-protector to override what Buildroot may have in
Signature · 6 lines
2.17.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 8 lines · Dario Binacchi

- Add upstream patch ([1]) to fix compilation for uclibc

- Add autoreconf as the patch touches configure.ac

[1] https://sourceware.org/git/?p=valgrind.git;a=commit;h=9c9fd9ae24b45f915f0759d32f662835c26d37c3

[snip]

package/valgrind/valgrind.mk VALGRIND_CONF_OPTS = \ · line 17

Quoted 9 lines
package/valgrind/valgrind.mk +1 -0
index 52f2a04ffa..a5600a81b8 100644
@@ -14,6 +14,7 @@ VALGRIND_CONF_OPTS = \
  	--disable-ubsan \
  	--without-mpicc
  VALGRIND_INSTALL_STAGING = YES
+VALGRIND_AUTORECONF=YES

You should add a comment above to track why autoreconf is needed.

Applied to master with that fixed, thanks.

Regards,
Arnout

package/valgrind/valgrind.mk VALGRIND_CONF_OPTS = \ · line 20

Quoted 3 lines
package/valgrind/valgrind.mk +0 -0
  # Valgrind must be compiled with no stack protection, so forcefully
  # pass -fno-stack-protector to override what Buildroot may have in

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot