Patchwork [24/52] elfutils_0.148.bb: Fix compilation issues on uclibc

login
register
mail settings
Submitter Saul Wold
Date April 27, 2011, 7:29 a.m.
Message ID <bdc26fe5cf97686061963c94d38f57c780432875.1303889119.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/2949/
State New, archived
Headers show

Comments

Saul Wold - April 27, 2011, 7:29 a.m.
From: Khem Raj <raj.khem@gmail.com>

* Add -luargp and -lintl to linker flags
* __mempcpy is not there on uclibc so define it to mempcpy

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../elfutils/elfutils-0.148/mempcpy.patch          |   23 ++++++++++++++++++++
 meta/recipes-devtools/elfutils/elfutils_0.148.bb   |    6 +++-
 2 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/elfutils/elfutils-0.148/mempcpy.patch

Patch

diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/mempcpy.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/mempcpy.patch
new file mode 100644
index 0000000..e1e4ad0
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/mempcpy.patch
@@ -0,0 +1,23 @@ 
+uclibc does not export __mempcpy like glibc so we alias it here.
+This patch may make sense for upstream but elfutils uses more
+glibc specific features like obstack_printf which are missing in
+uclibc they need to be fixed along to make it work all the way
+
+Upstream-status: Inappropriate[Elfutils uses more glibc specific features]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: elfutils-0.148/libelf/elf_begin.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_begin.c
++++ elfutils-0.148/libelf/elf_begin.c
+@@ -68,6 +68,9 @@
+ #include "libelfP.h"
+ #include "common.h"
+ 
++#ifdef __UCLIBC__
++#define __mempcpy mempcpy
++#endif
+ 
+ /* Create descriptor for archive in memory.  */
+ static inline Elf *
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.148.bb b/meta/recipes-devtools/elfutils/elfutils_0.148.bb
index a55b98d..df933f6 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.148.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.148.bb
@@ -28,8 +28,8 @@  SRC_URI += "\
         file://elf_additions.diff \
 	file://elfutils-fsize.patch \
 	file://remove-unused.patch \
+	file://mempcpy.patch \
 "
-
 # The buildsystem wants to generate 2 .h files from source using a binary it just built,
 # which can not pass the cross compiling, so let's work around it by adding 2 .h files
 # along with the do_configure_prepend()
@@ -38,7 +38,6 @@  SRC_URI += "\
         file://i386_dis.h \
         file://x86_64_dis.h \
 "
-
 inherit autotools
 
 EXTRA_OECONF = "--program-prefix=eu-"
@@ -49,6 +48,9 @@  do_configure_prepend() {
 	cp ${WORKDIR}/*dis.h ${S}/libcpu
 }
 
+# Only append ldflags for target recipe
+TARGET_LDFLAGS_libc-uclibc += "${@['', '-lintl -luargp']['${PN}' == '${BPN}']}"
+
 BBCLASSEXTEND = "native nativesdk"
 
 # Package utilities separately