From patchwork Mon Sep 20 06:50:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 45171 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D76E93857C48 for ; Mon, 20 Sep 2021 06:51:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id 9C0F63858005 for ; Mon, 20 Sep 2021 06:50:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9C0F63858005 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 8786 invoked from network); 20 Sep 2021 06:50:36 -0000 X-APM-Out-ID: 16321206360878 X-APM-Authkey: 257869/1(257869/1) 2 Received: from unknown (HELO ?192.168.1.214?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 20 Sep 2021 06:50:36 -0000 From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: [pushed] Driver: Fix bootstrap with DEFAULT_{ASSEMBLER,LINKER,DSYMUTIL}. Message-Id: Date: Mon, 20 Sep 2021 07:50:35 +0100 To: GCC Patches X-Mailer: Apple Mail (2.3445.104.21) X-Spam-Status: No, score=-15.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi The patch at r12-3662-g5fee8a0a9223d factored the code for printing the names of programes into a separate function. However the moved editions that print out the names of the assembler, linker (and dsymutil on Darwin) when those are specified at configure-time were not adjusted accordingly, leading to a bootstrap fail. Fixed by testing specifically for execute OK, since we know these are programs. tested on i686-darwin9, x86_64-darwin20 configured with —with-{as,ld,dsymutil}= and on x86_64-darwin18 without. confirmed that the build and installed versions print the right thing (and, of course, that bootstrap succeeds). pushed to master as bootstrap fix, thanks Iain Signed-off-by: Iain Sandoe gcc/ChangeLog: * gcc.c: Test for execute OK when we find the programs for assembler linker and dsymutil and those were specified at configure-time. --- gcc/gcc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- diff --git a/gcc/gcc.c b/gcc/gcc.c index 1a74bf92f7a..506c2acc282 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -3083,17 +3083,17 @@ find_a_program (const char *name) /* Do not search if default matches query. */ #ifdef DEFAULT_ASSEMBLER - if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, mode) == 0) + if (! strcmp (name, "as") && access (DEFAULT_ASSEMBLER, X_OK) == 0) return xstrdup (DEFAULT_ASSEMBLER); #endif #ifdef DEFAULT_LINKER - if (! strcmp (name, "ld") && access (DEFAULT_LINKER, mode) == 0) + if (! strcmp (name, "ld") && access (DEFAULT_LINKER, X_OK) == 0) return xstrdup (DEFAULT_LINKER); #endif #ifdef DEFAULT_DSYMUTIL - if (! strcmp (name, "dsymutil") && access (DEFAULT_DSYMUTIL, mode) == 0) + if (! strcmp (name, "dsymutil") && access (DEFAULT_DSYMUTIL, X_OK) == 0) return xstrdup (DEFAULT_DSYMUTIL); #endif