blob: 966b70fcc4e7f4719c82a4d54878bbe4fb18b254 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 3daec2dd11a04955f95e8f65a48820103d84dbec Mon Sep 17 00:00:00 2001
2From: Junling Zheng <zhengjunling@huawei.com>
3Date: Thu, 9 Apr 2015 12:12:49 +0000
4Subject: [PATCH] uclibc support for elfutils 0.161
5
6on uclibc systems libintl and libuargp are separate from libc.
7so they need to be specified on commandline when we use proxy-libintl
8then libintl is a static archive so it should be listed last since
9elfutils does not respect disable-nls we need to link in libintl
10
11We add a new option --enable-uclibc which will be used to control
12the uclibc specific configurations during build.
13
14Upstream-Status: Inappropriate [uclibc specific]
15
16Signed-off-by: Khem Raj <raj.khem>
17Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
18[Junling Zheng:
19 - adjust context
20]
21---
22 configure.ac | 8 ++++++++
23 libcpu/Makefile.am | 4 ++++
24 libdw/Makefile.am | 7 ++++++-
25 libelf/Makefile.am | 5 +++++
26 4 files changed, 23 insertions(+), 1 deletion(-)
27
28Index: elfutils-0.164/configure.ac
29===================================================================
30--- elfutils-0.164.orig/configure.ac
31+++ elfutils-0.164/configure.ac
32@@ -66,6 +66,14 @@ AS_IF([test "$use_locks" = yes],
33
34 AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
35
36+AC_ARG_ENABLE([uclibc],
37+AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
38+use_uclibc=yes, use_uclibc=no)
39+AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
40+AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
41+
42+AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
43+
44 AC_PROG_CC
45 AC_PROG_RANLIB
46 AC_PROG_YACC
47@@ -291,18 +299,13 @@ AC_LINK_IFELSE(
48 )
49
50 dnl If our libc doesn't provide argp, then test for libargp
51-if test "$libc_has_argp" = "false" ; then
52- AC_MSG_WARN("libc does not have argp")
53- AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
54-
55- if test "$have_argp" = "false"; then
56- AC_MSG_ERROR("no libargp found")
57- else
58- argp_LDADD="-largp"
59- fi
60-else
61- argp_LDADD=""
62-fi
63+AS_IF([test "x$libc_has_argp" = "xfalse"],
64+ [AC_MSG_WARN("libc does not have argp")
65+ AC_CHECK_LIB([argp], [argp_parse], [have_argp="true" argp_LDADD="-largp"], [have_argp="false"])], [argp_LDADD=""])
66+
67+AS_IF([test "x$libc_has_argp" = "xfalse" -a "x$have_argp" = "xfalse"],
68+ AC_CHECK_LIB([uargp], [argp_parse], [have_uargp="true" argp_LDADD="-luargp"], [have_uargp="false"])], [argp_LDADD=""])
69+
70 AC_SUBST([argp_LDADD])
71
72 dnl The directories with content.
73Index: elfutils-0.164/libcpu/Makefile.am
74===================================================================
75--- elfutils-0.164.orig/libcpu/Makefile.am
76+++ elfutils-0.164/libcpu/Makefile.am
77@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
78 i386_lex.o: i386_parse.h
79 i386_gendis_LDADD = $(libeu) -lm
80
81+if USE_UCLIBC
82+i386_gendis_LDADD += -lintl
83+endif
84+
85 i386_parse.h: i386_parse.c ;
86
87 EXTRA_DIST = defs/i386
88Index: elfutils-0.164/libdw/Makefile.am
89===================================================================
90--- elfutils-0.164.orig/libdw/Makefile.am
91+++ elfutils-0.164/libdw/Makefile.am
92@@ -102,6 +102,11 @@ endif
93 libdw_pic_a_SOURCES =
94 am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
95
96+libdw_so_LDLIBS =
97+if USE_UCLIBC
98+libdw_so_LDLIBS += -lintl
99+endif
100+
101 libdw_so_SOURCES =
102 libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
103 ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
104@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
105 -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
106 -Wl,--version-script,$<,--no-undefined \
107 -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
108- -ldl $(argp_LDADD) $(zip_LIBS)
109+ -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
110 @$(textrel_check)
111 $(AM_V_at)ln -fs $@ $@.$(VERSION)
112
113Index: elfutils-0.164/libelf/Makefile.am
114===================================================================
115--- elfutils-0.164.orig/libelf/Makefile.am
116+++ elfutils-0.164/libelf/Makefile.am
117@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_has
118 libelf_pic_a_SOURCES =
119 am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
120
121+
122 libelf_so_LDLIBS =
123+if USE_UCLIBC
124+libelf_so_LDLIBS += -lintl
125+endif
126+
127 if USE_LOCKS
128 libelf_so_LDLIBS += -lpthread
129 endif