Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTO configuration and workarounds touchup and two new workarounds (take two) #464

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sys-config/ltoize/files/make.conf.lto
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ source make.conf.lto.defines

#Thanks to issue #49, no action necessary for preventing stripping of static libraries

CFLAGS="-O3 ${GRAPHITE} ${DEVIRTLTO} ${IPAPTA} ${SEMINTERPOS} ${FLTO} -fuse-linker-plugin"
CFLAGS="-O3 ${GRAPHITE} ${DEVIRTLTO} ${IPAPTA} ${SEMINTERPOS} ${LTO}"
4 changes: 3 additions & 1 deletion sys-config/ltoize/files/make.conf.lto.defines
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

#FLTO is of the form -flto[=n] where n is the number of threads to use during linking.
#It's usually a good idea to set this to the number of hardware threads in your system
FLTO="-flto=${NTHREADS}"

LTO="-flto=${NTHREADS} -fuse-linker-plugin"
FLTO="${LTO}"

#GRAPHITE contains Graphite specific optimizations and other optimizations that are disabled at O3
#but don't influence the compiler's judgement.
Expand Down
229 changes: 117 additions & 112 deletions sys-config/ltoize/files/package.cflags/ltoworkarounds.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ games-emulation/mupen64plus-libretro *FLAGS-=-flto*
net-p2p/cpuminer-opt *FLAGS-=-flto*
x11-drivers/xf86-video-intel *FLAGS-=-flto*
<app-text/mupdf-1.12.0 *FLAGS-=-flto* # Only older versions are affected
dev-scheme/racket *FLAGS-=-flto* *FLAGS-="${IPAPTA}" # Undefined references and multiple segfaults / violations during build.
dev-scheme/racket *FLAGS-=-flto* *FLAGS-="-fipa-pta" # Undefined references and multiple segfaults / violations during build.
sys-libs/libsepol *FLAGS-=-flto*
sys-libs/libselinux *FLAGS-=-flto*
sys-libs/libsemanage *FLAGS-=-flto*
Expand All @@ -61,7 +61,7 @@ dev-libs/weston *FLAGS-=-flto*
>=dev-lang/php-7.2.0 *FLAGS-=-flto* # lto-wrapper link failure / https://github.com/InBetweenNames/gentooLTO/issues/135
sys-fs/fuse *FLAGS-=-flto* # Issue #139 and #142, it appears the symbol __fuse_read_cmd goes missing if LTO is enabled, causing linking problems on some systems. Using gold seems to help.
sys-fs/fuse-common *FLAGS-=-flto*
sys-libs/glibc *FLAGS-=-flto* #Alternative: *FLAGS+=-ffat-lto-objects *FLAGS-="${IPAPTA}" Fails in configure stage with LTO enabled, checking for builtin redirect. With -ffat-lto-objects, and no -fipa-pta, we get further, but get multiple definition errors Forcing past that yields undefined symbol errors.
sys-libs/glibc *FLAGS-=-flto* #Alternative: *FLAGS+=-ffat-lto-objects *FLAGS-="-fipa-pta" Fails in configure stage with LTO enabled, checking for builtin redirect. With -ffat-lto-objects, and no -fipa-pta, we get further, but get multiple definition errors Forcing past that yields undefined symbol errors.
app-emulation/wine* *FLAGS-=-flto*
sys-process/criu *FLAGS-=-pipe* *FLAGS-=-flto* *FLAGS-="-fuse-linker-plugin" LDFLAGS-="-Wl,--hash-style=gnu" *FLAGS-="${GRAPHITE}" # Fewer settings may be possible. Needs testing. (Dependency of LXC.)
media-video/ffmpeg *FLAGS-=-flto* #NOTE: Depending on your CPUFLAGS this may work with LTO. The SSE intrinsics seem to cause problems in some cases. Only x86 requires workaround
Expand Down Expand Up @@ -196,19 +196,19 @@ dev-libs/openssl LTO_ENABLE_FLAGOMATIC=yes
#>=sys-devel/gcc-9 *FLAGS-=-flto* BOOT_CFLAGS='"${CFLAGS}"'

# BEGIN: -fipa-pta workarounds
www-client/firefox *FLAGS-="${IPAPTA}" #ICE on -fipa-pta
www-client/torbrowser *FLAGS-="${IPAPTA}" #ICE on -fipa-pta
=sys-apps/gawk-4.1.4 *FLAGS-="${IPAPTA}" # during IPA pass: pta lto1: internal compiler error: Segmentation fault
dev-qt/qtwebkit *FLAGS-="${IPAPTA}"
dev-lang/R *FLAGS-="${IPAPTA}" # during IPA pass: pta lto1: internal compiler error: Segmentation fault
sys-devel/gcc *FLAGS-="${IPAPTA}"
dev-lang/gnat-gpl *FLAGS-="${IPAPTA}"
dev-lang/php *FLAGS-="${IPAPTA}" # Segfaults when compiled with -fipa-pta
dev-lisp/sbcl *FLAGS-="${IPAPTA}" #ICE on -fipa-pta
x11-wm/bspwm *FLAGS-="${IPAPTA}" # needed for version 0.9.7 on 17.0 profile running the testing branch everywhere with GCC 8.3.0
media-libs/libwebp *FLAGS-="${IPAPTA}" # no compilation issues, but -fipa-pta causes webp images to be displayed incorrectly
dev-qt/qtgui *FLAGS-="${IPAPTA}" # Same problem as above
dev-db/mongodb *FLAGS-="${IPAPTA}" # ICE with -fipa-pta
www-client/firefox *FLAGS-="-fipa-pta" #ICE on -fipa-pta
www-client/torbrowser *FLAGS-="-fipa-pta" #ICE on -fipa-pta
=sys-apps/gawk-4.1.4 *FLAGS-="-fipa-pta" # during IPA pass: pta lto1: internal compiler error: Segmentation fault
dev-qt/qtwebkit *FLAGS-="-fipa-pta"
dev-lang/R *FLAGS-="-fipa-pta" # during IPA pass: pta lto1: internal compiler error: Segmentation fault
sys-devel/gcc *FLAGS-="-fipa-pta"
dev-lang/gnat-gpl *FLAGS-="-fipa-pta"
dev-lang/php *FLAGS-="-fipa-pta" # Segfaults when compiled with -fipa-pta
dev-lisp/sbcl *FLAGS-="-fipa-pta" #ICE on -fipa-pta
x11-wm/bspwm *FLAGS-="-fipa-pta" # needed for version 0.9.7 on 17.0 profile running the testing branch everywhere with GCC 8.3.0
media-libs/libwebp *FLAGS-="-fipa-pta" # no compilation issues, but -fipa-pta causes webp images to be displayed incorrectly
dev-qt/qtgui *FLAGS-="-fipa-pta" # Same problem as above
dev-db/mongodb *FLAGS-="-fipa-pta" # ICE with -fipa-pta
# END: -fipa-pta workarounds

# BEGIN: TLS dialect workarounds
Expand All @@ -225,11 +225,12 @@ sys-boot/systemd-boot *FLAGS-="-mtls-dialect=gnu2"
# END: TLS dialect workarounds

# BEGIN: Semantic Interposition workarounds
app-misc/tracker *FLAGS-="${SEMINTERPOS}" # builds but makes gnome-base/nautilus deadlock
net-fs/autofs *FLAGS-="${SEMINTERPOS}" # builds but segfault in lookup_file.so
net-print/cups *FLAGS-="${SEMINTERPOS}" # ICE
sys-devel/llvm *FLAGS-="${SEMINTERPOS}"
sys-libs/glibc *FLAGS-="${SEMINTERPOS}"
app-misc/tracker *FLAGS-="-fno-semantic-interposition" # builds but makes gnome-base/nautilus deadlock
net-fs/autofs *FLAGS-="-fno-semantic-interposition" # builds but segfault in lookup_file.so
net-print/cups *FLAGS-="-fno-semantic-interposition" # ICE
sys-devel/llvm *FLAGS-="-fno-semantic-interposition"
sys-libs/glibc *FLAGS-="-fno-semantic-interposition"
app-office/libreoffice *FLAGS-="-fno-semantic-interposition" #382
# END: Semantic Interposition Workarounds

# BEGIN: No PLT workarounds
Expand All @@ -254,99 +255,103 @@ net-misc/curl *FLAGS+="-fuse-ld=bfd"
>=sys-libs/libcap-2.28 *FLAGS+="-fuse-ld=bfd" # Issue #453
# END: GOLD linker workarounds

# BEGIN: GNU linker workarounds
<=media-gfx/blender-2.79b-r1 *FLAGS-="-fuse-ld=bfd" *FLAGS+="-fuse-ld=gold" #381
# END: GNU linker workarounds

# BEGIN: -fno-common workarounds
app-accessibility/at-spi2-atk *FLAGS-="${NOCOMMON}"
app-admin/logrotate *FLAGS-="${NOCOMMON}"
app-admin/syslog-ng *FLAGS-="${NOCOMMON}"
app-arch/cpio *FLAGS-="${NOCOMMON}"
app-arch/file-roller *FLAGS-="${NOCOMMON}"
app-crypt/gnupg *FLAGS-="${NOCOMMON}"
app-crypt/p11-kit *FLAGS-="${NOCOMMON}"
app-crypt/staticgpg *FLAGS-="${NOCOMMON}"
app-editors/neovim *FLAGS-="${NOCOMMON}"
app-text/mupdf *FLAGS-="${NOCOMMON}"
app-text/texlive-core *FLAGS-="${NOCOMMON}"
app-text/ttf2pk2 *FLAGS-="${NOCOMMON}"
dev-db/redis *FLAGS-="${NOCOMMON}"
dev-java/icedtea *FLAGS-="${NOCOMMON}"
dev-lang/R *FLAGS-="${NOCOMMON}"
dev-lang/erlang *FLAGS-="${NOCOMMON}"
dev-lang/orc *FLAGS-="${NOCOMMON}"
dev-libs/bemenu *FLAGS-="${NOCOMMON}"
dev-libs/dbus-glib *FLAGS-="${NOCOMMON}"
dev-libs/ffcall *FLAGS-="${NOCOMMON}"
dev-libs/fribidi *FLAGS-="${NOCOMMON}"
dev-libs/gobject-introspection *FLAGS-="${NOCOMMON}"
dev-libs/libltdl *FLAGS-="${NOCOMMON}" # builds but causes symbol lookup errors
dev-libs/libmspack *FLAGS-="${NOCOMMON}"
dev-libs/libpipeline *FLAGS-="${NOCOMMON}"
dev-libs/libx86emu *FLAGS-="${NOCOMMON}"
dev-python/dbus-python *FLAGS-="${NOCOMMON}"
dev-python/nautilus-python *FLAGS-="${NOCOMMON}"
dev-util/android-tools *FLAGS-="${NOCOMMON}"
dev-util/pkgconf *FLAGS-="${NOCOMMON}"
gnome-base/gnome-control-center *FLAGS-="${NOCOMMON}"
gnome-base/librsvg *FLAGS-="${NOCOMMON}"
gui-apps/wl-clipboard *FLAGS-="${NOCOMMON}"
gui-libs/wlroots *FLAGS-="${NOCOMMON}"
gui-wm/sway *FLAGS-="${NOCOMMON}"
media-gfx/imagemagick *FLAGS-="${NOCOMMON}"
media-libs/freeglut *FLAGS-="${NOCOMMON}"
media-libs/gegl *FLAGS-="${NOCOMMON}"
media-libs/glu *FLAGS-="${NOCOMMON}"
media-libs/gstreamer *FLAGS-="${NOCOMMON}"
media-libs/libv4l *FLAGS-="${NOCOMMON}"
media-libs/mesa *FLAGS-="${NOCOMMON}"
media-libs/openal *FLAGS-="${NOCOMMON}"
media-sound/mpg123 *FLAGS-="${NOCOMMON}"
media-sound/musepack-tools *FLAGS-="${NOCOMMON}"
media-sound/sox *FLAGS-="${NOCOMMON}"
media-sound/wavpack *FLAGS-="${NOCOMMON}"
net-analyzer/iftop *FLAGS-="${NOCOMMON}"
net-analyzer/openvas-manager *FLAGS-="${NOCOMMON}"
net-fs/nfs-utils *FLAGS-="${NOCOMMON}"
net-libs/libmbim *FLAGS-="${NOCOMMON}"
net-libs/libqmi *FLAGS-="${NOCOMMON}"
net-libs/libtirpc *FLAGS-="${NOCOMMON}"
net-misc/curl *FLAGS-="${NOCOMMON}"
net-misc/dhcp *FLAGS-="${NOCOMMON}"
net-misc/iputils *FLAGS-="${NOCOMMON}"
net-misc/modemmanager *FLAGS-="${NOCOMMON}"
net-misc/networkmanager *FLAGS-="${NOCOMMON}"
net-misc/ntpsec *FLAGS-="${NOCOMMON}"
net-misc/socat *FLAGS-="${NOCOMMON}"
net-misc/vinagre *FLAGS-="${NOCOMMON}"
net-print/cups-filters *FLAGS-="${NOCOMMON}"
sys-apps/dtc *FLAGS-="${NOCOMMON}"
sys-apps/iproute2 *FLAGS-="${NOCOMMON}"
sys-apps/kbd *FLAGS-="${NOCOMMON}"
sys-apps/memtester *FLAGS-="${NOCOMMON}"
sys-apps/the_silver_searcher *FLAGS-="${NOCOMMON}"
sys-apps/usbredir *FLAGS-="${NOCOMMON}"
sys-boot/syslinux *FLAGS-="${NOCOMMON}"
sys-devel/bmake *FLAGS-="${NOCOMMON}"
sys-devel/distcc *FLAGS-="${NOCOMMON}"
sys-fs/squashfs-tools *FLAGS-="${NOCOMMON}"
>=sys-fs/xfsprogs-5.2.0 *FLAGS-="${NOCOMMON}"
sys-libs/gdbm *FLAGS-="${NOCOMMON}"
sys-libs/gpm *FLAGS-="${NOCOMMON}"
sys-libs/libunwind *FLAGS-="${NOCOMMON}"
sys-power/cpupower *FLAGS-="${NOCOMMON}"
sys-power/iasl *FLAGS-="${NOCOMMON}"
sys-power/upower *FLAGS-="${NOCOMMON}"
sys-process/audit *FLAGS-="${NOCOMMON}"
sys-process/htop *FLAGS-="${NOCOMMON}"
x11-base/xorg-server *FLAGS-="${NOCOMMON}"
x11-drivers/xf86-video-amdgpu *FLAGS-="${NOCOMMON}"
x11-drivers/xf86-video-ati *FLAGS-="${NOCOMMON}"
x11-drivers/xf86-video-intel *FLAGS-="${NOCOMMON}"
<x11-libs/gtk+-3 *FLAGS-="${NOCOMMON}"
x11-libs/libva-intel-driver *FLAGS-="${NOCOMMON}"
x11-libs/pango *FLAGS-="${NOCOMMON}"
x11-libs/xcb-util-cursor *FLAGS-="${NOCOMMON}"
x11-libs/xcb-util-xrm *FLAGS-="${NOCOMMON}"
x11-terms/kitty *FLAGS-="${NOCOMMON}"
x11-wm/i3 *FLAGS-="${NOCOMMON}"
app-accessibility/at-spi2-atk *FLAGS-="-fno-common"
app-admin/logrotate *FLAGS-="-fno-common"
app-admin/syslog-ng *FLAGS-="-fno-common"
app-arch/cpio *FLAGS-="-fno-common"
app-arch/file-roller *FLAGS-="-fno-common"
app-crypt/gnupg *FLAGS-="-fno-common"
app-crypt/p11-kit *FLAGS-="-fno-common"
app-crypt/staticgpg *FLAGS-="-fno-common"
app-editors/neovim *FLAGS-="-fno-common"
app-text/mupdf *FLAGS-="-fno-common"
app-text/texlive-core *FLAGS-="-fno-common"
app-text/ttf2pk2 *FLAGS-="-fno-common"
dev-db/redis *FLAGS-="-fno-common"
dev-java/icedtea *FLAGS-="-fno-common"
dev-lang/R *FLAGS-="-fno-common"
dev-lang/erlang *FLAGS-="-fno-common"
dev-lang/orc *FLAGS-="-fno-common"
dev-libs/bemenu *FLAGS-="-fno-common"
dev-libs/dbus-glib *FLAGS-="-fno-common"
dev-libs/ffcall *FLAGS-="-fno-common"
dev-libs/fribidi *FLAGS-="-fno-common"
dev-libs/gobject-introspection *FLAGS-="-fno-common"
dev-libs/libltdl *FLAGS-="-fno-common" # builds but causes symbol lookup errors
dev-libs/libmspack *FLAGS-="-fno-common"
dev-libs/libpipeline *FLAGS-="-fno-common"
dev-libs/libx86emu *FLAGS-="-fno-common"
dev-python/dbus-python *FLAGS-="-fno-common"
dev-python/nautilus-python *FLAGS-="-fno-common"
dev-util/android-tools *FLAGS-="-fno-common"
dev-util/pkgconf *FLAGS-="-fno-common"
gnome-base/gnome-control-center *FLAGS-="-fno-common"
gnome-base/librsvg *FLAGS-="-fno-common"
gui-apps/wl-clipboard *FLAGS-="-fno-common"
gui-libs/wlroots *FLAGS-="-fno-common"
gui-wm/sway *FLAGS-="-fno-common"
media-gfx/imagemagick *FLAGS-="-fno-common"
media-libs/freeglut *FLAGS-="-fno-common"
media-libs/gegl *FLAGS-="-fno-common"
media-libs/glu *FLAGS-="-fno-common"
media-libs/gstreamer *FLAGS-="-fno-common"
media-libs/libv4l *FLAGS-="-fno-common"
media-libs/mesa *FLAGS-="-fno-common"
media-libs/openal *FLAGS-="-fno-common"
media-sound/mpg123 *FLAGS-="-fno-common"
media-sound/musepack-tools *FLAGS-="-fno-common"
media-sound/sox *FLAGS-="-fno-common"
media-sound/wavpack *FLAGS-="-fno-common"
net-analyzer/iftop *FLAGS-="-fno-common"
net-analyzer/openvas-manager *FLAGS-="-fno-common"
net-fs/nfs-utils *FLAGS-="-fno-common"
net-libs/libmbim *FLAGS-="-fno-common"
net-libs/libqmi *FLAGS-="-fno-common"
net-libs/libtirpc *FLAGS-="-fno-common"
net-misc/curl *FLAGS-="-fno-common"
net-misc/dhcp *FLAGS-="-fno-common"
net-misc/iputils *FLAGS-="-fno-common"
net-misc/modemmanager *FLAGS-="-fno-common"
net-misc/networkmanager *FLAGS-="-fno-common"
net-misc/ntpsec *FLAGS-="-fno-common"
net-misc/socat *FLAGS-="-fno-common"
net-misc/vinagre *FLAGS-="-fno-common"
net-print/cups-filters *FLAGS-="-fno-common"
sys-apps/dtc *FLAGS-="-fno-common"
sys-apps/iproute2 *FLAGS-="-fno-common"
sys-apps/kbd *FLAGS-="-fno-common"
sys-apps/memtester *FLAGS-="-fno-common"
sys-apps/the_silver_searcher *FLAGS-="-fno-common"
sys-apps/usbredir *FLAGS-="-fno-common"
sys-boot/syslinux *FLAGS-="-fno-common"
sys-devel/bmake *FLAGS-="-fno-common"
sys-devel/distcc *FLAGS-="-fno-common"
sys-fs/squashfs-tools *FLAGS-="-fno-common"
>=sys-fs/xfsprogs-5.2.0 *FLAGS-="-fno-common"
sys-libs/gdbm *FLAGS-="-fno-common"
sys-libs/gpm *FLAGS-="-fno-common"
sys-libs/libunwind *FLAGS-="-fno-common"
sys-power/cpupower *FLAGS-="-fno-common"
sys-power/iasl *FLAGS-="-fno-common"
sys-power/upower *FLAGS-="-fno-common"
sys-process/audit *FLAGS-="-fno-common"
sys-process/htop *FLAGS-="-fno-common"
x11-base/xorg-server *FLAGS-="-fno-common"
x11-drivers/xf86-video-amdgpu *FLAGS-="-fno-common"
x11-drivers/xf86-video-ati *FLAGS-="-fno-common"
x11-drivers/xf86-video-intel *FLAGS-="-fno-common"
<x11-libs/gtk+-3 *FLAGS-="-fno-common"
x11-libs/libva-intel-driver *FLAGS-="-fno-common"
x11-libs/pango *FLAGS-="-fno-common"
x11-libs/xcb-util-cursor *FLAGS-="-fno-common"
x11-libs/xcb-util-xrm *FLAGS-="-fno-common"
x11-terms/kitty *FLAGS-="-fno-common"
x11-wm/i3 *FLAGS-="-fno-common"
# END: -fno-common workarounds

#sys-devel/prelink EGIT_BRANCH="master_staging"