Skip to content

Commit

Permalink
Move to GCC 10
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Peelar <[email protected]>
  • Loading branch information
InBetweenNames committed Jul 20, 2020
1 parent fba0754 commit 764ab67
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 106 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ LDFLAGS="${LDFLAGS} -Wl,--your-modifications=here"

Previously we set `-Wl,--hash-style=gnu` in `LDFLAGS`, but this is not necessary anymore as it is the Gentoo default except on MIPS, where it's not supported, and could cause issues in some cases. See issue #362 for details.

It is strongly recommended to use the latest GCC (9.3.0 at the time of writing), the latest binutils (2.34 currently), and the latest glibc (2.30 currently). Other compilers and C libraries may be supported in the future.
It is strongly recommended to use the latest GCC (10.1.0 at the time of writing), the latest binutils (2.34 currently), and the latest glibc (2.31 currently). Other compilers and C libraries may be supported in the future.

When you find a problem, whether it's a package not playing nice with `-O3`, Graphite, or LTO, consider opening an issue here or sending a pull request with the overrides needed to get the package working. Over time, we should be able to achieve full coverage of Gentoo's main repository this way and provide a one size fits all solution, and not to mention help improve some open source software through the bug reports that will no doubt be generated!

Expand Down
15 changes: 15 additions & 0 deletions metadata/news/2020-07-20-nocommon/2020-07-20-nocommon.en.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Title: GentooLTO is now officially on GCC 10
Author: Shane Peelar <[email protected]>
Content-Type: text/plain
Posted: 2020-07-20
Revision: 1
News-Item-Format: 1.0

Hello again everyone,

GentooLTO is now officially on GCC 10. If you're still on an older compiler and don't intend to upgrade,
make sure you enable `USE=keep-nocommon` on `sys-config/ltoize` to ensure that you still have the `-fno-common`
overrides on your system. They have been moved to a separate file called `nocommon.conf`, which is not installed
unless that `USE` is set.

-Shane
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQRQKz0hsEWJZFu2CI4PbWnCixM/0QUCXxWEYQAKCRAPbWnCixM/
0SdlAQDIDpcETLg6BMasNvbmJw7g6Q+QrVqof4CVC1r13EDOPgEAqUIg3+/AmwKC
OwKCSVYornBGQANIlmgheuW5eIXIbg8=
=kivV
-----END PGP SIGNATURE-----
3 changes: 2 additions & 1 deletion sys-config/ltoize/files/make.conf.lto.defines
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ SEMINTERPOS="-fno-semantic-interposition"
NOCOMMON="-fno-common"

# This option only affects C code. Only non-conformant C code needs -fcommon, which is enabled by default. Clear Linux leaves this flag off by default.
# We may enable this at some point. For now, there's a lot of breakages to work through.
# This is enabled by default with GCC 10 and is kept here only for documentation purposes. Use `-fcommon` to restore
# GCC 9.x behaviour and below.

SAFEST_FAST_MATH="-fno-math-errno -fno-trapping-math"
SAFER_UNSAFE_MATH_OPTS="-fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math"
Expand Down
97 changes: 0 additions & 97 deletions sys-config/ltoize/files/package.cflags/ltoworkarounds.conf
Original file line number Diff line number Diff line change
Expand Up @@ -292,103 +292,6 @@ net-misc/curl *FLAGS+="-fuse-ld=bfd"
>=sys-libs/libcap-2.28 *FLAGS+="-fuse-ld=bfd" # Issue #453
# END: GOLD 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-vpn/libreswan *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}"
media-sound/bluez-alsa *FLAGS-="${NOCOMMON}"
# END: -fno-common workarounds

# BEGIN: -fno-common libtool hack workarounds (#484)
dev-libs/ffcall NOCOMMON_OVERRIDE_LIBTOOL=yes
dev-libs/libmspack NOCOMMON_OVERRIDE_LIBTOOL=yes
Expand Down
101 changes: 101 additions & 0 deletions sys-config/ltoize/files/package.cflags/nocommon.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#These workarounds apply to GCC 9.x and below. `-fno-common` is default on GCC 10 now
#and many ebuilds have already been patched, with Gentoo upstream leading the charge.
#If you are having trouble with a package in this list, try explicitly setting it to -fcommon.
#If that works, please file an issue at the GentooLTO GitHub.

# 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-vpn/libreswan *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}"
media-sound/bluez-alsa *FLAGS-="${NOCOMMON}"
# END: -fno-common workarounds
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2020 Gentoo Foundation
# Copyright 1999-2021 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7
Expand All @@ -16,7 +16,7 @@ SRC_URI=""

LICENSE="GPL-2+"
SLOT="0"
IUSE="override-flagomatic"
IUSE="override-flagomatic keep-nocommon"

#portage-bashrc-mv can be obtained from mv overlay
DEPEND="
Expand All @@ -37,8 +37,8 @@ pkg_setup() {

ACTIVE_GCC=$(gcc-fullversion)

if ver_test "${ACTIVE_GCC}" -lt 9.2.0; then
ewarn "Warning: Active GCC version < 9.2.0, it is recommended that you use the newest GCC if you want LTO."
if ver_test "${ACTIVE_GCC}" -lt 10.1.0; then
ewarn "Warning: Active GCC version < 10.1.0, it is recommended that you use the newest GCC if you want LTO."
if [ "${I_KNOW_WHAT_I_AM_DOING}" != "y" ]; then
eerror "Aborting LTOize installation due to older GCC -- set I_KNOW_WHAT_I_AM_DOING=y if you want to override this behaviour."
die
Expand Down Expand Up @@ -74,6 +74,10 @@ pkg_preinst() {
elog "Installing ltoworkarounds.conf package.cflags overrides"
dosym "${LTO_PORTAGE_DIR}/package.cflags/ltoworkarounds.conf" "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/ltoworkarounds.conf"

#Install -fno-common workarounds file
use keep-nocommon && dosym "${LTO_PORTAGE_DIR}/package.cflags/nocommon.conf"
"${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/nocommon.conf"

#Install patch framework

elog "Installing bashrc.d hook symlink to apply LTO patches directly from lto-overlay"
Expand Down Expand Up @@ -107,7 +111,7 @@ pkg_postinst()

BINUTILS_VER=$(binutils-config ${CHOST} -c | sed -e "s/.*-//")

if ver_test "${BINUTILS_VER}" -lt 2.32; then
ewarn "Warning: active binutils version < 2.32, it is recommended that you use the newest binutils for LTO."
if ver_test "${BINUTILS_VER}" -lt 2.34; then
ewarn "Warning: active binutils version < 2.34, it is recommended that you use the newest binutils for LTO."
fi
}
3 changes: 2 additions & 1 deletion sys-config/ltoize/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<longdescription lang="en">
LTOize is a set of configuration files and overrides to make building your system Link Time Optimization easy. This is part of a bigger initiative to find errors in C and C++ programs that are caused by undefined behaviour. Users are strongly encouraged to contribute their configuration changes upstream. For more information, see the gentooLTO project on GitHub.
</longdescription>
<use><flag name="override-flagomatic">Override strip-flags and replace-flags in flag-o-matic.eclass (EXPERIMENTAL)</flag></use>
<use><flag name="override-flagomatic">Override strip-flags and replace-flags in flag-o-matic.eclass (EXPERIMENTAL)</flag>
<flag name="keep-nocommon">Keep old -fno-common overrides for older GCCs (not recommended)</flag></use>
</pkgmetadata>

0 comments on commit 764ab67

Please sign in to comment.