From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50729 invoked by alias); 2 Nov 2019 00:04:03 -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 50717 invoked by uid 89); 2 Nov 2019 00:04:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=brobecker, lgnat_pic, U*brobecker, Brobecker 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; Sat, 02 Nov 2019 00:04:01 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id E2C0E204A6; Fri, 1 Nov 2019 20:03:58 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 724AA20172; Fri, 1 Nov 2019 20:03:56 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 1CCBE20AF6; Fri, 1 Nov 2019 20:03:56 -0400 (EDT) X-Gerrit-PatchSet: 3 Date: Sat, 02 Nov 2019 00:04:00 -0000 From: "Joel Brobecker (Code Review)" To: Tom de Vries , gdb-patches@sourceware.org Cc: Luis Machado , Tom Tromey , Simon Marchi Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v3] [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: 5a5172eaab1f54c91a8dbf46679c67dcc6b63337 In-Reply-To: References: X-Gerrit-Comment-Date: Fri, 1 Nov 2019 20:03:56 -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: <20191102000356.1CCBE20AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg00046.txt.bz2 Joel Brobecker has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/32 ...................................................................... Patch Set 3: I think there is one weakness in the approach, which would show up if the program is to be compiled with '-bargs -shared', or when calling "gnatbind" with the '-shared' command-line argument. In that situation, it instructs the linker to use the shared version of libgnat, rather than the archive. In that case, I don't think you should be using -lgnat_pic, as I believe it would force the non-shared version to be used. Ideally, what we would do to avoid that issue is to check whether the program is being compiled with a `-shared` option inside a `-bargs` section. This may require a bit of smart splitting, unfortunately. The good news is that the above would effectively take care of another question of mine, which is the fact that the code links the program with libgnarl without checking that the program depends on the tasking runtime or not. For programs that don't use tasking, it's not desirable to include it like that. But the good news is, if we determine that the PIC versions are needed in general, and we don't see `-bargs -shared`, then we know we're linking against runtime archive files, and thus libgnarl ends up being ignored if nothing references it. -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I3e1e40bd46236b45e2d7808c1cd744a075d4a148 Gerrit-Change-Number: 32 Gerrit-PatchSet: 3 Gerrit-Owner: Tom de Vries Gerrit-Reviewer: Joel Brobecker Gerrit-Reviewer: Luis Machado Gerrit-Reviewer: Tom Tromey Gerrit-Reviewer: Tom de Vries Gerrit-CC: Simon Marchi Gerrit-Comment-Date: Sat, 02 Nov 2019 00:03:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment