From andreas@syndrom23.de  Fri Sep  9 05:30:13 2005
Return-Path: <andreas@syndrom23.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B102716A420
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Sep 2005 05:30:13 +0000 (GMT)
	(envelope-from andreas@syndrom23.de)
Received: from vs159088.vserver.de (syndrom23.de [62.75.159.88])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1DC2343D45
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  9 Sep 2005 05:30:12 +0000 (GMT)
	(envelope-from andreas@syndrom23.de)
Received: from klamath.syndrom23.de ([212.204.44.203])
	by vs159088.vserver.de (8.12.8/8.12.8) with ESMTP id j895TrZd003521
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 9 Sep 2005 07:30:06 +0200
Message-Id: <1126243811.0@klamath.syndrom23.de>
Date: Fri, 9 Sep 2005 07:30:11 +0200
From: "Andreas Kohn" <andreas@syndrom23.de>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Subject: [PATCH] cc -print-search-dirs returns (null)
X-Send-Pr-Version: gtk-send-pr 0.4.6 
X-GNATS-Notify:

>Number:         85895
>Category:       gnu
>Synopsis:       [patch] cc -print-search-dirs returns (null)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 09 05:40:13 GMT 2005
>Closed-Date:    
>Last-Modified:  Mon Dec 29 18:06:05 UTC 2008
>Originator:     Andreas Kohn
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:


System: FreeBSD 7.0-CURRENT #20: Mon Aug 22 20:25:19 CEST 2005
    root@klamath.syndrom23.de:/usr/obj/usr/src/sys/KLAMATH



>Description:


cc -print-search-dirs should print the installation location of cc, and where support files can be found.
The lcc sources (at least the included one for Q3A) use this flag.




>How-To-Repeat:


Expected behavior:
$ cc -print-search-dirs
install: /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/
(from a linux system)

Behavior on FreeBSD:
$ cc -print-search-dirs
install: /usr/libexec/(null)



>Fix:


This patch fixes the (null). DragonflyBSD uses a similar, but longer change to remove the use of machine_suffix completely.

--- gcc-print-search-dirs-null.diff begins here ---
Index: contrib/gcc/gcc.c
===================================================================
RCS file: /storage/freebsd/cvs/src/contrib/gcc/gcc.c,v
retrieving revision 1.40
diff -u -r1.40 gcc.c
--- contrib/gcc/gcc.c	3 Jun 2005 04:02:20 -0000	1.40
+++ contrib/gcc/gcc.c	20 Aug 2005 13:02:49 -0000
@@ -6095,6 +6095,7 @@
   /* Read specs from a file if there is one.  */
 
 #ifdef FREEBSD_NATIVE
+  machine_suffix = "";
   just_machine_suffix = "";
 #else	/* FREEBSD_NATIVE */
   machine_suffix = concat (spec_machine, dir_separator_str,
--- gcc-print-search-dirs-null.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:
