[Asterisk-Dev] Sparc Ultra Support

Jolan Luff jolan at protection.cx
Thu Sep 23 18:31:29 MST 2004


On Thu, Sep 23, 2004 at 04:34:40PM -0700, dking at pimpsoft.com wrote:
> The current version of Asterisk DOES support compilation on
> ultrasparc cpu based systems thanks to work done on the asterisk code
> branch pre 1.0 by Myself. It does not however compile to 64bit by
> default due to limitations of the compiler used in many sun4u
> specific linux distribution ports.  Currently I have it set to
> compile for version 8 of the instruction set. Since version 9 is the
> 64 bit version sun4u cpus are able to work with over time this will
> be changed but for now this is a good work around of the problem
> considering several things including the core asterisk application
> refused to compile on these systems before I did the work on it.

It compiles on OpenBSD/sparc64 as a 64-bit binary.  The only
stumbling block I had was the ultrasparc stuff you had added
everywhere.  -mtune isn't recognized by the OpenBSD/sparc64 gcc3
config.  I just commented it out and it compiles fine.

$ file asterisk
asterisk: ELF 64-bit MSB executable, Sparc64, version 1, for
OpenBSD, dynamically linked (uses shared libs), not stripped

$ gcc -v
Reading specs from /usr/lib/gcc-lib/sparc64-unknown-openbsd3.6/3.3.2/specs
Configured with: 
Thread model: single
gcc version 3.3.2 (propolice)

> Help with support of your favorite non i386 compatible hardware.
> Something as simple as adding the needed makefile info will help
> many.

Ugh.  The problem is that there's all sorts of ridiculous
"optimizations" everywhere.  -march -mtune is not supported
everywhere that gcc is available.  So this leads to stuff like this:

ifneq (${OSARCH},Darwin)
ifneq (${PROC},x86_64)
ifneq (${PROC},ultrasparc)
ifneq ($(shell uname -m),ppc)
ifneq ($(shell uname -m),alpha)
OPTIMIZE+=-march=$(PROC)
endif
endif
endif
endif
endif

It's clear that people have no idea what they're doing and are just
blindly adding gcc flags that they found from some unrealiable site
on the web that says it will give them a huge performance boost.
There are cases of -O4 and -O6 optimization levels in the Asterisk
Makefiles.  These don't even do anything.  -O3 is the highest
optimization level.  I have never seen a large *reliable*
performance boost from mucking w/all these platform specific
optimizations.  In fact, by removing -mtune -march, -O3, -O4, -O6,
etc. I have compiled Asterisk on:

OpenBSD/i386    (gcc2)
OpenBSD/alpha   (gcc2) (64-bit)
OpenBSD/amd64   (gcc3) (64-bit)
OpenBSD/hppa    (gcc3)
OpenBSD/macppc  (gcc2)
OpenBSD/sparc   (gcc2)
OpenBSD/sparc64 (gcc3) (64-bit)

I've only run-time tested amd64 & i386 and no surprise there, it
works.  However, since various platforms above require strict memory
alignment, are big endian, have unsigned chars, etc. there is a lot of
potential for non-obvious platform issues.  Then there's OS
portability issues too which I won't delve into...



More information about the asterisk-dev mailing list