Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | From 3daec2dd11a04955f95e8f65a48820103d84dbec Mon Sep 17 00:00:00 2001 |
| 2 | From: Junling Zheng <zhengjunling@huawei.com> |
| 3 | Date: Thu, 9 Apr 2015 12:12:49 +0000 |
| 4 | Subject: [PATCH] uclibc support for elfutils 0.161 |
| 5 | |
| 6 | on uclibc systems libintl and libuargp are separate from libc. |
| 7 | so they need to be specified on commandline when we use proxy-libintl |
| 8 | then libintl is a static archive so it should be listed last since |
| 9 | elfutils does not respect disable-nls we need to link in libintl |
| 10 | |
| 11 | We add a new option --enable-uclibc which will be used to control |
| 12 | the uclibc specific configurations during build. |
| 13 | |
| 14 | Upstream-Status: Inappropriate [uclibc specific] |
| 15 | |
| 16 | Signed-off-by: Khem Raj <raj.khem> |
| 17 | Signed-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 | |
| 28 | diff --git a/configure.ac b/configure.ac |
| 29 | index 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 |
| 47 | diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am |
| 48 | index 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 |
| 62 | diff --git a/libdw/Makefile.am b/libdw/Makefile.am |
| 63 | index 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 | |
| 87 | diff --git a/libelf/Makefile.am b/libelf/Makefile.am |
| 88 | index 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 | -- |
| 105 | 1.8.3.4 |
| 106 | |