From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29057 invoked by alias); 4 Aug 2007 21:20:07 -0000 Received: (qmail 28902 invoked by uid 22791); 4 Aug 2007 21:20:05 -0000 X-Spam-Check-By: sourceware.org Received: from iona.labri.fr (HELO iona.labri.fr) (147.210.8.143) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 04 Aug 2007 21:20:03 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by iona.labri.fr (Postfix) with ESMTP id A6DC290079; Sat, 4 Aug 2007 23:19:09 +0200 (CEST) Received: from iona.labri.fr ([127.0.0.1]) by localhost (iona.labri.fr [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JTEkrhRvh47z; Sat, 4 Aug 2007 23:19:07 +0200 (CEST) Received: from interface.famille.thibault.fr (d83-179-96-93.cust.tele2.fr [83.179.96.93]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by iona.labri.fr (Postfix) with ESMTP id 9311D90078; Sat, 4 Aug 2007 23:19:07 +0200 (CEST) Received: from samy by interface.famille.thibault.fr with local (Exim 4.67) (envelope-from ) id 1IHR2U-0002JS-30; Sat, 04 Aug 2007 23:19:58 +0200 Date: Sat, 04 Aug 2007 21:20:00 -0000 From: Samuel Thibault To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] drop MAXPATHLEN dependency from gcc/tlink.c Message-ID: <20070804211958.GI3638@interface.famille.thibault.fr> References: <20070724203941.GE3700@interface.famille.thibault.fr> <20070801210310.GC3667@interface.famille.thibault.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6Nae48J/T25AfBN4" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20070801210310.GC3667@interface.famille.thibault.fr> User-Agent: Mutt/1.5.12-2006-07-14 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-08/txt/msg00251.txt.bz2 --6Nae48J/T25AfBN4 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-length: 577 Samuel Thibault, le Wed 01 Aug 2007 23:03:10 +0200, a écrit : > Ian Lance Taylor, le Tue 31 Jul 2007 18:38:24 -0700, a écrit : > > Samuel Thibault writes: > > > Some systems don't define MAXPATHLEN because they don't have such hard > > > limit. Here is a patch against gcc/tlink.c to take benefit of this. > > > > > > (tlink_init): Add loop to dynamically allocate initial_cwd as needed. > > > > Just call getpwd instead. > > Oh right, I didn't notice that non-standard function. Here is an > updated patch Could someone apply it? Samuel --6Nae48J/T25AfBN4 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=patch-gcc-tlink Content-Transfer-Encoding: 8bit Content-length: 901 2007-08-01 Samuel Thibault * gcc/tlink.c: Include "libiberty.h" (initial_cwd): Change type into char*. (tlink_init): Call getpwd() instead of getcwd(). Index: gcc/tlink.c =================================================================== --- gcc/tlink.c (r�vision 127116) +++ gcc/tlink.c (copie de travail) @@ -30,6 +30,7 @@ #include "hashtab.h" #include "demangle.h" #include "collect2.h" +#include "libiberty.h" #define MAX_ITERATIONS 17 @@ -38,7 +39,7 @@ static int tlink_verbose; -static char initial_cwd[MAXPATHLEN + 1]; +static char *initial_cwd; /* Hash table boilerplate for working with htab_t. We have hash tables for symbol names, file names, and demangled symbols. */ @@ -274,7 +275,7 @@ tlink_verbose = 3; } - getcwd (initial_cwd, sizeof (initial_cwd)); + initial_cwd = getpwd (); } static int --6Nae48J/T25AfBN4--