From 484d666485f481ea3fce447bfeec0b32a3b4f793 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 1 Jun 2017 10:26:59 +0200 Subject: build: fix nm binutils tool when building with LTO When building with -flto, we need to use linker plugins. In case of binutils' nm, it means to prefer gcc-nm if available. Like for ranlib and ar, prefer gcc-nm. - replace AC_PATH_TOOL() by AC_CHECK_TOOLS(). That is consistent with what we do for ar,ranlib and suggested on bgo#783311. - instead of using the variable $BINUTILS_NM, replace it by $NM, which is more common according to bgo#783311. - Keep recognizing $BINUTILS_NM environment, which was introduced by commit 8bc88bcc7c. This is purely to keep previous build scripts working. Originally I named it "$BINUTILS_NM" because using $NM in NetworkManager seemed confusing. But well... https://bugs.gentoo.org/show_bug.cgi?id=620052 https://bugzilla.gnome.org/show_bug.cgi?id=782525 https://bugzilla.gnome.org/show_bug.cgi?id=783311 --- configure.ac | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1b6f3b6060..4080fd4837 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,7 @@ AC_PROG_MKDIR_P # Prefer gcc-* variants; the ones libtool would choose don't work with LTO AC_CHECK_TOOLS(AR, [gcc-ar ar], false) AC_CHECK_TOOLS(RANLIB, [gcc-ranlib ranlib], :) +AC_CHECK_TOOLS(NM, [$BINUTILS_NM gcc-nm nm]) dnl Initialize libtool LT_PREREQ([2.2]) @@ -1199,8 +1200,6 @@ else fi AC_SUBST(NM_LOG_COMPILER, 'LOG_COMPILER = "$(top_srcdir)/tools/run-nm-test.sh" --called-from-make "$(LIBTOOL)" "$(with_valgrind)" "'"$with_valgrind_suppressions"'" --launch-dbus=auto') -AC_PATH_TOOL(BINUTILS_NM, nm, nm) - AM_PATH_PYTHON([], [], [PYTHON=python]) AC_SUBST(PYTHON, [$PYTHON]) AC_DEFINE_UNQUOTED(TEST_NM_PYTHON, "$PYTHON", [Define python path for test binary]) -- cgit v1.2.1