From owner-freebsd-questions@FreeBSD.ORG Mon Feb 19 17:45:52 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C659D16ADCA for ; Mon, 19 Feb 2007 17:45:52 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B1A8B13C441 for ; Mon, 19 Feb 2007 17:45:52 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id 9844B1A4D82; Mon, 19 Feb 2007 09:45:52 -0800 (PST) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id D9A5B515BC; Mon, 19 Feb 2007 12:45:51 -0500 (EST) Date: Mon, 19 Feb 2007 12:45:51 -0500 From: Kris Kennaway To: Christian Baer Message-ID: <20070219174550.GA27605@xor.obsecurity.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: Compiler Flags for SPARC64 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Feb 2007 17:45:52 -0000 On Mon, Feb 19, 2007 at 02:14:04PM +0100, Christian Baer wrote: > Hello everybody out there! > > Please excuse my posting this question again on this list, but the last > post on the freebsd-sparc64 didn't help much. There isn't really much > traffic on that list. > > Assuming that gcc when run on sparc64 produces v7 code (for sun4/4c) by > default, I went about trying to improve that as v7 code is known to be a > fair bit slower as v9 (sun4u) code. The improvement can be as much as > 100% for some apps like OpenSSL or OpenSSH. > > I went about trying some Compiler flags. -mcpu=ultrasparc and -mcpu=v9 > both came into mind. However this lead to several problems of programs > not compiling anymore. Most notably was the failure of 'make buildworld'. > > When gcc is told to produce v9 code, it doesn't produce 64bit code (you > have to set -m64 for that), it just uses a few additional commands the > CPU knows, which should make the resulting code faster but no longer > compatible with older CPUs (non-UltraSPARC). This means that there > shouldn't be any problem with pointers that are now "strange" to the > code. But even if I explicitly set the -m32 flag, I still can't make the > world. > > I discussed this in a German newsgroup, where someone told me that the > CPU is set to v9 by default on FreeBSD, as it only supports SPARC64 and > not SPARC32. Although this assumption makes sense, I couldn't find any > evidence to back it up. While some compiler flags are set by default > on some platforms for optimization for that particular CPU, there > doesn't seem to be anything set for sparc64. Additionaly, if the mcpu > were really set to ultrasparc or v9, then setting it again shouldn't > cause buildworld to stop with the error "I don't know what platform this > is." > > Has anyone got any ideas on how to go on with this? You'll have to look at the compiler spec and how it is bootstrapped. FWIW, I don't think there are any secret flags you can set to improve the compiler targetting, as the defaults are already appropriate. Kris