Message ID | 20160408155331.GA31979@host1.jankratochvil.net |
---|---|
State | New, archived |
Headers |
Received: (qmail 117883 invoked by alias); 8 Apr 2016 15:53:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 117867 invoked by uid 89); 8 Apr 2016 15:53:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 Apr 2016 15:53:36 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CF4CC049D5C; Fri, 8 Apr 2016 15:53:35 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u38FrWSF007287 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 8 Apr 2016 11:53:34 -0400 Date: Fri, 8 Apr 2016 17:53:31 +0200 From: Jan Kratochvil <jan.kratochvil@redhat.com> To: gdb-patches@sourceware.org Cc: Markus Metzger <markus.t.metzger@intel.com> Subject: [testsuite patch] Fix gdb.btrace/tailcall-only.exp errors on x86_64-m32 Message-ID: <20160408155331.GA31979@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="huq684BweRXVnRxX" Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes |
Commit Message
Jan Kratochvil
April 8, 2016, 3:53 p.m. UTC
Hi, $ runtest 'CC_FOR_TARGET=gcc -m32' gdb.btrace/tailcall-only.exp Running ./gdb.btrace/tailcall-only.exp ... gdb compile failed, tailcall-only.c: Assembler messages: tailcall-only.c:142: Error: cannot represent relocation type BFD_RELOC_64 [...] tailcall-only.c:425: Error: cannot represent relocation type BFD_RELOC_64 It works for the other x86 arch combinations: --- 20160406clean63-fedora-rawhide//fedora-rawhide-x86_64/out/gdb-x86_64-redhat-linux-gnu-m32.sum 2016-04-06 17:44:45.262849875 +0200 +++ 20160408clean67-fedora-rawhide//fedora-rawhide-x86_64/out/gdb-x86_64-redhat-linux-gnu-m32.sum 2016-04-08 17:40:49.739742759 +0200 #gdb.btrace/tailcall-only.exp +Running gdb/testsuite/gdb.btrace/tailcall-only.exp ... +gdb compile failed, tailcall-only.c: Assembler messages: +tailcall-only.c:142: Error: cannot represent relocation type BFD_RELOC_64 [...] +tailcall-only.c:425: Error: cannot represent relocation type BFD_RELOC_64 +UNTESTED: gdb.btrace/tailcall-only.exp: tailcall-only.exp --- 20160406clean63-fedora-rawhide//fedora-rawhide-x86_64/out/gdb-x86_64-redhat-linux-gnu-m64.sum 2016-04-06 17:44:45.555852344 +0200 +++ 20160408clean67-fedora-rawhide//fedora-rawhide-x86_64/out/gdb-x86_64-redhat-linux-gnu-m64.sum 2016-04-08 17:40:50.021744759 +0200 #gdb.btrace/tailcall-only.exp +Running gdb/testsuite/gdb.btrace/tailcall-only.exp ... +PASS: gdb.btrace/tailcall-only.exp: set record function-call-history-size 0 [...] +PASS: gdb.btrace/tailcall-only.exp: info frame --- 20160406clean63-fedora-rawhide//fedora-rawhide-i386/out/gdb-i686-redhat-linux-gnu-m32.sum 2016-04-06 17:43:44.152334900 +0200 +++ 20160408clean67-fedora-rawhide//fedora-rawhide-i386/out/gdb-i686-redhat-linux-gnu-m32.sum 2016-04-08 17:40:04.451421514 +0200 #gdb.btrace/tailcall-only.exp +Running gdb/testsuite/gdb.btrace/tailcall-only.exp ... +PASS: gdb.btrace/tailcall-only.exp: set record function-call-history-size 0 [...] +PASS: gdb.btrace/tailcall-only.exp: info frame OK for check-in? Jan gdb/testsuite/ChangeLog 2016-04-08 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.btrace/tailcall-only.exp: Use is_lp64_target check.
Comments
> -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of Jan Kratochvil > Sent: Friday, April 8, 2016 5:54 PM > To: gdb-patches@sourceware.org > Cc: Metzger, Markus T <markus.t.metzger@intel.com> > Subject: [testsuite patch] Fix gdb.btrace/tailcall-only.exp errors on x86_64- > m32 Hi Jan, > $ runtest 'CC_FOR_TARGET=gcc -m32' gdb.btrace/tailcall-only.exp Running > ./gdb.btrace/tailcall-only.exp ... > gdb compile failed, tailcall-only.c: Assembler messages: > tailcall-only.c:142: Error: cannot represent relocation type BFD_RELOC_64 [...] > tailcall-only.c:425: Error: cannot represent relocation type BFD_RELOC_64 I'm setting the target triplet to "i686-unknown-linux" in my m32 configuration. Like this: set target_triplet "i686-unknown-linux" set_board_info cflags "-m32" set_board_info cppflags "-m32" Should I rather not set the target_triplet? In that case, there are a few more build errors in other gdb.btrace tests. Thanks, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928
Hello Markus, On Mon, 11 Apr 2016 08:44:23 +0200, Metzger, Markus T wrote: > > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > > owner@sourceware.org] On Behalf Of Jan Kratochvil [...] > > $ runtest 'CC_FOR_TARGET=gcc -m32' gdb.btrace/tailcall-only.exp Running [...] > I'm setting the target triplet to "i686-unknown-linux" in my m32 configuration. > Like this: > > set target_triplet "i686-unknown-linux" > set_board_info cflags "-m32" that is an interesting idea and I agree it is a more correct way to run the testsuite. Nonetheless it seems to me GDB does not require arch-specific target_triplet to be set, I have searched now a bit and picked for example: https://sourceware.org/ml/gdb-patches/2010-07/msg00343.html This is why the functions like is_lp64_target were created. I will leave it up to the GDB maintainers what is the correct way and possibly adjust my testing scripts accordingly. Thanks, Jan
On 04/11/2016 07:44 AM, Metzger, Markus T wrote: >> -----Original Message----- >> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- >> owner@sourceware.org] On Behalf Of Jan Kratochvil >> Sent: Friday, April 8, 2016 5:54 PM >> To: gdb-patches@sourceware.org >> Cc: Metzger, Markus T <markus.t.metzger@intel.com> >> Subject: [testsuite patch] Fix gdb.btrace/tailcall-only.exp errors on x86_64- >> m32 > > Hi Jan, > >> $ runtest 'CC_FOR_TARGET=gcc -m32' gdb.btrace/tailcall-only.exp Running >> ./gdb.btrace/tailcall-only.exp ... >> gdb compile failed, tailcall-only.c: Assembler messages: >> tailcall-only.c:142: Error: cannot represent relocation type BFD_RELOC_64 [...] >> tailcall-only.c:425: Error: cannot represent relocation type BFD_RELOC_64 > > I'm setting the target triplet to "i686-unknown-linux" in my m32 configuration. > Like this: > > set target_triplet "i686-unknown-linux" > set_board_info cflags "-m32" > set_board_info cppflags "-m32" > > Should I rather not set the target_triplet? There's no reason you should _not_ set it. But, multilib-style testing with --target_board=unix\{-m64,-m32\} etc. should work _too_, IMO. Thanks, Pedro Alves
On Wed, 20 Jul 2016 16:02:20 +0200, Pedro Alves wrote: > On 04/11/2016 07:44 AM, Metzger, Markus T wrote: > > I'm setting the target triplet to "i686-unknown-linux" in my m32 configuration. > > Like this: > > > > set target_triplet "i686-unknown-linux" > > set_board_info cflags "-m32" > > set_board_info cppflags "-m32" > > > > Should I rather not set the target_triplet? > > There's no reason you should _not_ set it. > > But, multilib-style testing with --target_board=unix\{-m64,-m32\} etc. > should work _too_, IMO. Checked in: 7674d381b47f9f2411c0ca1da0c152940dc0d7bd Thanks, Jan
> -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Wednesday, July 20, 2016 4:23 PM > To: Pedro Alves <palves@redhat.com> > Cc: Metzger, Markus T <markus.t.metzger@intel.com>; gdb- > patches@sourceware.org > Subject: [commit] [testsuite patch] Fix gdb.btrace/tailcall-only.exp errors on > x86_64-m32 > > On Wed, 20 Jul 2016 16:02:20 +0200, Pedro Alves wrote: > > On 04/11/2016 07:44 AM, Metzger, Markus T wrote: > > > I'm setting the target triplet to "i686-unknown-linux" in my m32 configuration. > > > Like this: > > > > > > set target_triplet "i686-unknown-linux" > > > set_board_info cflags "-m32" > > > set_board_info cppflags "-m32" > > > > > > Should I rather not set the target_triplet? > > > > There's no reason you should _not_ set it. > > > > But, multilib-style testing with --target_board=unix\{-m64,-m32\} etc. > > should work _too_, IMO. > > Checked in: > 7674d381b47f9f2411c0ca1da0c152940dc0d7bd Would this also work for x32? Regards, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928
On Wed, 20 Jul 2016 16:26:20 +0200, Metzger, Markus T wrote: > > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > > Checked in: > > 7674d381b47f9f2411c0ca1da0c152940dc0d7bd > > Would this also work for x32? I do not have any x32 system setup. Is there some recommended x32 distro? Unfortunately Fedora/RHEL have no x32 build. Jan
On 07/20/2016 03:26 PM, Metzger, Markus T wrote: >> From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] >> On Wed, 20 Jul 2016 16:02:20 +0200, Pedro Alves wrote: >>> But, multilib-style testing with --target_board=unix\{-m64,-m32\} etc. >>> should work _too_, IMO. >> >> Checked in: >> 7674d381b47f9f2411c0ca1da0c152940dc0d7bd > > Would this also work for x32? Not sure this particular commit, but AFAIK, there's no target triplet for x32, even. Presumably people run x32 testing with --target_board=unix/-mx32. I'm on Fedora so can't test it, myself. So using is_lp64_target / is_amd64_regs_target / is_x86_like_target etc. checks is really the only way to make a testcase detect it's targeting x32, and adjust itself, skip, etc.. Thanks, Pedro Alves
On Wed, 20 Jul 2016 16:36:46 +0200, Pedro Alves wrote: > Not sure this particular commit, but AFAIK, there's no target > triplet for x32, even. https://sourceware.org/glibc/wiki/x32 -> x86_64-x32-linux Jan
On 07/20/2016 03:38 PM, Jan Kratochvil wrote: > On Wed, 20 Jul 2016 16:36:46 +0200, Pedro Alves wrote: >> Not sure this particular commit, but AFAIK, there's no target >> triplet for x32, even. > > https://sourceware.org/glibc/wiki/x32 > -> > x86_64-x32-linux AFAICS, that "x32" is in the "vendor" part of the triplet, which should never mean anything for the tools themselves, being a free field to use by whoever builds the tools, in order to give the binaries a unique file name (x86_64-x32-linux-gcc, etc.), and for branding, like x86_64-redhat-linux-gcc. AFAICS, nothing in config.sub, and the different configure scripts in binutils-gdb select on *-x32-*. ISTR that a triplet like x86_64-*-linux-gnux32 or x86_64-*-linux-gnu-x32 was originally proposed, but then the toolchain ended using strictly multilib flags to select/detect x32. But, actually, now that I grep, I find a few hits on "x86_64-*-linux-gnux32", though not many, so it looks like there's a triplet after all. Thanks, Pedro Alves
> -----Original Message----- > From: Pedro Alves [mailto:palves@redhat.com] > Sent: Wednesday, July 20, 2016 5:08 PM > To: Jan Kratochvil <jan.kratochvil@redhat.com> > Cc: Metzger, Markus T <markus.t.metzger@intel.com>; gdb- > patches@sourceware.org > Subject: Re: [commit] [testsuite patch] Fix gdb.btrace/tailcall-only.exp errors on > x86_64-m32 > > On 07/20/2016 03:38 PM, Jan Kratochvil wrote: > > On Wed, 20 Jul 2016 16:36:46 +0200, Pedro Alves wrote: > >> Not sure this particular commit, but AFAIK, there's no target > >> triplet for x32, even. > > > > https://sourceware.org/glibc/wiki/x32 > > -> > > x86_64-x32-linux > > AFAICS, that "x32" is in the "vendor" part of the triplet, which should > never mean anything for the tools themselves, being a free field to use by > whoever builds the tools, in order to give the binaries a unique > file name (x86_64-x32-linux-gcc, etc.), and for branding, like > x86_64-redhat-linux-gcc. AFAICS, nothing in config.sub, and the > different configure scripts in binutils-gdb select on *-x32-*. > > ISTR that a triplet like x86_64-*-linux-gnux32 or x86_64-*-linux-gnu-x32 > was originally proposed, but then the toolchain ended using strictly > multilib flags to select/detect x32. But, actually, now that I grep, I find > a few hits on "x86_64-*-linux-gnux32", though not many, so it looks like > there's a triplet after all. I use the triplet to select the source files for a test. Seems that wasn't such a good idea. Using the pointer size doesn't seem to be such a good idea, either, as x32 uses x86_64 ISA with 32-bit pointers. Is there a recommended/documented way on how this should be done? thanks, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928
On 07/21/2016 02:50 PM, Metzger, Markus T wrote: > I use the triplet to select the source files for a test. Seems that wasn't such > a good idea. > > Using the pointer size doesn't seem to be such a good idea, either, as x32 > uses x86_64 ISA with 32-bit pointers. But that's exactly what you want. > > Is there a recommended/documented way on how this should be done? - is_amd64_regs_target detects x86_64 ISA. - is_lp64_target detects 64-bit/32-bit pointers. Thus: is_amd64_regs_target && is_lp64_target == 64-bit is_amd64_regs_target && !is_lp64_target == x32 !is_amd64_regs_target == 32-bit See intro comments to is_amd64_regs_target and proc is_x86_like_target. Thanks, Pedro Alves
> -----Original Message----- > From: Pedro Alves [mailto:palves@redhat.com] > Sent: Thursday, July 21, 2016 4:00 PM > To: Metzger, Markus T <markus.t.metzger@intel.com>; Jan Kratochvil > <jan.kratochvil@redhat.com> > Cc: gdb-patches@sourceware.org > Subject: Re: [commit] [testsuite patch] Fix gdb.btrace/tailcall-only.exp errors on > x86_64-m32 > > On 07/21/2016 02:50 PM, Metzger, Markus T wrote: > > > I use the triplet to select the source files for a test. Seems that wasn't such > > a good idea. > > > > Using the pointer size doesn't seem to be such a good idea, either, as x32 > > uses x86_64 ISA with 32-bit pointers. > > But that's exactly what you want. > > > > > Is there a recommended/documented way on how this should be done? > > - is_amd64_regs_target detects x86_64 ISA. > > - is_lp64_target detects 64-bit/32-bit pointers. > > Thus: > > is_amd64_regs_target && is_lp64_target == 64-bit > is_amd64_regs_target && !is_lp64_target == x32 > !is_amd64_regs_target == 32-bit > > See intro comments to is_amd64_regs_target and proc is_x86_like_target. Thanks, looks like just "is_amd64_regs_target" is what I want. Thanks, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928
diff --git a/gdb/testsuite/gdb.btrace/tailcall-only.exp b/gdb/testsuite/gdb.btrace/tailcall-only.exp index 44501f5..50837bf 100644 --- a/gdb/testsuite/gdb.btrace/tailcall-only.exp +++ b/gdb/testsuite/gdb.btrace/tailcall-only.exp @@ -35,9 +35,9 @@ if [info exists COMPILE] { # make check RUNTESTFLAGS="gdb.btrace/tailcall-only.exp COMPILE=1" standard_testfile tailcall-only.c lappend opts debug optimize=-O2 -} elseif {[istarget "x86_64-*-*"]} { +} elseif {[istarget "x86_64-*-*"] && [is_lp64_target]} { standard_testfile x86_64-tailcall-only.S -} elseif {[istarget "i?86-*-*"]} { +} elseif {[istarget "i?86-*-*"] || [istarget "x86_64-*-*"]} { standard_testfile i686-tailcall-only.S } else { verbose "Skipping ${testfile}."