Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Feb 2007 14:14:04 +0100 (CET)
From:      Christian Baer <>
Subject:   Compiler Flags for SPARC64
Message-ID:  <erc7qs$qra$>

Next in thread | Raw E-Mail | Index | Archive | Help
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

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

Has anyone got any ideas on how to go on with this?


Want to link to this message? Use this URL: <$qra$11>