From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050:0:465::202]) by sourceware.org (Postfix) with ESMTPS id 2A77F3858C56 for ; Tue, 17 May 2022 11:14:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A77F3858C56 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4L2YRK5MsXz9scn; Tue, 17 May 2022 13:14:21 +0200 (CEST) Date: Tue, 17 May 2022 13:14:18 +0200 From: Iain Buclaw Subject: Re: [PATCH] gdc 9, 10 and 11 bug fix To: Marc =?iso-8859-1?q?Aur=E8le?= La France Cc: gcc-patches@gcc.gnu.org References: <1652619184.mo716bh9xr.astroid@pulse.none> In-Reply-To: MIME-Version: 1.0 Message-Id: <1652785964.hma4ncd2fy.astroid@pulse.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4L2YRK5MsXz9scn X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , X-List-Received-Date: Tue, 17 May 2022 11:14:28 -0000 Excerpts from Marc Aur=C3=A8le La France's message of Mai 16, 2022 11:34 pm= : > On Sun, 15 May 2022, Iain Buclaw wrote: >> Excerpts from Marc Aur=C3=A8le La France's message of Mai 12, 2022 10:29= pm: >=20 >>> No compiler has any business rejecting files for the sole crime of >>> being symlinked to. The following applies, modulo patch fuzz, to the >>> 9, 10 and 11 series of compilers. >=20 >>> Given my use of shadow trees, this bug attempted to prevent me from >>> building 12.1.0. The D-based gdc in 12.1.0 and up does not exhibit >>> this quirky behaviour. >=20 >> Thanks, I've checked upstream and see the following change: >=20 >> https://github.com/dlang/dmd/pull/11836/commits/ebda81e44fd0ca4b247a1860= d9bef411c41c16cb >=20 >> It should be fine to just backport that. >=20 > Thanks for the pointer. >=20 > I ended up with the three slightly different diffs below, one each for > the 9, 10 and 11 branches. Each was rebuilt using 8.5.0, then used to > rebuild 12.1.0. All of this ran smoothly without complaint, although I > wouldn't want to do this on a 486... >=20 > Thanks again and have a great day. >=20 > Marc. >=20 > Signed-off-by: Marc Aur=C3=A8le La France >=20 > For GCC 9 ---------- 8< ---------- >=20 > diff -aNpRruz -X /etc/diff.excludes gcc-9.4.0/gcc/d/dmd/root/filename.c d= evel-9.4.0/gcc/d/dmd/root/filename.c > --- gcc-9.4.0/gcc/d/dmd/root/filename.c 2021-06-01 01:53:04.716474774 -06= 00 > +++ devel-9.4.0/gcc/d/dmd/root/filename.c 2022-05-15 15:02:49.995441507 -= 0600 > @@ -475,53 +475,7 @@ const char *FileName::safeSearchPath(Strings *path, = const char *name) >=20 > return FileName::searchPath(path, name, false); > #elif POSIX > - /* Even with realpath(), we must check for // and disallow it > - */ > - for (const char *p =3D name; *p; p++) > - { > - char c =3D *p; > - if (c =3D=3D '/' && p[1] =3D=3D '/') > - { > - return NULL; > - } > - } I'd keep this check in, otherwise removing/replacing only the `if (path)` branch looks OK to me. Iain.