summaryrefslogtreecommitdiff
path: root/sys-devel/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/gcc')
-rw-r--r--sys-devel/gcc/Manifest4
-rw-r--r--sys-devel/gcc/files/gcc-13-fix-cross-fixincludes.patch22
-rw-r--r--sys-devel/gcc/files/gcc-15.0.0_pre20240623-PR115602.patch120
-rw-r--r--sys-devel/gcc/files/gcc-configure-texinfo.patch16
-rw-r--r--sys-devel/gcc/gcc-13.2.1_p20240210-r5.ebuild66
5 files changed, 228 insertions, 0 deletions
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
new file mode 100644
index 00000000..bfa85b05
--- /dev/null
+++ b/sys-devel/gcc/Manifest
@@ -0,0 +1,4 @@
+DIST gcc-13-20240210.tar.xz 84354416 BLAKE2B 5807623d3f7dd751b6dfe164cfd50d57b2f93485c23c3c2228a4a846a9a94cdad52a5e6f2806e5e7ee2a7b5526386ebdb339c44c7ea023d69f8652088a1b114d SHA512 14a01ced7ac2bfd9fc93de4e3819b4d0823fbe129d3f1faabeb707e9e3e2613b4173321b58b3648a7250e3b7ff5d94edfee60e6c38682f31a1f7b57b1c01433f
+DIST gcc-13.2.0-musl-patches-2.tar.xz 5292 BLAKE2B c057d6574d03c05854edaa9f3fd40e9149662b04f3ac7a7db3eb078d73a7b535726d1bf52e5b12736dedb2f9898ad731f2e48a6421fcfbf7b90f929dee072fcb SHA512 a691da0c87c443a5e9d23731f4005f27871c5b12bc9102873ffa24d374aa7b9fbd187c4f5635d23fa9ffb17e351e76173c2d3fdf40646e355c4cb314b538de69
+DIST gcc-13.2.0-patches-14.tar.xz 46928 BLAKE2B fce23bc5315f35b04a4976550c4b44578944a1b17e40c7553351eeb8a1ef0f3a2538da5a5e1ae6f37b784ff11bbd8a44b8f6eec542be63e34d984dee69e1cd81 SHA512 d7d52bb2915fd89c06b0134bede8db939cadbb1f2dcddf923bee2c3f9f577ff9e5e986b60420d892539edf82867a0d1bd635807814bc618b06a2b37cdaca893a
+DIST gcc-validate-failures-a447cd6dee206facb66720bdacf0c765a8b09f33.py 27537 BLAKE2B 96c7474de0bc50ab890a91551412398c979396c43aa237a4b6d8baa98ce7fda2cc9f5a755a03fd9d055d885ee2fb40ba29644a0649c24398361ce75a20fae634 SHA512 409434953351cf1f2287f1e4a4fbde5b28a27add35ddd284080acec71b33cb4ec5e1c07f41a79fac060bd6f1eedd198812495141923e410ded907429fe515f83
diff --git a/sys-devel/gcc/files/gcc-13-fix-cross-fixincludes.patch b/sys-devel/gcc/files/gcc-13-fix-cross-fixincludes.patch
new file mode 100644
index 00000000..e0e5a3ab
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-13-fix-cross-fixincludes.patch
@@ -0,0 +1,22 @@
+Revert of https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=59e4c98173a79fcaa2c33253261409f38856c384
+for now to fix cross fixincludes builds.
+
+https://gcc.gnu.org/PR115416
+https://bugs.gentoo.org/905118
+https://bugs.gentoo.org/925204
+https://bugs.gentoo.org/926059
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -532,11 +532,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
+ # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
+ NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
+ # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
+-ifeq (@includedir@,$(prefix)/include)
+- CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+-else
+- CROSS_SYSTEM_HEADER_DIR = @includedir@
+-endif
++CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+
+ # autoconf sets SYSTEM_HEADER_DIR to one of the above.
+ # Purge it of unnecessary internal relative paths
diff --git a/sys-devel/gcc/files/gcc-15.0.0_pre20240623-PR115602.patch b/sys-devel/gcc/files/gcc-15.0.0_pre20240623-PR115602.patch
new file mode 100644
index 00000000..d78c6d96
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-15.0.0_pre20240623-PR115602.patch
@@ -0,0 +1,120 @@
+https://gcc.gnu.org/PR115602
+https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=c43c74f6ec795a586388de7abfdd20a0040f6f16
+
+From c43c74f6ec795a586388de7abfdd20a0040f6f16 Mon Sep 17 00:00:00 2001
+From: Richard Biener <rguenther@suse.de>
+Date: Mon, 24 Jun 2024 09:52:39 +0200
+Subject: [PATCH] tree-optimization/115602 - SLP CSE results in cycles
+
+The following prevents SLP CSE to create new cycles which happened
+because of a 1:1 permute node being present where its child was then
+CSEd to the permute node. Fixed by making a node only available to
+CSE to after recursing.
+
+ PR tree-optimization/115602
+ * tree-vect-slp.cc (vect_cse_slp_nodes): Delay populating the
+ bst-map to avoid cycles.
+
+ * gcc.dg/vect/pr115602.c: New testcase.
+---
+ gcc/testsuite/gcc.dg/vect/pr115602.c | 27 +++++++++++++++++++++++
+ gcc/tree-vect-slp.cc | 33 ++++++++++++++++++----------
+ 2 files changed, 48 insertions(+), 12 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/vect/pr115602.c
+
+diff --git a/gcc/testsuite/gcc.dg/vect/pr115602.c b/gcc/testsuite/gcc.dg/vect/pr115602.c
+new file mode 100644
+index 00000000000..9a208d1d950
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/vect/pr115602.c
+@@ -0,0 +1,27 @@
++/* { dg-do compile } */
++
++typedef struct {
++ double x, y;
++} pointf;
++struct {
++ pointf focus;
++ double zoom;
++ pointf devscale;
++ char button;
++ pointf oldpointer;
++} gvevent_motion_job;
++char gvevent_motion_job_4;
++double gvevent_motion_pointer_1, gvevent_motion_pointer_0;
++void gvevent_motion() {
++ double dx = (gvevent_motion_pointer_0 - gvevent_motion_job.oldpointer.x) /
++ gvevent_motion_job.devscale.x,
++ dy = (gvevent_motion_pointer_1 - gvevent_motion_job.oldpointer.y) /
++ gvevent_motion_job.devscale.y;
++ if (dx && dy < .0001)
++ return;
++ switch (gvevent_motion_job_4)
++ case 2: {
++ gvevent_motion_job.focus.x -= dy / gvevent_motion_job.zoom;
++ gvevent_motion_job.focus.y += dx / gvevent_motion_job.zoom;
++ }
++}
+diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
+index e84aeabef94..b47b7e8c979 100644
+--- a/gcc/tree-vect-slp.cc
++++ b/gcc/tree-vect-slp.cc
+@@ -6079,35 +6079,44 @@ vect_optimize_slp_pass::run ()
+ static void
+ vect_cse_slp_nodes (scalar_stmts_to_slp_tree_map_t *bst_map, slp_tree& node)
+ {
++ bool put_p = false;
+ if (SLP_TREE_DEF_TYPE (node) == vect_internal_def
+ /* Besides some VEC_PERM_EXPR, two-operator nodes also
+ lack scalar stmts and thus CSE doesn't work via bst_map. Ideally
+ we'd have sth that works for all internal and external nodes. */
+ && !SLP_TREE_SCALAR_STMTS (node).is_empty ())
+ {
+- if (slp_tree *leader = bst_map->get (SLP_TREE_SCALAR_STMTS (node)))
++ slp_tree *leader = bst_map->get (SLP_TREE_SCALAR_STMTS (node));
++ if (leader)
+ {
+- if (*leader != node)
+- {
+- if (dump_enabled_p ())
+- dump_printf_loc (MSG_NOTE, vect_location,
+- "re-using SLP tree %p for %p\n",
+- (void *)*leader, (void *)node);
+- vect_free_slp_tree (node);
+- (*leader)->refcnt += 1;
+- node = *leader;
+- }
++ /* We've visited this node already. */
++ if (!*leader || *leader == node)
++ return;
++
++ if (dump_enabled_p ())
++ dump_printf_loc (MSG_NOTE, vect_location,
++ "re-using SLP tree %p for %p\n",
++ (void *)*leader, (void *)node);
++ vect_free_slp_tree (node);
++ (*leader)->refcnt += 1;
++ node = *leader;
+ return;
+ }
+
+- bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), node);
++ /* Avoid creating a cycle by populating the map only after recursion. */
++ bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), nullptr);
+ node->refcnt += 1;
++ put_p = true;
+ /* And recurse. */
+ }
+
+ for (slp_tree &child : SLP_TREE_CHILDREN (node))
+ if (child)
+ vect_cse_slp_nodes (bst_map, child);
++
++ /* Now record the node for CSE in other siblings. */
++ if (put_p)
++ bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), node);
+ }
+
+ /* Optimize the SLP graph of VINFO. */
+--
+2.43.0
diff --git a/sys-devel/gcc/files/gcc-configure-texinfo.patch b/sys-devel/gcc/files/gcc-configure-texinfo.patch
new file mode 100644
index 00000000..99e90998
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-configure-texinfo.patch
@@ -0,0 +1,16 @@
+Chances are quite good that the installed makeinfo is sufficient.
+So ignore false positives where the makeinfo installed is so new
+that it violates the cheesy version grep.
+
+http://bugs.gentoo.org/198182
+
+--- a/configure
++++ b/configure
+@@ -3573,6 +3573,6 @@
+ :
+ else
+- MAKEINFO="$MISSING makeinfo"
++ :
+ fi
+ ;;
+
diff --git a/sys-devel/gcc/gcc-13.2.1_p20240210-r5.ebuild b/sys-devel/gcc/gcc-13.2.1_p20240210-r5.ebuild
new file mode 100644
index 00000000..ddcc19f0
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.2.1_p20240210-r5.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+TOOLCHAIN_HAS_TESTS=1
+PATCH_GCC_VER="13.2.0"
+PATCH_VER="14"
+MUSL_VER="2"
+MUSL_GCC_VER="13.2.0"
+PYTHON_COMPAT=( python3_{10..12} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}