blob: f1533bfd38f2accd4d9e58a0140a343401f2b8bd [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -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
28diff --git a/configure.ac b/configure.ac
29index a1ad6db..81fc33f 100644
30--- a/configure.ac
31+++ b/configure.ac
32@@ -70,6 +70,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
47diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am
48index 3beccf3..9ba6c04 100644
49--- a/libcpu/Makefile.am
50+++ b/libcpu/Makefile.am
51@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`"
52 i386_lex.o: i386_parse.h
53 i386_gendis_LDADD = $(libeu) -lm
54
55+if USE_UCLIBC
56+i386_gendis_LDADD += -luargp -lintl
57+endif
58+
59 i386_parse.h: i386_parse.c ;
60
61 EXTRA_DIST = defs/i386
62diff --git a/libdw/Makefile.am b/libdw/Makefile.am
63index 887da6b..d31b428 100644
64--- a/libdw/Makefile.am
65+++ b/libdw/Makefile.am
66@@ -102,6 +102,11 @@ endif
67 libdw_pic_a_SOURCES =
68 am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
69
70+libdw_so_LDLIBS =
71+if USE_UCLIBC
72+libdw_so_LDLIBS += -lintl -luargp
73+endif
74+
75 libdw_so_SOURCES =
76 libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
77 ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
78@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
79 -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
80 -Wl,--version-script,$<,--no-undefined \
81 -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
82- -ldl $(zip_LIBS)
83+ -ldl $(zip_LIBS) $(libdw_so_LDLIBS)
84 @$(textrel_check)
85 ln -fs $@ $@.$(VERSION)
86
87diff --git a/libelf/Makefile.am b/libelf/Makefile.am
88index afcb2aa..02836a1 100644
89--- a/libelf/Makefile.am
90+++ b/libelf/Makefile.am
91@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
92 libelf_pic_a_SOURCES =
93 am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
94
95+
96 libelf_so_LDLIBS =
97+if USE_UCLIBC
98+libelf_so_LDLIBS += -lintl -luargp
99+endif
100+
101 if USE_LOCKS
102 libelf_so_LDLIBS += -lpthread
103 endif
104--
1051.8.3.4
106