From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51688 invoked by alias); 30 Oct 2019 16:36:44 -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 51675 invoked by uid 89); 30 Oct 2019 16:36:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.6 required=5.0 tests=AWL,BAYES_00,KAM_SHORT autolearn=ham version=3.3.1 spammy=Leave, noted X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Oct 2019 16:36:43 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 48BF420250; Wed, 30 Oct 2019 12:36:41 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id BD97520250; Wed, 30 Oct 2019 12:36:34 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 8CC1D20AF6; Wed, 30 Oct 2019 12:36:34 -0400 (EDT) X-Gerrit-PatchSet: 2 Date: Wed, 30 Oct 2019 16:36:00 -0000 From: "Simon Marchi (Code Review)" To: Tom de Vries , gdb-patches@sourceware.org Cc: Luis Machado , Joel Brobecker , Tom Tromey Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v2] [gdb/testsuite] Compile ada with -lgnarl_pic and -lgnat_pic if required X-Gerrit-Change-Id: I3e1e40bd46236b45e2d7808c1cd744a075d4a148 X-Gerrit-Change-Number: 32 X-Gerrit-ChangeURL: X-Gerrit-Commit: fbebe69c7ce90156b0a07c2f0d6c227763580743 In-Reply-To: References: X-Gerrit-Comment-Date: Wed, 30 Oct 2019 12:36:34 -0400 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Content-Type: text/plain; charset=UTF-8 Message-Id: <20191030163634.8CC1D20AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-10/txt/msg01105.txt.bz2 Simon Marchi has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/32 ...................................................................... Patch Set 2: (3 comments) I noted some nits, but it looks good to me in general. I'd still like the Ada maintainers to confirm that it is a valid workaround. https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/32/2/gdb/testsuite/lib/ada.exp File gdb/testsuite/lib/ada.exp: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/32/2/gdb/testsuite/lib/ada.exp@18 PS2, Line 18: 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | 17 | # Compile the ada code in $code to a file based on $name, using the flags 18 > # $compile_flag as well as debug, nowarning and quiet. 19 | # Return 1 if code can be compiled 20 | # Leave the file name of the resulting object in the upvar object. 21 | # Similar to gdb_simple_compile, but using gdb_compile_ada_1 instead of 22 | # gdb_compile. 23 | `$compile_flags` https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/32/2/gdb/testsuite/lib/ada.exp@60 PS2, Line 60: 55 | } 56 | 57 | # Global variable used in gdb_ada_needs_libs_pic_suffix to detect recursion. 58 | # Initialize to 0. 59 | 60 > global calculating_ada_needs_libs_pic_suffix 61 | set calculating_ada_needs_libs_pic_suffix 0 62 | 63 | # Caching true/false for whether we need to use -lgnarl_pic -lgnat_pic in 64 | # target_compile_ada_from_dir. 65 | Is this global statement needed, since we're already in the global scope? https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/32/2/gdb/testsuite/lib/ada.exp@64 PS2, Line 64: 59 | 60 | global calculating_ada_needs_libs_pic_suffix 61 | set calculating_ada_needs_libs_pic_suffix 0 62 | 63 | # Caching true/false for whether we need to use -lgnarl_pic -lgnat_pic in 64 > # target_compile_ada_from_dir. 65 | 66 | gdb_caching_proc gdb_ada_needs_libs_pic_suffix { 67 | global calculating_ada_needs_libs_pic_suffix 68 | if { $calculating_ada_needs_libs_pic_suffix } { 69 | return 0 Can you explain shortly here the intent of the method used to detect whether those flags are needed? It seems to be: - try to compile without the flags, if it works it means we don't need the flags - otherwise, try to compile with the flags, if it works it means we need the flags - otherwise, we are not in a good situation (not able to build Ada files), so assume we don't need the flags, as they don't seem to help -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I3e1e40bd46236b45e2d7808c1cd744a075d4a148 Gerrit-Change-Number: 32 Gerrit-PatchSet: 2 Gerrit-Owner: Tom de Vries Gerrit-Reviewer: Joel Brobecker Gerrit-Reviewer: Tom Tromey Gerrit-Reviewer: Tom de Vries Gerrit-CC: Luis Machado Gerrit-CC: Simon Marchi Gerrit-Comment-Date: Wed, 30 Oct 2019 16:36:34 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment