From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4517 invoked by alias); 17 Aug 2019 07:09:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4506 invoked by uid 89); 17 Aug 2019 07:09:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-13.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=multilib, forcing, claim X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 17 Aug 2019 07:09:20 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CE6FBAF58; Sat, 17 Aug 2019 07:09:17 +0000 (UTC) Subject: Re: [PATCH][gdb/testsuite] Fail in gdb_compile if nopie results in PIE executable To: Pedro Alves , gdb-patches@sourceware.org References: <20190723072210.GA24180@delia> <8592a3b7-56b2-92e8-1450-91882a4d524c@redhat.com> From: Tom de Vries Openpgp: preference=signencrypt Cc: Keith Seitz Message-ID: <7759ea98-851e-4216-a9ed-1dd0d626d6ed@suse.de> Date: Sat, 17 Aug 2019 07:09:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <8592a3b7-56b2-92e8-1450-91882a4d524c@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00385.txt.bz2 On 16-08-19 20:48, Pedro Alves wrote: > On 7/23/19 8:22 AM, Tom de Vries wrote: >> When running gdb.base/dump.exp with --target_board=unix/-fPIE/-pie, we get: >> ... >> Running gdb/testsuite/gdb.base/dump.exp ... >> FAIL: gdb.base/dump.exp: dump array as value, intel hex >> ... >> >> The FAIL happens because although the test specifies nopie, the exec is >> in fact compiled as PIE. The "-fPIE -pie" options specified using the >> target_board are interpreted by dejagnu as multilib_flags, and end up >> overriding the nopie flags. > > I'd think it would be better to temporarily strip out -fPIE/-pie (*) > from multilib_flags if nopie is set? > > (*) - and/or the contents of gdb,pie_ldflag gdb,pie_flag. > I'm not sure about that. I think the rationale you're applying here is to test as much as possible in a single run: testing more is better. But AFAIU, the implicit assumption about multilib flags is that a range of multilib flags is tested (because multilib flags select different libraries, so in order to claim complete testing you'd have to test all libraries). In other words, taking the -m32/-m64 example, that you'd test both with --target_board='unix/-m64' and --target_board='unix/-m32'. So, if a test-case only works for -m32, then forcing it to -m32 for unix/-m64 only makes sure you run the test twice in identical fashion. In which case testing more is not better, just longer. [ The same approach is used in gcc testing: a testcase can require a certain effective target, and multilib flags influence whether the effective target is available or not, and if not, the test is skipped as unsupported. ] Thanks, - Tom