From: Michael Forney Date: Fri, 1 Nov 2013 07:51:04 +0000 (-0700) Subject: Check for prefixed ar, readelf, and nm X-Git-Tag: elfutils-0.158~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a45c8043358151085633b15ea615f31f3bd680f7;p=thirdparty%2Felfutils.git Check for prefixed ar, readelf, and nm Sometimes with cross-compile toolchains, the tools are prefixed with the target arch. Using AC_CHECK_TOOL looks for tools named like this. Signed-off-by: Michael Forney Signed-off-by: Mark Wielaard --- diff --git a/ChangeLog b/ChangeLog index 433450d3c..026ce1e8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-11-01 Michael Forney + + * configure.ac: Call AM_PROG_AR and AC_CHECK_TOOL for readelf and nm. + 2013-10-30 Jan Kratochvil * NEWS (Version 0.158): New. diff --git a/config/ChangeLog b/config/ChangeLog index 3b1877d7d..98bf86fbb 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2013-11-01 Michael Forney + + * eu.am: Use READELF. + 2013-09-30 Mark Wielaard * elfutils.spec.in: Update for readelf NT_SIGINFO and NT_FILE diff --git a/config/eu.am b/config/eu.am index 86e5a4e90..38718c7f3 100644 --- a/config/eu.am +++ b/config/eu.am @@ -61,4 +61,4 @@ endif CLEANFILES = *.gcno *.gcda -textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi +textrel_check = if $(READELF) -d $@ | fgrep -q TEXTREL; then exit 1; fi diff --git a/configure.ac b/configure.ac index b4c249c34..ee2ce263b 100644 --- a/configure.ac +++ b/configure.ac @@ -79,6 +79,10 @@ AC_PROG_CC AC_PROG_RANLIB AC_PROG_YACC AM_PROG_LEX +# Only available since automake 1.12 +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) +AC_CHECK_TOOL([READELF], [readelf]) +AC_CHECK_TOOL([NM], [nm]) AC_CACHE_CHECK([for gcc with C99 support], ac_cv_c99, [dnl old_CFLAGS="$CFLAGS" diff --git a/libasm/Makefile.am b/libasm/Makefile.am index e16d4be0c..4d81536b6 100644 --- a/libasm/Makefile.am +++ b/libasm/Makefile.am @@ -69,7 +69,7 @@ libasm.so: libasm_pic.a libasm.map -Wl,--version-script,$(srcdir)/libasm.map,--no-undefined \ -Wl,--soname,$@.$(VERSION) \ ../libebl/libebl.a ../libelf/libelf.so $(libasm_so_LDLIBS) - if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi + if $(READELF) -d $@ | fgrep -q TEXTREL; then exit 1; fi ln -fs $@ $@.$(VERSION) install: install-am libasm.so diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 3fa6c0eff..7a768fca6 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,7 @@ +2013-11-01 Michael Forney + + * Makefile.am: Use READELF. + 2013-10-30 Jan Kratochvil * libdw.map (ELFUTILS_0.158): New. diff --git a/libdw/Makefile.am b/libdw/Makefile.am index 5fef2e185..bf9456087 100644 --- a/libdw/Makefile.am +++ b/libdw/Makefile.am @@ -113,7 +113,7 @@ libdw.so: $(srcdir)/libdw.map libdw_pic.a \ -Wl,--version-script,$<,--no-undefined \ -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\ -ldl $(zip_LIBS) - if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi + if $(READELF) -d $@ | fgrep -q TEXTREL; then exit 1; fi ln -fs $@ $@.$(VERSION) install: install-am libdw.so diff --git a/libelf/ChangeLog b/libelf/ChangeLog index d9d642187..c2c5fc420 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,7 @@ +2013-11-01 Michael Forney + + * Makefile.am: Use READELF. + 2013-10-01 Petr Machata * elf.h: Update from glibc. diff --git a/libelf/Makefile.am b/libelf/Makefile.am index 5903ea868..4646fbaeb 100644 --- a/libelf/Makefile.am +++ b/libelf/Makefile.am @@ -106,7 +106,7 @@ libelf.so: libelf_pic.a libelf.map $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \ -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro $(libelf_so_LDLIBS) - if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi + if $(READELF) -d $@ | fgrep -q TEXTREL; then exit 1; fi ln -fs $@ $@.$(VERSION) install: install-am libelf.so diff --git a/tests/ChangeLog b/tests/ChangeLog index c549fa0bc..5ebc1bd45 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2013-11-01 Michael Forney + + * Makefile.am (TESTS_ENVIRONMENT): Use and export NM. + * run-arsymtest.sh: Use NM. + 2013-11-05 Mark Wielaard * allfcts.c (main): Correct dwarf_getfuncs return value check. diff --git a/tests/Makefile.am b/tests/Makefile.am index d07cb0b0e..bc97523b8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -231,7 +231,8 @@ installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir); \ export abs_srcdir; export abs_builddir; \ export abs_top_builddir; \ export libdir; export bindir; \ - export LC_ALL; export LANG; export VALGRIND_CMD; + export LC_ALL; export LANG; export VALGRIND_CMD; \ + NM=$(NM); export NM; installed_LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \ installed $(tests_rpath) \ '$(program_transform_name)' @@ -244,7 +245,8 @@ TESTS_ENVIRONMENT = LC_ALL=C; LANG=C; VALGRIND_CMD=$(valgrind_cmd); \ abs_top_builddir=$(abs_top_builddir); \ export abs_srcdir; export abs_builddir; \ export abs_top_builddir; \ - export LC_ALL; export LANG; export VALGRIND_CMD; + export LC_ALL; export LANG; export VALGRIND_CMD; \ + NM=$(NM); export NM; LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \ $(abs_top_builddir)/libdw:$(abs_top_builddir)/backends:$(abs_top_builddir)/libelf:$(abs_top_builddir)/libasm diff --git a/tests/run-arsymtest.sh b/tests/run-arsymtest.sh index dc016e1fe..b0fdfcd61 100755 --- a/tests/run-arsymtest.sh +++ b/tests/run-arsymtest.sh @@ -28,7 +28,7 @@ tempfiles $okfile $tmpfile $testfile result=77 if test -f $lib; then # Generate list using `nm' we check against. - nm -s $lib | + ${NM} -s $lib | sed -e '1,/^Arch/d' -e '/^$/,$d' | sort > $okfile