Morpheouss wrote:Code: Select all
# MAKE.CONF made by Morpheouss!
# 19/11/2006
# Architecture specific
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -mtune=athlon64 -O2 -s -pipe -fomit-frame-pointer -mfpmath=sse,387 -msse -msse2 -msse3 -mmmx -m3dnow -ffast-math -ftracer -finline-limit=1200 -fno-ident -fforce-addr -fpeel-loops -fprefetch-loop-arrays -funroll-loops -funswitch-loops -ftree-vectorize -fprefetch-loop-arrays -frerun-cse-after-loop -momit-leaf-frame-pointer -maccumulate-outgoing-args -mno-align-stringops -minline-all-stringops -DNDEBUG -DG_DISABLE_ASSERT -DNO_DEBUG"
CXXFLAGS="${CFLAGS} -fpermissive -fno-enforce-eh-specs -fvisibility-inlines-hidden"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--as-needed -Wl,--hash-style=both -Wl,--as-needed -Bdirect -s"
PORTAGE_STRIP_FLAGS="--strip-all --discard-all -R .comment -R .note -R .note.ABI-tag"
# Locale Settings
LINGUAS="en pl"
LANG="en_US"
LC_ALL="en_US"
# Mirrors
GENTOO_MIRRORS="ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://gentoo.zie.pg.gda.pl http://gentoo.po.opole.pl http://gentoo.prz.rzeszow.pl ftp://mirror.icis.pcz.pl/gentoo/ ftp://gentoo.po.opole.pl"
# Portage Specific Settings
ACCEPT_KEYWORDS="amd64 ~amd64"
ALSA_CARDS="emu10k1"
AUTOCLEAN="yes"
CCACHE_DIR="/var/tmp/ccache"
CCACHE_SIZE="2G"
CLEAN_DELAY="0"
CONFIG_PROTECT="/etc"
DISTDIR="/usr/portage/distfiles"
EMERGE_WARNING_DELAY="5"
FEATURES="autoconfig digest distlocks nodoc parallel-fetch sandbox sfperms -metadata-transfer"
INPUT_DEVICES="mouse keyboard"
MAKEOPTS="-j2 -s"
PORT_LOGDIR=/var/log/portage
PORTAGE_TMPDIR=/var/tmp
PORTDIR_OVERLAY="/usr/local/portage-morph /usr/local/portage-xgl"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
VIDEO_CARDS="nv nvidia"
# USE Flags
USE="3dnow 3dnowext aac alsa avi bitmap-fonts cairo cdr cdrom cups divx4linux dvd dvdr dvdread flash gif glitz gtk2 hal jpeg jpeg2k kde kdeenablefinal mmx mmxext mp3 mpeg nptl nptlonly nvidia ogg oggvorbis opengl pic png qt qt3 speedup sse sse2 sse3 tga tiff truetype type1-fonts udev usb userlocales v4l vorbis wmf X xml2 xv xvid -arts -fortran -gdbm -gnome -gpm -ipv6 -motif -ncurses -nls -oss -perl -python -samba -slang -spell -unicode -xmms"
There are some big flaws in your make.conf.
Code: Select all
# Architecture specific
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -mtune=athlon64 -O2 -s -pipe -fomit-frame-pointer -mfpmath=sse,387 -msse -msse2 -msse3 -mmmx -m3dnow -ffast-math -ftracer -finline-limit=1200 -fno-ident -fforce-addr -fpeel-loops -fprefetch-loop-arrays -funroll-loops -funswitch-loops -ftree-vectorize -fprefetch-loop-arrays -frerun-cse-after-loop -momit-leaf-frame-pointer -maccumulate-outgoing-args -mno-align-stringops -minline-all-stringops -DNDEBUG -DG_DISABLE_ASSERT -DNO_DEBUG"
CXXFLAGS="${CFLAGS} -fpermissive -fno-enforce-eh-specs -fvisibility-inlines-hidden"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--as-needed -Wl,--hash-style=both -Wl,--as-needed -Bdirect -s"
Code: Select all
Redundant flags:
CFLAGS: -mtune=athlon64, -s, -msse -msse2 -msse3 -mmmx -m3dnow, -momit-leaf-frame-pointer
CXXFLAGS: -fvisibility-inlines-hidden, -fpermissive
LDFLAGS: --enable-new-dtags, --hash-style=both, -Bdirect, -s
When you use -march you do not want to use -mtune as well. Gentoo by default strips. You -march defines -msse -msse2 -mmmx -m3dnow. When you use -momit-leaf-frame-pointer in conjunction with -fomit-frame-pointer, -fomit-frame-pointer is ignored and only -momit-leaf-frame-pointer is used, and if you use only -fomit-frame-pointer, then the leaf-frame-pointer is omitted as well (I believe). -fvisibility-lines-hidden is already enabled in the ebuilds for the apps that can benefit from it. -fpermissive is ridiculous to use, because it downgrades diagnostics so that you can compile bad code. --enable-new-dtags is enabled by Gentoo by default, you just won't see it in the compile. --hash-style=both will not work in conjunction with -Bdirect, one of these two flags is being ignored.
Code: Select all
Flags that will slow you down:
CFLAGS: -mfpmath=sse,387, -fpeel-loops, -fprefetch-loop-arrays, -funroll-loops, -funswitch-loops, -frerun-cse-after-loop
CXXFLAGS:
LDFLAGS:
-mfpmath=sse,387 will only slow you down. All of the rest will bloat your binaries to the point of sluggishness. Whenever your binaries are larger, they use up more RAM, more CPU cache, and also cause more cache misses. Cache misses increase latency. So imagine if you will, you created a binary that uses more resources and cause cache misses, so you not only have extra overhead, but also increased latencies!
Code: Select all
Flags with stability problems:
CFLAGS: -ffast-math, -ftree-vectorize
CXXFLAGS: -fno-enforce-eh-specs
LDFLAGS:
-ffast-math is known to break just about everything, and normally whenever it can benefit a program, Gentoo Devs use it in the ebuild. -ftree-vectorize is known to cause stability issues with gtk programs and zlib. -fno-enforce-eh-specs decreases size, but also make applications not work the way they are supposed to, for instance when a program should have crashed, it just keeps running.
Code: Select all
My recommendations:
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer -fno-ident"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,now -Wl,--hash-style=gnu"
And in many situations -Os might be better than -O2.