From 7c363a4e044115ea811888fe0d32b04f23d79ae2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 28 Sep 2020 13:47:25 -0700 Subject: [PATCH] libbacktrace: only run dsymutil with Mach-O libbacktrace/ChangeLog: PR libbacktrace/97227 * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL. * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL. * configure: Regenerate. * Makefile.in: Regenerate. --- libbacktrace/Makefile.am | 48 +++++++++++++++++++-------------------- libbacktrace/Makefile.in | 22 ++++++++++-------- libbacktrace/configure | 18 +++++++-------- libbacktrace/configure.ac | 2 +- 4 files changed, 46 insertions(+), 44 deletions(-) diff --git a/libbacktrace/Makefile.am b/libbacktrace/Makefile.am index 4d349386c9b..f7e8ca2cf5c 100644 --- a/libbacktrace/Makefile.am +++ b/libbacktrace/Makefile.am @@ -100,12 +100,12 @@ check_DATA = # Flags to use when compiling test programs. libbacktrace_TEST_CFLAGS = $(EXTRA_FLAGS) $(WARN_FLAGS) -g -if HAVE_DSYMUTIL +if USE_DSYMUTIL %.dSYM: % $(DSYMUTIL) $< -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL if NATIVE check_LTLIBRARIES = libbacktrace_alloc.la @@ -237,9 +237,9 @@ allocfail.sh: allocfail TESTS += allocfail.sh -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += allocfail.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL if HAVE_ELF if HAVE_OBJCOPY_DEBUGLINK @@ -273,9 +273,9 @@ btest_LDADD = libbacktrace.la BUILDTESTS += btest -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += btest.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL if HAVE_ELF @@ -293,9 +293,9 @@ btest_alloc_LDADD = libbacktrace_alloc.la BUILDTESTS += btest_alloc -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += btest_alloc.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL if HAVE_DWZ @@ -323,9 +323,9 @@ stest_LDADD = libbacktrace.la BUILDTESTS += stest -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += stest.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL stest_alloc_SOURCES = $(stest_SOURCES) stest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS) @@ -333,9 +333,9 @@ stest_alloc_LDADD = libbacktrace_alloc.la BUILDTESTS += stest_alloc -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += stest_alloc.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL if HAVE_ELF @@ -366,17 +366,17 @@ edtest_LDADD = libbacktrace.la BUILDTESTS += edtest -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += edtest.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL edtest_alloc_SOURCES = $(edtest_SOURCES) edtest_alloc_CFLAGS = $(libbacktrace_TEST_CFLAGS) edtest_alloc_LDADD = libbacktrace_alloc.la -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += edtest_alloc.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL BUILDTESTS += edtest_alloc @@ -394,9 +394,9 @@ ttest_SOURCES = ttest.c testlib.c ttest_CFLAGS = $(libbacktrace_TEST_CFLAGS) -pthread ttest_LDADD = libbacktrace.la -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += ttest.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL BUILDTESTS += ttest_alloc @@ -404,9 +404,9 @@ ttest_alloc_SOURCES = $(ttest_SOURCES) ttest_alloc_CFLAGS = $(ttest_CFLAGS) ttest_alloc_LDADD = libbacktrace_alloc.la -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += ttest_alloc.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL endif HAVE_PTHREAD @@ -462,9 +462,9 @@ dwarf5_LDADD = libbacktrace.la BUILDTESTS += dwarf5 -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += dwarf5.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL dwarf5_alloc_SOURCES = $(dwarf5_SOURCES) dwarf5_alloc_CFLAGS = $(dwarf5_CFLAGS) @@ -472,9 +472,9 @@ dwarf5_alloc_LDADD = libbacktrace_alloc.la BUILDTESTS += dwarf5_alloc -if HAVE_DSYMUTIL +if USE_DSYMUTIL check_DATA += dwarf5_alloc.dSYM -endif HAVE_DSYMUTIL +endif USE_DSYMUTIL endif diff --git a/libbacktrace/Makefile.in b/libbacktrace/Makefile.in index 201cee36d34..b7280aaba68 100644 --- a/libbacktrace/Makefile.in +++ b/libbacktrace/Makefile.in @@ -131,10 +131,10 @@ TESTS = $(am__append_4) $(am__append_7) $(am__append_9) \ @NATIVE_TRUE@ test_unknown unittest unittest_alloc btest @NATIVE_TRUE@am__append_3 = allocfail @NATIVE_TRUE@am__append_4 = allocfail.sh -@HAVE_DSYMUTIL_TRUE@@NATIVE_TRUE@am__append_5 = allocfail.dSYM \ -@HAVE_DSYMUTIL_TRUE@@NATIVE_TRUE@ btest.dSYM btest_alloc.dSYM \ -@HAVE_DSYMUTIL_TRUE@@NATIVE_TRUE@ stest.dSYM stest_alloc.dSYM \ -@HAVE_DSYMUTIL_TRUE@@NATIVE_TRUE@ edtest.dSYM edtest_alloc.dSYM +@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_5 = allocfail.dSYM \ +@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ btest.dSYM btest_alloc.dSYM \ +@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ stest.dSYM stest_alloc.dSYM \ +@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ edtest.dSYM edtest_alloc.dSYM @HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_6 = b2test @HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_7 = b2test_buildid @HAVE_DWZ_TRUE@@HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_8 = b3test @@ -148,15 +148,17 @@ TESTS = $(am__append_4) $(am__append_7) $(am__append_9) \ @HAVE_ELF_TRUE@@NATIVE_TRUE@am__append_16 = ztest ztest_alloc @NATIVE_TRUE@am__append_17 = edtest edtest_alloc @HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__append_18 = ttest ttest_alloc -@HAVE_DSYMUTIL_TRUE@@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@am__append_19 = ttest.dSYM \ -@HAVE_DSYMUTIL_TRUE@@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ ttest_alloc.dSYM +@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_19 = \ +@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ ttest.dSYM \ +@HAVE_PTHREAD_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ ttest_alloc.dSYM @HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@am__append_20 = btest_gnudebuglink @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@am__append_21 = ctestg ctesta \ @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctestg_alloc \ @HAVE_COMPRESSED_DEBUG_TRUE@@NATIVE_TRUE@ ctesta_alloc @HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__append_22 = dwarf5 dwarf5_alloc -@HAVE_DSYMUTIL_TRUE@@HAVE_DWARF5_TRUE@@NATIVE_TRUE@am__append_23 = dwarf5.dSYM \ -@HAVE_DSYMUTIL_TRUE@@HAVE_DWARF5_TRUE@@NATIVE_TRUE@ dwarf5_alloc.dSYM +@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@am__append_23 = \ +@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ dwarf5.dSYM \ +@HAVE_DWARF5_TRUE@@NATIVE_TRUE@@USE_DSYMUTIL_TRUE@ dwarf5_alloc.dSYM @NATIVE_TRUE@am__append_24 = mtest @HAVE_MINIDEBUG_TRUE@@NATIVE_TRUE@am__append_25 = mtest_minidebug @HAVE_ELF_TRUE@@HAVE_LIBLZMA_TRUE@am__append_26 = -llzma @@ -2392,8 +2394,8 @@ uninstall-am: .PRECIOUS: Makefile -@HAVE_DSYMUTIL_TRUE@%.dSYM: % -@HAVE_DSYMUTIL_TRUE@ $(DSYMUTIL) $< +@USE_DSYMUTIL_TRUE@%.dSYM: % +@USE_DSYMUTIL_TRUE@ $(DSYMUTIL) $< @HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@elf_for_test.c: elf.c @HAVE_ELF_TRUE@@HAVE_OBJCOPY_DEBUGLINK_TRUE@@NATIVE_TRUE@ SEARCH='^#define SYSTEM_BUILD_ID_DIR.*$$'; \ diff --git a/libbacktrace/configure b/libbacktrace/configure index 031a15602c6..8c8c34d45cf 100755 --- a/libbacktrace/configure +++ b/libbacktrace/configure @@ -645,8 +645,8 @@ COMM HAVE_XZ_FALSE HAVE_XZ_TRUE XZ -HAVE_DSYMUTIL_FALSE -HAVE_DSYMUTIL_TRUE +USE_DSYMUTIL_FALSE +USE_DSYMUTIL_TRUE HAVE_OBJCOPY_DEBUGLINK_FALSE HAVE_OBJCOPY_DEBUGLINK_TRUE READELF @@ -13860,12 +13860,12 @@ $as_echo "no" >&6; } fi - if test -n "${DSYMUTIL}"; then - HAVE_DSYMUTIL_TRUE= - HAVE_DSYMUTIL_FALSE='#' + if test -n "${DSYMUTIL}" -a "$FORMAT_FILE" = "macho.lo"; then + USE_DSYMUTIL_TRUE= + USE_DSYMUTIL_FALSE='#' else - HAVE_DSYMUTIL_TRUE='#' - HAVE_DSYMUTIL_FALSE= + USE_DSYMUTIL_TRUE='#' + USE_DSYMUTIL_FALSE= fi @@ -14271,8 +14271,8 @@ if test -z "${HAVE_OBJCOPY_DEBUGLINK_TRUE}" && test -z "${HAVE_OBJCOPY_DEBUGLINK as_fn_error $? "conditional \"HAVE_OBJCOPY_DEBUGLINK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_DSYMUTIL_TRUE}" && test -z "${HAVE_DSYMUTIL_FALSE}"; then - as_fn_error $? "conditional \"HAVE_DSYMUTIL\" was never defined. +if test -z "${USE_DSYMUTIL_TRUE}" && test -z "${USE_DSYMUTIL_FALSE}"; then + as_fn_error $? "conditional \"USE_DSYMUTIL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_XZ_TRUE}" && test -z "${HAVE_XZ_FALSE}"; then diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac index 0659ea60484..ec456bf4a1f 100644 --- a/libbacktrace/configure.ac +++ b/libbacktrace/configure.ac @@ -510,7 +510,7 @@ AM_CONDITIONAL(HAVE_OBJCOPY_DEBUGLINK, test "$libbacktrace_cv_objcopy_debuglink" AC_ARG_VAR(DSYMUTIL, [location of dsymutil]) AC_CHECK_PROG(DSYMUTIL, dsymutil, dsymutil) -AM_CONDITIONAL(HAVE_DSYMUTIL, test -n "${DSYMUTIL}") +AM_CONDITIONAL(USE_DSYMUTIL, test -n "${DSYMUTIL}" -a "$FORMAT_FILE" = "macho.lo") AC_ARG_VAR(NM, [location of nm]) AC_CHECK_PROG(NM, nm, nm) -- 2.30.2