It is possible to build those parts of JVM that Sun optimizes with -O3 as -O2 -march=arhlon-xp. I've tested this. This needs a simple patch or sed/awk script for more elegant solution. Reproducible: Always Steps to Reproduce:
Created attachment 28580 [details, diff] Patch to build JVM with -O2 -march=athlon-xp I've tested this patch, also tested JVM build with it. Simply works (for me). Please consider writting some kind of script to allow at least -march setting for this ebuild. The most interesting option would be -Os of course ;-)
Why not do it with sed: cp hotspot/build/linux/makefiles/gcc.make hotspot/build/linux/makefiles/gcc.make.orig sed "s#-O3#$CFLAGS#" hotspot/build/linux/makefiles/gcc.make.orig > hotspot/build/linux/makefiles/gcc.make
The package is very fragile as it is.