summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-05-23 18:53:59 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-25 15:50:56 +0100
commita49cc20ad2e28cdd974f79da3463597dd31ab647 (patch)
treee1f5eb44172d3ef7ba683c6b8594abede8ca9d00 /meta/recipes-devtools/elfutils
parentc792ca026a92682cb7aff44fbfb66ba80568c037 (diff)
downloadpoky-a49cc20ad2e28cdd974f79da3463597dd31ab647.tar.gz
elfutils_0.148.bb: Fix compilation on uclibc
Currently all components of elfutils dont compile with uclibc but elfutils is one part which is needed by other recipes e.g. gcc 4.5 to compile. we make adjustments so that when compiling for uclibc targets it _only_ builds and packages libelf use --enable-uclibc only when building for uclibc targets The supporting patch is also needed for compiling with uclibc to specify -lintl and -luargp on linker commandline Add missing inherit on gettext (From OE-Core rev: e21267f1837b25fec4443dbf4367e501639541bd) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/elfutils')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support.patch91
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.148.bb15
2 files changed, 103 insertions, 3 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support.patch
new file mode 100644
index 0000000000..3cf16ac923
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support.patch
@@ -0,0 +1,91 @@
1on uclibc systems libintl and libuargp are separate from libc.
2so they need to be specified on commandline when we use proxy-libintl
3then libintl is a static archive so it should be listed last since
4elfutils does not respect disable-nls we need to link in libintl
5
6We add a new option --enable-uclibc which will be used to control
7the uclibc specific configurations during build.
8
9Signed-off-by: Khem Raj <raj.khem>
10
11Upstream-Status: Inappropriate [uclibc specific]
12
13Index: elfutils-0.148/configure.ac
14===================================================================
15--- elfutils-0.148.orig/configure.ac
16+++ elfutils-0.148/configure.ac
17@@ -55,9 +55,16 @@ AS_IF([test "$use_locks" = yes], [AC_DEF
18
19 AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
20
21+AC_ARG_ENABLE([uclibc],
22+AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
23+use_uclibc=yes, use_uclibc=no)
24+AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
25+AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
26+
27+AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
28+
29 dnl Add all the languages for which translations are available.
30 ALL_LINGUAS=
31-
32 AC_PROG_CC
33 AC_PROG_RANLIB
34 AC_PROG_YACC
35Index: elfutils-0.148/libelf/Makefile.am
36===================================================================
37--- elfutils-0.148.orig/libelf/Makefile.am
38+++ elfutils-0.148/libelf/Makefile.am
39@@ -93,7 +93,12 @@ if !MUDFLAP
40 libelf_pic_a_SOURCES =
41 am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
42
43+
44 libelf_so_LDLIBS =
45+if USE_UCLIBC
46+libelf_so_LDLIBS += -lintl -luargp
47+endif
48+
49 if USE_LOCKS
50 libelf_so_LDLIBS += -lpthread
51 endif
52Index: elfutils-0.148/libdw/Makefile.am
53===================================================================
54--- elfutils-0.148.orig/libdw/Makefile.am
55+++ elfutils-0.148/libdw/Makefile.am
56@@ -98,6 +98,11 @@ if !MUDFLAP
57 libdw_pic_a_SOURCES =
58 am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
59
60+libdw_so_LDLIBS =
61+if USE_UCLIBC
62+libdw_so_LDLIBS += -lintl -luargp
63+endif
64+
65 libdw_so_SOURCES =
66 libdw.so: $(srcdir)/libdw.map libdw_pic.a \
67 ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
68@@ -108,7 +113,7 @@ libdw.so: $(srcdir)/libdw.map libdw_pic.
69 -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
70 -Wl,--version-script,$<,--no-undefined \
71 -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
72- -ldl $(zip_LIBS)
73+ -ldl $(zip_LIBS) $(libdw_so_LDLIBS)
74 if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
75 ln -fs $@ $@.$(VERSION)
76
77Index: elfutils-0.148/libcpu/Makefile.am
78===================================================================
79--- elfutils-0.148.orig/libcpu/Makefile.am
80+++ elfutils-0.148/libcpu/Makefile.am
81@@ -63,6 +63,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
82 i386_lex.o: i386_parse.h
83 i386_gendis_LDADD = $(libeu) -lm $(libmudflap)
84
85+if USE_UCLIBC
86+i386_gendis_LDADD += -luargp -lintl
87+endif
88+
89 i386_parse.h: i386_parse.c ;
90
91 noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.148.bb b/meta/recipes-devtools/elfutils/elfutils_0.148.bb
index df933f61ae..115ff9bde6 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.148.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.148.bb
@@ -30,6 +30,9 @@ SRC_URI += "\
30 file://remove-unused.patch \ 30 file://remove-unused.patch \
31 file://mempcpy.patch \ 31 file://mempcpy.patch \
32" 32"
33# Only apply when building uclibc based target recipe
34SRC_URI_append_libc-uclibc = " ${@['', 'file://uclibc-support.patch']['${PN}' == '${BPN}']}"
35
33# The buildsystem wants to generate 2 .h files from source using a binary it just built, 36# The buildsystem wants to generate 2 .h files from source using a binary it just built,
34# which can not pass the cross compiling, so let's work around it by adding 2 .h files 37# which can not pass the cross compiling, so let's work around it by adding 2 .h files
35# along with the do_configure_prepend() 38# along with the do_configure_prepend()
@@ -38,9 +41,10 @@ SRC_URI += "\
38 file://i386_dis.h \ 41 file://i386_dis.h \
39 file://x86_64_dis.h \ 42 file://x86_64_dis.h \
40" 43"
41inherit autotools 44inherit autotools gettext
42 45
43EXTRA_OECONF = "--program-prefix=eu-" 46EXTRA_OECONF = "--program-prefix=eu-"
47EXTRA_OECONF_append_libc-uclibc = " ${@['', '--enable-uclibc']['${PN}' == '${BPN}']}"
44 48
45do_configure_prepend() { 49do_configure_prepend() {
46 sed -i 's:./i386_gendis:echo\ \#:g' ${S}/libcpu/Makefile.am 50 sed -i 's:./i386_gendis:echo\ \#:g' ${S}/libcpu/Makefile.am
@@ -48,8 +52,13 @@ do_configure_prepend() {
48 cp ${WORKDIR}/*dis.h ${S}/libcpu 52 cp ${WORKDIR}/*dis.h ${S}/libcpu
49} 53}
50 54
51# Only append ldflags for target recipe 55# we can not build complete elfutils when using uclibc
52TARGET_LDFLAGS_libc-uclibc += "${@['', '-lintl -luargp']['${PN}' == '${BPN}']}" 56# but some recipes e.g. gcc 4.5 depends on libelf so we
57# build only libelf for uclibc case
58
59EXTRA_OEMAKE_libc-uclibc = "-C libelf"
60EXTRA_OEMAKE_virtclass-native = ""
61EXTRA_OEMAKE_virtclass-nativesdk = ""
53 62
54BBCLASSEXTEND = "native nativesdk" 63BBCLASSEXTEND = "native nativesdk"
55 64