Subject: EV56 and optimization flags
To: None <port-alpha@netbsd.org>
From: Jaap Boender <jaapb@kerguelen.org>
List: port-alpha
Date: 12/29/2005 11:22:34
Hello,

On my Alphaserver 800 5/333 (with a 21164A-2 processor, according to the dmesg),
I've tried compiling NetBSD, both 2.1 and 3.0, with some optimization flags.
Here's my /etc/mk.conf:

KERNEL_CPUFLAGS=-mcpu=ev56
KERNEL_CFLAGS=-Os -pipe

PKGSRC_CPUFLAGS=-mcpu=ev56
PKGSRC_CFLAGS=-O2 -pipe

.ifdef BSD_PKG_MK
COPTS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
CFLAGS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
CXXFLAGS+=${PKGSRC_CFLAGS} ${PKGSRC_CPUFLAGS}
.else
COPTS+=${KERNEL_CFLAGS}
CPUFLAGS+=${KERNEL_CPUFLAGS}
.endif

This, for the most part, works well, only g++ and groff give problems. All
programs (even a simple Hello World) compiled with g++ segfault.
A characteristic backtrace can be seen in bug pkg/32352. In the same way, groff
segfaults with some manpages (the one for spamd from the spamassassin package,
for example).

The 'canonical' 2.1 binaries don't show any problems.

So, what I wanted to ask: is this a known problem with either g++, NetBSD, the
EV56 or anything else? If nothing worked, I'd think the compiler flags weren't
right for my machine, but it's only g++ and groff (and then only in some cases),
everything else works fine.

Thanks,

   Jaap Boender