From owner-freebsd-current@FreeBSD.ORG Thu Aug 26 14:50:03 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB0A916A4CF; Thu, 26 Aug 2004 14:50:03 +0000 (GMT) Received: from web.portaone.com (mail.russia.cz [195.70.151.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id CAA6B43D53; Thu, 26 Aug 2004 14:50:02 +0000 (GMT) (envelope-from sobomax@portaone.com) Received: from [192.168.0.20] (portacare.portaone.com [195.140.247.242]) (authenticated bits=0) by web.portaone.com (8.12.8p2/8.12.8) with ESMTP id i7QEnv5T030529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Aug 2004 16:50:00 +0200 (CEST) (envelope-from sobomax@portaone.com) Message-ID: <412DF886.4030107@portaone.com> Date: Thu, 26 Aug 2004 17:49:42 +0300 From: Maxim Sobolev Organization: Porta Software Ltd User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: kan@FreeBSD.org Content-Type: multipart/mixed; boundary="------------080704020600050803040405" cc: current@FreeBSD.org cc: iedowse@FreeBSD.org Subject: [patch] bug in cpp's #ident handling in gcc 3.4 [Was: ccache with buildworld] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 14:50:03 -0000 This is a multi-part message in MIME format. --------------080704020600050803040405 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi there, I was looking into the problem with building world using ccache. It was failing with the following error message: /usr/src/lib/libc/rpc/key_call.c:33:10: extra tokens at end of #ident directive Further investigation revealed that pre-processor puts argument of #ident directive into additional quotes (""). That is, after pre-processor #ident "foo" becomes #ident ""foo"", so that compiler considers that in this example ident itself is empty string and foo"" is "extra tokens". Following script illustrates problem: -bash-2.05b$ echo '#ident "foo bar"' > /tmp/foo.c -bash-2.05b$ cc -E /tmp/foo.c # 1 "/tmp/foo.c" # 1 "" # 1 "" # 1 "/tmp/foo.c" #ident ""foo bar"" -bash-2.05b$ This problem doesn't hit when compilation is made without ccache, since in this case (for performance reasons probably) no intermediate pre-processed output is emitted. Attached please find small patch which fixes the problem for me. With it, I was able to do buildworld using ccache. It would be nice to get it committed before 5.3 is out. Regards, Maxim --------------080704020600050803040405 Content-Type: text/plain; name="cpp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cpp.diff" --- src/contrib/gcc/c-ppoutput.c 2004/08/26 14:10:04 1.1 +++ src/contrib/gcc/c-ppoutput.c 2004/08/26 14:10:32 @@ -292,7 +292,7 @@ const cpp_string *str) { maybe_print_line (print.map, line); - fprintf (print.outf, "#ident \"%s\"\n", str->text); + fprintf (print.outf, "#ident %s\n", str->text); print.line++; } --------------080704020600050803040405--