Files
poky/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch
Khem Raj df95988e1e elfutils: Fix build with uclibc/musl
Remove mempcpy patch its already in uclibc now
refresh libargp patch to match latest elfutils

Add ALLOW_EMPTY for musl

core-image-cmdline-full asks for elfutils package to be added to package
it has all eu-* tools but we dont build them on musl. nevertheless lets
satisfy the dependency so image can build for musl

Build libdw,libasm,libebl along with libelf

enhance the musl portability patch to compile every other library
except the eu-* tools

Fix build on aarch64/musl issues

Header inclusion ends up with duplicate definitions of iovec struct
since uclibc defines the same in usersapce, we have been depending upong
including the kernel header on aarch64, using sys/uio.h is the right
approach

Fix x86 build warning seen on musl

(From OE-Core rev: a28c70455931e0b7e3449a76c3b9132bd572478b)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-30 11:36:58 +00:00

130 lines
4.1 KiB
Diff

From 3daec2dd11a04955f95e8f65a48820103d84dbec Mon Sep 17 00:00:00 2001
From: Junling Zheng <zhengjunling@huawei.com>
Date: Thu, 9 Apr 2015 12:12:49 +0000
Subject: [PATCH] uclibc support for elfutils 0.161
on uclibc systems libintl and libuargp are separate from libc.
so they need to be specified on commandline when we use proxy-libintl
then libintl is a static archive so it should be listed last since
elfutils does not respect disable-nls we need to link in libintl
We add a new option --enable-uclibc which will be used to control
the uclibc specific configurations during build.
Upstream-Status: Inappropriate [uclibc specific]
Signed-off-by: Khem Raj <raj.khem>
Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
[Junling Zheng:
- adjust context
]
---
configure.ac | 8 ++++++++
libcpu/Makefile.am | 4 ++++
libdw/Makefile.am | 7 ++++++-
libelf/Makefile.am | 5 +++++
4 files changed, 23 insertions(+), 1 deletion(-)
Index: elfutils-0.164/configure.ac
===================================================================
--- elfutils-0.164.orig/configure.ac
+++ elfutils-0.164/configure.ac
@@ -66,6 +66,14 @@ AS_IF([test "$use_locks" = yes],
AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
+AC_ARG_ENABLE([uclibc],
+AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
+use_uclibc=yes, use_uclibc=no)
+AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
+AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
+
+AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
+
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_YACC
@@ -291,18 +299,13 @@ AC_LINK_IFELSE(
)
dnl If our libc doesn't provide argp, then test for libargp
-if test "$libc_has_argp" = "false" ; then
- AC_MSG_WARN("libc does not have argp")
- AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
-
- if test "$have_argp" = "false"; then
- AC_MSG_ERROR("no libargp found")
- else
- argp_LDADD="-largp"
- fi
-else
- argp_LDADD=""
-fi
+AS_IF([test "x$libc_has_argp" = "xfalse"],
+ [AC_MSG_WARN("libc does not have argp")
+ AC_CHECK_LIB([argp], [argp_parse], [have_argp="true" argp_LDADD="-largp"], [have_argp="false"])], [argp_LDADD=""])
+
+AS_IF([test "x$libc_has_argp" = "xfalse" -a "x$have_argp" = "xfalse"],
+ AC_CHECK_LIB([uargp], [argp_parse], [have_uargp="true" argp_LDADD="-luargp"], [have_uargp="false"])], [argp_LDADD=""])
+
AC_SUBST([argp_LDADD])
dnl The directories with content.
Index: elfutils-0.164/libcpu/Makefile.am
===================================================================
--- elfutils-0.164.orig/libcpu/Makefile.am
+++ elfutils-0.164/libcpu/Makefile.am
@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
i386_lex.o: i386_parse.h
i386_gendis_LDADD = $(libeu) -lm
+if USE_UCLIBC
+i386_gendis_LDADD += -lintl
+endif
+
i386_parse.h: i386_parse.c ;
EXTRA_DIST = defs/i386
Index: elfutils-0.164/libdw/Makefile.am
===================================================================
--- elfutils-0.164.orig/libdw/Makefile.am
+++ elfutils-0.164/libdw/Makefile.am
@@ -102,6 +102,11 @@ endif
libdw_pic_a_SOURCES =
am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+libdw_so_LDLIBS =
+if USE_UCLIBC
+libdw_so_LDLIBS += -lintl
+endif
+
libdw_so_SOURCES =
libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
-Wl,--version-script,$<,--no-undefined \
-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
- -ldl $(argp_LDADD) $(zip_LIBS)
+ -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
@$(textrel_check)
$(AM_V_at)ln -fs $@ $@.$(VERSION)
Index: elfutils-0.164/libelf/Makefile.am
===================================================================
--- elfutils-0.164.orig/libelf/Makefile.am
+++ elfutils-0.164/libelf/Makefile.am
@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_has
libelf_pic_a_SOURCES =
am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
+
libelf_so_LDLIBS =
+if USE_UCLIBC
+libelf_so_LDLIBS += -lintl
+endif
+
if USE_LOCKS
libelf_so_LDLIBS += -lpthread
endif