summaryrefslogtreecommitdiff
path: root/sys-devel/gcc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-05-03 17:26:08 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-05-03 17:26:08 +0100
commit3cf27339901a7ca15df33f6ea134daa93888d5d0 (patch)
treed0f451df94a8ce90e3e81be8816e5f3ed8e62138 /sys-devel/gcc
parentf6a034d922bf54efeaa781fcb5388b325b90d945 (diff)
gentoo auto-resync : 03:05:2023 - 17:26:08
Diffstat (limited to 'sys-devel/gcc')
-rw-r--r--sys-devel/gcc/Manifest2
-rw-r--r--sys-devel/gcc/files/gcc-13-PR109703-unreachable.patch54
-rw-r--r--sys-devel/gcc/gcc-13.1.1_p20230429-r1.ebuild63
3 files changed, 119 insertions, 0 deletions
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
index 35a7ca41836f..c44c64036f6b 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,3 +1,4 @@
+AUX gcc-13-PR109703-unreachable.patch 2316 BLAKE2B f7ffc76f5fd78076855e57b08d2a727b7d555d3b53fc93c63cae1034e5bdc9dc2bc9a867e291d0905e550dfb11403e0c723bc0f2461b0180cb39b3fa1d332a1e SHA512 f3087b536353388ca98ef6d73d3acca1adcb87eea21f27d035c755a1c15ac0fb78fb60fd3283d3d7b60cfadfd6d97cf1c04085ea992135d2e6a4a84b0b5084da
AUX gcc-13-fix-cross-fixincludes.patch 792 BLAKE2B f16dcfee5760380931642520bf7ae939a22131183dec4f9515cabeabaa2eafbc339d4f8bdc0605bda45d840876cb8720264c4612d99510b4d7a2e4132db2403e SHA512 d65061e07c5f3089a9d39edafed94c39082dbb254cfebb386fa2fce5374e54e3e1e15a84f0de96adbe1c5ebfc33a5dad10ecbd3db851f852ec1a7521b8940fc5
AUX gcc-configure-LANG.patch 2052 BLAKE2B 28c36f4992e41305ee421dade5eaaac34e3bdc523665b03f360f2bc01e8f69e9dc48052edb80dece63ab561e80325b4f125502482eb16f7324f1c03670021550 SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129
AUX gcc-configure-texinfo.patch 341 BLAKE2B d2ea3b2ea08f5d3a498ba27d0fb95e325097e2104e55caa28b66515cb48662649140d90b639369aedc54b2b1178fa4b49cda442f5f504e09d88a2efa45a5057c SHA512 e8d34c5077409df5495cf0c5fbf5e77f841c5698108fa6a5fde33eb28202c685603bdefd8368918e55f30c4b995e895d71d64c715c1ec2b017e09eb2c54c09ff
@@ -32,6 +33,7 @@ EBUILD gcc-12.2.1_p20230428-r1.ebuild 1475 BLAKE2B 69112653719b589bd72fe454b963d
EBUILD gcc-12.2.1_p20230502.ebuild 1596 BLAKE2B b9e543580375513a19b2dfdc1a320cd1e367584f6d8c27cd082130b7918acba0e85f3d5c1eaf8a56504d864570f5e61f3d175d65ee788677cfc542ddf0cdcec5 SHA512 295a9c2c8744c7fe4261ff5151b746c1fc4b642b0e4d81e4284e2966c4f78a8ee523f26d26b4a4c7740fc58f82c858c2ebff27cfa3a5c37933836838ecb9792c
EBUILD gcc-12.3.9999.ebuild 1593 BLAKE2B 8246fe30de8cf3d515b1c5c23eea470de257aecc452fcce47e72497b310c62893c39275db02245a12a258b06c4ddd695a8346c9b539efca2a8e1d64aab0a8955 SHA512 a0fa5d4f5e6d1545e13d33b6fa45709f7dc5fccf026d060eef26752d7000c21b913276609abb6b174b2d04e08de3c61f8c4b126acbb196c767a8886ab7999ebb
EBUILD gcc-13.1.0-r1.ebuild 1664 BLAKE2B b6fd223eeee8e6b0b02a5d5eb33437b1ba036bdf09a13aaab95318682f83d8dd1a184eb6afd8bef2c34013bfd8d0f38a108f3db0d6fbfd565f29d363cba98d3f SHA512 7e8eb3791678e456bf2c7717a4b8c95322efcde8dc3030f035cb9577fbc416a2c8b567e588036f94bffa2dd83bd00ee98a797d50d65388a3fc022819e4ab2c2e
+EBUILD gcc-13.1.1_p20230429-r1.ebuild 1725 BLAKE2B 622cdbd78b7911e7d65a55ab2c307f8112a95d822b05da74f090468d37dd1f8b68de52622a002f7692c9c4e756a0ba3e8ee42c6c5e60744404c18436526d07b6 SHA512 d0c5f9a9280ad891faa7a81833608ab8b5b3de507d2e4386c760496757b10d38db1acb36edad45f6bf0feb472a6503d7fbbbe82e9620e9ce6d7a6e35ce0ab78f
EBUILD gcc-13.1.1_p20230429.ebuild 1667 BLAKE2B 203742b6419ff78eb94d042fe075de7fda493727cca3d7d7e6dacef9164c933a38499679a1f475be9280253a69d8b6956e1bea6b49d2759551467d1e3edcf912 SHA512 d311743bde448733bf1eebf8b155f0910eb2498b495b263d42dc40938acfb4663bee6db0d4e093679ef96fb0de9671a5398ab7858ec1ab08d4005f02a25c2995
EBUILD gcc-13.2.9999.ebuild 1593 BLAKE2B 6ada03c3a63cbdb90a06954f02809b1f7aec31130c010981554ef8df4db41d79d856ee514694b9f900983e7649cc94929e3050764ff6fef5a8227701710d423a SHA512 89b624dc6f8a1187f3d36f9988409c27e1e2133889a1135be0ecaa3aaa7c381f780cc20aa8095be9bc31c4e16b96128ba50dc17431305bf3f334025956a95746
EBUILD gcc-14.0.0.9999.ebuild 1591 BLAKE2B 8a463d1b3d812a22a29a4aec27504bc138a69939b328f6fecf4eecaa90aa51acdb2e53fdf5ca5d69c5159019c354ad9ecaff218181f06fbbd9a0da43fc70c962 SHA512 67e09c08daf026d9c61f8feeafcd595c37103c04879641f6d79ef7ceeb0d44d84dd81bc340e77d031c8675a4ac858ea5a555fe0dc76fcce57991361b2d09c1b5
diff --git a/sys-devel/gcc/files/gcc-13-PR109703-unreachable.patch b/sys-devel/gcc/files/gcc-13-PR109703-unreachable.patch
new file mode 100644
index 000000000000..f7c7c9f60a70
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-13-PR109703-unreachable.patch
@@ -0,0 +1,54 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109703
+
+From d50f2599d7b23bdba05a9102645d082ed9bcb05f Mon Sep 17 00:00:00 2001
+From: Kefu Chai <kefu.chai@scylladb.com>
+Date: Mon, 1 May 2023 21:24:26 +0100
+Subject: [PATCH] libstdc++: Set _M_string_length before calling _M_dispose()
+ [PR109703]
+
+This always sets _M_string_length in the constructor for ranges of input
+iterators, such as stream iterators.
+
+We copy from the source range to the local buffer, and then repeatedly
+reallocate a larger one if necessary. When disposing the old buffer,
+_M_is_local() is used to tell if the buffer is the local one or not (and
+so must be deallocated). In addition to comparing the buffer address
+with the local buffer, _M_is_local() has an optimization hint so that
+the compiler knows that for a string using the local buffer, there is an
+invariant that _M_string_length <= _S_local_capacity (added for PR109299
+via r13-6915-gbf78b43873b0b7). But we failed to set _M_string_length in
+the constructor taking a pair of iterators, so the invariant might not
+hold, and __builtin_unreachable() is reached. This causes UBsan errors,
+and potentially misoptimization.
+
+To ensure the invariant holds, _M_string_length is initialized to zero
+before doing anything else, so that _M_is_local() doesn't see an
+uninitialized value.
+
+This issue only surfaces when constructing a string with a range of
+input iterator, and the uninitialized _M_string_length happens to be
+greater than _S_local_capacity, i.e., 15 for the std::string
+specialization.
+
+libstdc++-v3/ChangeLog:
+
+ PR libstdc++/109703
+ * include/bits/basic_string.h (basic_string(Iter, Iter, Alloc)):
+ Initialize _M_string_length.
+
+Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
+Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
+(cherry picked from commit cbf6c7a1d16490a1e63e9a5ce00e9a5c44c4c2f2)
+--- a/libstdc++-v3/include/bits/basic_string.h
++++ b/libstdc++-v3/include/bits/basic_string.h
+@@ -760,7 +760,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
+ _GLIBCXX20_CONSTEXPR
+ basic_string(_InputIterator __beg, _InputIterator __end,
+ const _Alloc& __a = _Alloc())
+- : _M_dataplus(_M_local_data(), __a)
++ : _M_dataplus(_M_local_data(), __a), _M_string_length(0)
+ {
+ #if __cplusplus >= 201103L
+ _M_construct(__beg, __end, std::__iterator_category(__beg));
+--
+2.31.1
diff --git a/sys-devel/gcc/gcc-13.1.1_p20230429-r1.ebuild b/sys-devel/gcc/gcc-13.1.1_p20230429-r1.ebuild
new file mode 100644
index 000000000000..9aa2b8645de1
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.1.1_p20230429-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_VER="2"
+PATCH_GCC_VER="13.2.0"
+MUSL_VER="1"
+MUSL_GCC_VER="13.2.0"
+
+if [[ $(ver_cut 3) == 9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ else
+ MY_PV_2=$(($(ver_cut 2) - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.$(($(ver_cut 3) - 9998))
+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
+
+# Needs to be after inherit (for now?), bug #830908
+EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+
+# Don't keyword live ebuilds
+#if ! tc_is_live && [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+# KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~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}"
+ BDEPEND=">=${CATEGORY}/binutils-2.30[cet(-)?]"
+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 "${FILESDIR}"/${PN}-13-PR109703-unreachable.patch
+ eapply_user
+}