From nobody@FreeBSD.org  Sun Feb 25 01:54:53 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id C888D16A403
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Feb 2007 01:54:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id BA5D713C467
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Feb 2007 01:54:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l1P1sr1W021444
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 25 Feb 2007 01:54:53 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l1P1srAJ021443;
	Sun, 25 Feb 2007 01:54:53 GMT
	(envelope-from nobody)
Message-Id: <200702250154.l1P1srAJ021443@www.freebsd.org>
Date: Sun, 25 Feb 2007 01:54:53 GMT
From: Steven Hillis<evultrole@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mcpu flags break buildworld in Sparc64 line
X-Send-Pr-Version: www-3.0

>Number:         109510
>Category:       gnu
>Synopsis:       [patch] gcc(1): mcpu flags break buildworld in Sparc64 line
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    marius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 25 02:00:12 GMT 2007
>Closed-Date:    Sun Mar 09 14:21:12 UTC 2008
>Last-Modified:  Sun Mar 09 14:21:12 UTC 2008
>Originator:     Steven Hillis
>Release:        6.2
>Organization:
>Environment:
FreeBSD popp.tops 6.2-RELEASE-p1 FreeBSD 6.2-RELEASE-p1 #0: Sat Feb 24 14:15:14 PST 2007     steven@popp.tops:/usr/src/sys/sparc64/compile/MYKERN  sparc64

>Description:
Setting -mcpu=ultrasparc or -mcpu=v9 in /etc/make.conf causes "unknown
architecture" errors on world or kernel builds.

Setting the flags overwrites the CPU_SPEC that's normally set to __sparc64__.
>How-To-Repeat:
Add -mcpu=ultrasparc to you CFLAGS= configuration in /etc/make.conf, then
try to compile world or any kernel.
>Fix:
Apply the attached patch which adds the following to
/usr/src/contrib/gcc/config/sparc/freebsd.h:

builtin_define ("__sparc64__");
builtin_define ("__sparc_v9__");
builtin_define ("__sparcv9");
builtin_define ("__arch64__");


Patch attached with submission follows:

*** contrib/gcc/config/sparc/freebsd.h	Tue Jul 27 22:00:13 2004
--- contrib/gcc/config/sparc/temp/freebsd.h	Sat Feb 24 16:56:33 2007
***************
*** 34,44 ****
  #undef  FBSD_TARGET_CPU_CPP_BUILTINS
  #define FBSD_TARGET_CPU_CPP_BUILTINS()		\
    do						\
      {						\
        builtin_define ("__LP64__");		\
!     }						\
    while (0)
  
  #define LINK_SPEC "%(link_arch)						\
    %{!mno-relax:%{!r:-relax}}						\
    %{p:%nconsider using `-pg' instead of `-p' with gprof(1)}				\
--- 34,48 ----
  #undef  FBSD_TARGET_CPU_CPP_BUILTINS
  #define FBSD_TARGET_CPU_CPP_BUILTINS()		\
    do						\
      {						\
        builtin_define ("__LP64__");		\
!       builtin_define ("__sparc64__");               \
!       builtin_define ("__sparc_v9__");              \
!       builtin_define ("__sparcv9");                 \
!       builtin_define ("__arch64__");          \
!      }						\
    while (0)
  
  #define LINK_SPEC "%(link_arch)						\
    %{!mno-relax:%{!r:-relax}}						\
    %{p:%nconsider using `-pg' instead of `-p' with gprof(1)}				\

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-sparc64->kan 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Apr 22 09:53:13 UTC 2007 
Responsible-Changed-Why:  
kan, can you take a look at this?  If not, assign back to gnu@.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109510 
Responsible-Changed-From-To: kan->obrien 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Tue Nov 20 15:33:48 UTC 2007 
Responsible-Changed-Why:  
maybe I can get this submittable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109510 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: gnu/109510: commit references a PR
Date: Sun,  9 Dec 2007 17:41:55 +0000 (UTC)

 marius      2007-12-09 17:41:47 UTC
 
   FreeBSD src repository
 
   Modified files:
     contrib/gcc/config/sparc freebsd.h 
   Log:
   Allow the targeted CPU type to be set via -mcpu instead of
   limiting to the hardcoded equivalent of -mcpu=ultrasparc.
   
   PR:             109510
   MFC after:      3 months
   
   Revision  Changes    Path
   1.11      +8 -6      src/contrib/gcc/config/sparc/freebsd.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Sun Jan 27 09:29:32 UTC 2008 
State-Changed-Why:  
Over to committer of the patch, as an MFC reminder. 


Responsible-Changed-From-To: obrien->marius 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jan 27 09:29:32 UTC 2008 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=109510 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: gnu/109510: commit references a PR
Date: Sat,  8 Mar 2008 19:33:43 +0000 (UTC)

 marius      2008-03-08 19:33:35 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     contrib/gcc/config/sparc freebsd.h 
   Log:
   MFC: 1.11
   
   Allow the targeted CPU type to be set via -mcpu instead of
   limiting to the hardcoded equivalent of -mcpu=ultrasparc.
   
   PR:             109510
   
   Revision  Changes    Path
   1.10.2.1  +8 -6      src/contrib/gcc/config/sparc/freebsd.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: gnu/109510: commit references a PR
Date: Sun,  9 Mar 2008 14:10:31 +0000 (UTC)

 marius      2008-03-09 14:10:23 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     contrib/gcc/config/sparc freebsd.h 
   Log:
   MFC: 1.11
   
   Allow the targeted CPU type to be set via -mcpu instead of
   limiting to the hardcoded equivalent of -mcpu=ultrasparc.
   
   PR:             109510
   
   Revision  Changes    Path
   1.9.8.1   +8 -6      src/contrib/gcc/config/sparc/freebsd.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: marius 
State-Changed-When: Sun Mar 9 14:20:36 UTC 2008 
State-Changed-Why:  
close 

http://www.freebsd.org/cgi/query-pr.cgi?pr=109510 
>Unformatted:
