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 E0DC73858001 for ; Thu, 25 Mar 2021 23:14:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0DC73858001 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 A2C76302FB96; Fri, 26 Mar 2021 00:14:15 +0100 (CET) Received: by librem (Postfix, from userid 1000) id 242A3C12B7; Fri, 26 Mar 2021 00:12:59 +0100 (CET) Date: Fri, 26 Mar 2021 00:12:59 +0100 From: Mark Wielaard To: "Dmitry V. Levin" Cc: Vitaly Chikunov , debugedit@sourceware.org Subject: Re: [PATCH] tests: fix for toolchains producing compressed debug sections Message-ID: <20210325231259.GJ2685@wildebeest.org> References: <20210322200000.GA3531@altlinux.org> <20210323142852.GA15238@altlinux.org> <6d7325b924aa56456f19316f091c76bb34252991.camel@klomp.org> <20210324234548.GA5335@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: <20210324234548.GA5335@altlinux.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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: Thu, 25 Mar 2021 23:14:22 -0000 --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dmitry, On Thu, Mar 25, 2021 at 02:45:48AM +0300, Dmitry V. Levin wrote: > On Tue, Mar 23, 2021 at 04:05:59PM +0100, Mark Wielaard wrote: > > So we'll need configure checks for that and not use -gz=none and skip > > the -gdwarf-5 tests when gcc isn't able to use those options. > > > I've prepared the following fix, but it seems to be too late now. > I'll post it here anyway just in case. Sorry, I didn't know you were already working on this. Your version does everything in debugedit.at which is nicely contained. But I think doing it as configure checks might help if we need them somewhere else. But you version tests the actual gcc command used in the test. We probably need to use CC instead in the tests, so it equals the build/target compiler. What do you think of the attached patch? Thanks, Mark --WIyZ46R2i8wDzkSu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-tests-Use-CC-CFLAGS-LD-and-LDFLAGS-to-create-testcas.patch" >From 686ab7788728264ff245020a63e168bced1d6161 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 26 Mar 2021 00:00:42 +0100 Subject: [PATCH] tests: Use CC, CFLAGS, LD and LDFLAGS to create testcases Currently gcc is hardcoded in the tests. Use the configured tools to make testing for a specfic target or alternative build tools easier. * configure.ac: Add AC_CHECK_TOOL for LD. * tests/atlocal.in: Set CC, CFLAGS, LD and LDFLAGS. * tests/debugedit.at (RPM_DEBUGEDIT_SETUP): Use CC, CFLAGS, LD and LDFLAGS. Signed-off-by: Mark Wielaard --- configure.ac | 1 + tests/atlocal.in | 6 ++++++ tests/debugedit.at | 10 +++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 1669b5d..c5adadf 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,7 @@ AC_USE_SYSTEM_EXTENSIONS AC_PROG_AWK AC_PROG_CC_C99 AC_PROG_LN_S +AC_CHECK_TOOL([LD], [ld]) # Only really an issue on 32bit platforms. Makes sure we'll get large off_t. AC_SYS_LARGEFILE diff --git a/tests/atlocal.in b/tests/atlocal.in index 8ca240d..a45edac 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -2,5 +2,11 @@ # Configurable variable values for test suite. PATH=@abs_builddir@:@abs_top_builddir@:$top_srcdir:$srcdir:$PATH + +CC="@CC@" +CFLAGS="@CFLAGS@" +LD="@LD@" +LDFLAGS="@LDFLAGS@" + GDWARF_5_FLAG=@GDWARF_5_FLAG@ GZ_NONE_FLAG=@GZ_NONE_FLAG@ diff --git a/tests/debugedit.at b/tests/debugedit.at index 27d3e21..38b3aa4 100644 --- a/tests/debugedit.at +++ b/tests/debugedit.at @@ -37,19 +37,19 @@ cp "${abs_srcdir}"/data/SOURCES/foobar.h subdir_headers cp "${abs_srcdir}"/data/SOURCES/baz.c . # First three object files (foo.o subdir_bar/bar.o and baz.o) -gcc -g3 $GZ_NONE_FLAG -Isubdir_headers $1 -c subdir_foo/foo.c +$CC $CFLAGS -g3 $GZ_NONE_FLAG -Isubdir_headers $1 -c subdir_foo/foo.c cd subdir_bar -gcc -g3 $GZ_NONE_FLAG -I../subdir_headers $1 -c bar.c +$CC $CFLAGS -g3 $GZ_NONE_FLAG -I../subdir_headers $1 -c bar.c cd .. -gcc -g3 $GZ_NONE_FLAG -I$(pwd)/subdir_headers $1 -c $(pwd)/baz.c +$CC $CFLAGS -g3 $GZ_NONE_FLAG -I$(pwd)/subdir_headers $1 -c $(pwd)/baz.c # Then a partially linked object file (somewhat like a kernel module). # This will still have relocations between the debug sections. -ld -r -o foobarbaz.part.o foo.o subdir_bar/bar.o baz.o +$LD $LDFLAGS -r -o foobarbaz.part.o foo.o subdir_bar/bar.o baz.o # Create an executable. Relocations between debug sections will # have been resolved. -gcc -g3 $GZ_NONE_FLAG -o foobarbaz.exe foo.o subdir_bar/bar.o baz.o +$CC $CFLAGS -g3 $GZ_NONE_FLAG -o foobarbaz.exe foo.o subdir_bar/bar.o baz.o ]]) # === -- 2.20.1 --WIyZ46R2i8wDzkSu--