From patchwork Sat Nov 24 09:51:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1002651 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-490816-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gdcproject.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="J6HuavEN"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4327kX3sBDz9s3C for ; Sat, 24 Nov 2018 20:52:01 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=vrtGWsqlkff34gaFdiAcmSznHaOkQtnVCaFTop2o/u4hDz 2ee4mc5S91p4gDOOQh2oWyBdCuA7WMr9AgAPpNfUPnkHKEYCrlmxNf9KNIZdy7qY AvS730qejj1dMmS8PKijuTtQWPBuIV/xZlD378E37GNyJclbS+epWBKDGtWkM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=JxLjckwHfmI8Hm6tEVbkxfHblU4=; b=J6HuavEN2SlU768ma0OR dVuBV8+fjlJ/WC6/kERsfOp11fKtzsn3evrLT/7qc8AE1R6lvf0ZFDodhk8BTkH+ 3ZlsESfQ8WFDdg8LxdLf1SQY68d3vI2vxQtA+zVc0tZV54QMwaA3lt7PK9Oim5Nt tQ7SlmxJnmmMac9Qb4wJ29Y= Received: (qmail 116568 invoked by alias); 24 Nov 2018 09:51:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 116072 invoked by uid 89); 24 Nov 2018 09:51:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:Sat, *target X-HELO: mail-qk1-f193.google.com Received: from mail-qk1-f193.google.com (HELO mail-qk1-f193.google.com) (209.85.222.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 24 Nov 2018 09:51:45 +0000 Received: by mail-qk1-f193.google.com with SMTP id 131so9686997qkd.4 for ; Sat, 24 Nov 2018 01:51:45 -0800 (PST) MIME-Version: 1.0 From: Iain Buclaw Date: Sat, 24 Nov 2018 10:51:31 +0100 Message-ID: Subject: [PATCH PR d/87866] Committed use lrealpath to get canonical name To: gcc-patches X-IsSubscribed: yes Hi, This patch fixes PR d/87866. The libiberty function is more portable than the one provided by the dmd front-end. I checked other places where FileName::canonicalName is used internally to dmd, but found none that would be used by us. Bootstrapped, ran D2 testsuite on x86_64-linux-gnu. Commited to trunk as r266429. Iain --- gcc/d/ChangeLog: 2018-11-24 Iain Buclaw PR d/87866 * d-incpath.cc (add_globalpaths): Use lrealpath to get canonical name. (add_filepaths): Likewise. --- diff --git a/gcc/d/d-incpath.cc b/gcc/d/d-incpath.cc index be08ccb5f3b..87db8164134 100644 --- a/gcc/d/d-incpath.cc +++ b/gcc/d/d-incpath.cc @@ -78,7 +78,7 @@ add_globalpaths (Strings *paths) for (size_t i = 0; i < paths->dim; i++) { const char *path = (*paths)[i]; - const char *target = FileName::canonicalName (path); + const char *target = lrealpath (path); if (target == NULL || !FileName::exists (target)) { @@ -105,7 +105,7 @@ add_filepaths (Strings *paths) for (size_t i = 0; i < paths->dim; i++) { const char *path = (*paths)[i]; - const char *target = FileName::canonicalName (path); + const char *target = lrealpath (path); if (!FileName::exists (target)) {