From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 9188D3857C60 for ; Wed, 24 Mar 2021 23:30:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9188D3857C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from librem (deer0x15.wildebeest.org [172.31.17.151]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 957CA3000652; Thu, 25 Mar 2021 00:30:46 +0100 (CET) Received: by librem (Postfix, from userid 1000) id 5386CC1898; Thu, 25 Mar 2021 00:29:30 +0100 (CET) From: Mark Wielaard To: debugedit@sourceware.org Cc: Mark Wielaard Subject: [COMMITTED] tests: Check gcc accepts -gdwarf-5 otherwise skip DWARF5 tests Date: Thu, 25 Mar 2021 00:29:23 +0100 Message-Id: <20210324232923.22371-1-mark@klomp.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: debugedit@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: debugedit development mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 23:30:55 -0000 Add a configure check for -gdawrf-5. Set GDWARF_5_FLAG in atlocal.in to yes or no. Use AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) in debugedit.at. Signed-off-by: Mark Wielaard --- configure.ac | 10 ++++++++++ tests/atlocal.in | 2 +- tests/debugedit.at | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 09cc82e..b4bd749 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,16 @@ AC_FUNC_MMAP AC_FUNC_REALLOC AC_CHECK_FUNCS([memchr memset munmap strchr strdup strerror strrchr]) +# Checks for compiler flags. +AC_CACHE_CHECK([whether gcc supports -gdwarf-5], ac_cv_gdwarf_5, [dnl +save_CFLAGS="$CFLAGS" +CFLAGS="-gdwarf-5" +AC_COMPILE_IFELSE([AC_LANG_SOURCE()], ac_cv_gdwarf_5=yes, ac_cv_gdwarf_5=no) +CFLAGS="$save_CFLAGS" +]) +GDWARF_5_FLAG=$ac_cv_gdwarf_5 +AC_SUBST([GDWARF_5_FLAG]) + # And generate the output files. AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/tests/atlocal.in b/tests/atlocal.in index 4b7303b..1324898 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -2,4 +2,4 @@ # Configurable variable values for test suite. PATH=@abs_builddir@:@abs_top_builddir@:$top_srcdir:$srcdir:$PATH - +GDWARF_5_FLAG=@GDWARF_5_FLAG@ diff --git a/tests/debugedit.at b/tests/debugedit.at index 2d1870b..9e6606a 100644 --- a/tests/debugedit.at +++ b/tests/debugedit.at @@ -120,6 +120,7 @@ AT_CLEANUP # === AT_SETUP([debugedit .debug_str/line_str objects DWARF5]) AT_KEYWORDS([debuginfo] [debugedit]) +AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) RPM_DEBUGEDIT_SETUP([-gdwarf-5]) # Capture strings that start with the testdir (pwd) directory path @@ -184,6 +185,7 @@ AT_CLEANUP # === AT_SETUP([debugedit .debug_str/line_str partial DWARF5]) AT_KEYWORDS([debuginfo] [debugedit]) +AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) RPM_DEBUGEDIT_SETUP([-gdwarf-5]) # Capture strings that start with the testdir (pwd) directory path @@ -245,6 +247,7 @@ AT_CLEANUP # === AT_SETUP([debugedit .debug_str/line_str exe DWARF5]) AT_KEYWORDS([debuginfo] [debugedit]) +AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) RPM_DEBUGEDIT_SETUP([-gdwarf-5]) # Capture strings that start with the testdir (pwd) directory path @@ -484,6 +487,7 @@ AT_CLEANUP # === AT_SETUP([debugedit .debug_line objects DWARF5]) AT_KEYWORDS([debuginfo] [debugedit]) +AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) RPM_DEBUGEDIT_SETUP([-gdwarf-5]) AT_DATA([expout], @@ -530,6 +534,7 @@ AT_CLEANUP # === AT_SETUP([debugedit .debug_line partial DWARF5]) AT_KEYWORDS([debuginfo] [debugedit]) +AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) RPM_DEBUGEDIT_SETUP([-gdwarf-5]) AT_DATA([expout], @@ -574,6 +579,7 @@ AT_CLEANUP # === AT_SETUP([debugedit .debug_line exe DWARF5]) AT_KEYWORDS([debuginfo] [debugedit]) +AT_SKIP_IF([test "$GDWARF_5_FLAG" = "no"]) RPM_DEBUGEDIT_SETUP([-gdwarf-5]) AT_DATA([expout], -- 2.20.1