From ed7b3362ad6dc33899766c803bba51240111aa43 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 5 May 2012 23:39:20 +0000 Subject: [PATCH] valgrind: fix build on PowerPC/uClibc Fixes build failures like http://autobuild.buildroot.org/results/112fa7c56e1e31c9a81d5f27394f58789e36bfec/build-end.log. Signed-off-by: Thomas Petazzoni Signed-off-by: Peter Korsgaard --- ...rind-3.7.0-dont-include-a-out-header.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 package/valgrind/valgrind-3.7.0-dont-include-a-out-header.patch diff --git a/package/valgrind/valgrind-3.7.0-dont-include-a-out-header.patch b/package/valgrind/valgrind-3.7.0-dont-include-a-out-header.patch new file mode 100644 index 0000000000..ed1c939ed6 --- /dev/null +++ b/package/valgrind/valgrind-3.7.0-dont-include-a-out-header.patch @@ -0,0 +1,45 @@ +Add replacement for + +Valgrind includes to get the definition of 'struct +nlist'. However, while glibc directly defines 'struct nlist' in +, uClibc relies on it being defined by kernel headers (i.e + simply includes ). This works for most +architectures, but not for PowerPC, on which the a.out binary format +has never been supported, and therefore the kernel +header does not exist. + +One solution would have been to use the header, but this one +is only available in glibc, and it also has a slightly different +definition than the one in . So, for the time being, the +easiest solution is to just replace the #include in Valgrind +code by a copy/paste of the 'struct nlist' definition. + +Signed-off-by: Thomas Petazzoni + +Index: b/coregrind/m_debuginfo/readstabs.c +=================================================================== +--- a/coregrind/m_debuginfo/readstabs.c ++++ b/coregrind/m_debuginfo/readstabs.c +@@ -52,7 +52,21 @@ + + /* --- !!! --- EXTERNAL HEADERS start --- !!! --- */ + #if defined(VGO_linux) +-# include /* stabs defns */ ++/* Copied from a.out.h, because it is otherwise not available on ++ PowerPC/uClibc */ ++struct nlist ++{ ++ union ++ { ++ char *n_name; ++ struct nlist *n_next; ++ long n_strx; ++ } n_un; ++ unsigned char n_type; ++ char n_other; ++ short n_desc; ++ unsigned long n_value; ++}; + #elif defined(VGO_darwin) + # include + # define n_other n_sect -- 2.30.2