Graphite/LTO/OpenMP optimizations added.
Note: You can add -flto=n to CFLAGS/CXXFLAGS/LDFLAGS where n = number of CPUs.
This commit is contained in:
parent
91bce354f8
commit
b4a001406f
|
@ -2,6 +2,15 @@ CFLAGS="-O2 -pipe -march=native"
|
|||
CXXFLAGS="${CFLAGS}"
|
||||
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
|
||||
|
||||
#### LTO/Graphite/OpenMP ####
|
||||
TMP_GRAPHITE="-floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block"
|
||||
TMP_COMMON_CLDFLAGS="-flto=4 ${TMP_GRAPHITE} -ftree-vectorize -fopenmp -floop-parallelize-all"
|
||||
CFLAGS="${CFLAGS} ${TMP_COMMON_CLDFLAGS}"
|
||||
CXXFLAGS="${CFLAGS}"
|
||||
LDFLAGS="${LDFLAGS} ${TMP_COMMON_CLDFLAGS}"
|
||||
USE="${USE} graphite"
|
||||
#############################
|
||||
|
||||
CHOST="x86_64-pc-linux-gnu"
|
||||
CBUILD="x86_64-pc-linux-gnu"
|
||||
MAKEOPTS="-j2"
|
||||
|
|
|
@ -64,7 +64,9 @@ dev-java/jinput ~amd64
|
|||
<dev-games/irrlicht-1.9 ~amd64
|
||||
dev-lang/spidermonkey ~amd64
|
||||
dev-lang/vala ~amd64
|
||||
dev-libs/cloog ~amd64
|
||||
dev-libs/gnulib ~x64-freebsd
|
||||
dev-libs/isl ~amd64
|
||||
dev-libs/jthread ~amd64
|
||||
dev-libs/libpipeline ~amd64
|
||||
dev-libs/libgee ~amd64
|
||||
|
@ -231,7 +233,7 @@ sys-cluster/nova ~amd64
|
|||
sys-cluster/quantum ~amd64
|
||||
sys-devel/clang ~amd64
|
||||
sys-devel/crossdev ~amd64
|
||||
<sys-devel/gcc-4.8 ~amd64
|
||||
<sys-devel/gcc-4.9 ~amd64
|
||||
sys-devel/llvm ~amd64
|
||||
sys-devel/prelink ~amd64
|
||||
sys-firmware/amd-ucode ~amd64
|
||||
|
|
|
@ -107,6 +107,7 @@ sys-apps/util-linux static-libs tty-helpers
|
|||
sys-boot/grub device-mapper
|
||||
sys-block/gparted fat ntfs
|
||||
sys-block/parted device-mapper
|
||||
sys-devel/gcc graphite lto
|
||||
sys-devel/llvm clang
|
||||
sys-fs/aufs3 kernel-patch ramfs
|
||||
sys-fs/lvm2 static-libs
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
# no-lto
|
||||
if [[ ${CATEGORY}/${PN} = sys-apps/sandbox ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/sysvinit ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-lang/perl ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/gawk ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/coreutils ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-libs/elfutils ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/shadow ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-lang/python]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-libs/glib ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-fs/e2fsprogs ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = net-misc/openssh ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/hdparm ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/hwinfo ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/alsa-lib ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-util/valgrind ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-fs/mtools ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-libs/boost ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = app-text/rarian ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = net-analyzer/nmap ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/pciutils ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-devel/distcc ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/libcdr ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/libvisio ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-devel/llvm ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = app-admin/sudo ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = x11-base/xorg-server ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-power/upower ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-qt/qtdeclarative ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/mesa ]] \
|
||||
|| [[ ${CATEGORY}/${PN}/${PV} = dev-lang/spidermonkey-1.8.5 ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = games-action/minetest ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = app-emulation/wine ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = app-emulation/virtualbox ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-video/ffmpeg ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = x11-libs/wxGTK ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = www-client/firefox ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = mail-client/thunderbird ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-tex/luatex ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-python/notify-python ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-plugins/audacious-plugins ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-video/avidemux ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-video/mplayer2 ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/avidemux-plugins ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = net-p2p/eiskaltdcpp ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-qt/qtwebkit ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = net-libs/webkit-gtk ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/avidemux-core ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-libs/libaio ]] \ # Required by Qemu
|
||||
|| [[ ${CATEGORY}/${PN} = dev-games/simgear ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-qt/qtgui ]] \
|
||||
; then
|
||||
CFLAGS="${CFLAGS} -fno-lto -fno-use-linker-plugin"
|
||||
CXXFLAGS="${CXXFLAGS} -fno-lto -fno-use-linker-plugin"
|
||||
LDFLAGS="${LDFLAGS} -fno-lto -fno-use-linker-plugin"
|
||||
fi
|
||||
|
||||
# No parallelize-loops-all
|
||||
if [[ ${CATEGORY}/${PN} = dev-lang/perl ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/gawk ]] \ # Internal error when emerging hyphen
|
||||
|| [[ ${CATEGORY}/${PN} = app-shells/bash ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/groff ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/libogg ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-libs/openssl ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-libs/ncurses ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-libs/expat ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-video/dirac ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-games/openscenegraph ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-vcs/subversion ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-video/ffmpeg ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-video/mjpegtools ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/gegl ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-gfx/graphviz ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-sound/audacious ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = app-text/texlive-core ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-video/mplayer2 ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-video/vlc ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/avidemux-core ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = games-fps/nexuiz ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = sys-apps/dbus ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-qt/qtgui ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-gfx/inkscape ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-libs/glib ]] \ # epiphany hangs (GObject)
|
||||
|| [[ ${CATEGORY}/${PN} = www-client/firefox ]] \
|
||||
; then
|
||||
CFLAGS="${CFLAGS} -fno-loop-parallelize-all"
|
||||
CXXFLAGS="${CXXFLAGS} -fno-loop-parallelize-all"
|
||||
LDFLAGS="${LDFLAGS} -fno-loop-parallelize-all"
|
||||
fi
|
||||
|
||||
# No OpenMP
|
||||
if [[ ${CATEGORY}/${PN} = sys-apps/busybox ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = media-libs/mesa ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = app-emulation/wine ]] \
|
||||
|| [[ ${CATEGORY}/${PN} = dev-db/sqlite ]] \ # Required to emerge avidemux-core
|
||||
; then
|
||||
CFLAGS="${CFLAGS} -fno-openmp"
|
||||
CXXFLAGS="${CFLAGS} -fno-openmp"
|
||||
LDFLAGS="${LDFLAGS} -fno-openmp"
|
||||
fi
|
||||
|
||||
# no-graphite
|
||||
if [[ ${CATEGORY}/${PN} = undefined/undefined ]] \
|
||||
; then
|
||||
CFLAGS="${CFLAGS} -fno-loop-interchange -fno-tree-loop-distribution -fno-loop-strip-mine -fno-loop-block"
|
||||
CXXFLAGS="${CXXFLAGS} -fno-loop-interchange -fno-tree-loop-distribution -fno-loop-strip-mine -fno-loop-block"
|
||||
LDFLAGS="${LDFLAGS} -fno-loop-interchange -fno-tree-loop-distribution -fno-loop-strip-mine -fno-loop-block"
|
||||
fi
|
Loading…
Reference in New Issue