From patchwork Wed Aug 7 11:07:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 33987 Received: (qmail 45576 invoked by alias); 7 Aug 2019 11:07:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 45564 invoked by uid 89); 7 Aug 2019 11:07:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=U*tdevries, tdevries@suse.de, tdevriessusede, sk:tdevrie 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; Wed, 07 Aug 2019 11:07:19 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0A342AD3A; Wed, 7 Aug 2019 11:07:17 +0000 (UTC) Date: Wed, 7 Aug 2019 13:07:14 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey , Joel Brobecker Subject: [PATCH][gdb/testsuite] Fix ada tests with -fPIE/-pie Message-ID: <20190807110713.GA23000@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, When running the gdb testsuite with target board unix/-fPIE/-pie, the resulting ada executables are not PIE executables, because gnatmake doesn't recognize -pie, and consequently doesn't pass it to gnatlink. Fix this by replacing "-pie" with "-largs -pie -margs" for ada test-cases in gdb_default_target_compile, and doing the same for -no-pie. Tested on x86_64-linux. OK for trunk? Thanks, - Tom [gdb/testsuite] Fix ada tests with -fPIE/-pie gdb/testsuite/ChangeLog: 2019-08-07 Tom de Vries PR testsuite/24888 * lib/future.exp (gdb_default_target_compile): Route -pie/-no-pie to gnatlink for ada. --- gdb/testsuite/lib/future.exp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp index 122e652858..e26e49af91 100644 --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp @@ -530,7 +530,19 @@ proc gdb_default_target_compile {source destfile type options} { } if {[board_info $dest exists multilib_flags]} { - append add_flags " [board_info $dest multilib_flags]" + if { $compiler_type == "ada" } { + foreach op [board_info $dest multilib_flags] { + if { $op == "-pie" || $op == "-no-pie" } { + # Pretend gnatmake supports -pie/-no-pie, route it to + # linker. + append add_flags " -largs $op -margs" + } else { + append add_flags " $op" + } + } + } else { + append add_flags " [board_info $dest multilib_flags]" + } } verbose "doing compile"