# Note that the micro version is required or lots of stuff will break.
# To checkout master set gcc_LIVE_BRANCH="master" in the ebuild before
# inheriting this eclass.
- EGIT_BRANCH="${PN}-${PV%.?.?_pre9999}-branch"
+ EGIT_BRANCH="releases/${PN}-${PV%.?.?_pre9999}"
EGIT_BRANCH=${EGIT_BRANCH//./_}
inherit git-r3
fi
tc_version_is_at_least 4.2 && IUSE+=" +openmp"
tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
tc_version_is_at_least 4.7 && IUSE+=" go"
- tc_version_is_at_least 4.8 &&
- IUSE+=" +sanitize"
+ # sanitizer support appeared in gcc-4.8, but <gcc-5 does not
+ # support modern glibc.
+ tc_version_is_at_least 5 && IUSE+=" +sanitize"
# Note:
# <gcc-4.8 supported graphite, it required forked ppl
# versions which we dropped. Since graphite was also experimental in
IUSE+=" systemtap" TC_FEATURES+=(systemtap)
tc_version_is_at_least 9.0 && IUSE+=" d"
tc_version_is_at_least 9.1 && IUSE+=" lto"
+ tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=(zstd)
fi
if tc_version_is_at_least 10; then
RDEPEND+=" graphite? ( >=dev-libs/isl-0.14:0= )"
fi
-DEPEND="${RDEPEND}
+BDEPEND="
>=sys-devel/bison-1.875
>=sys-devel/flex-2.5.4
nls? ( sys-devel/gettext )
>=dev-util/dejagnu-1.4.4
>=sys-devel/autogen-5.5.4
)"
+DEPEND="${RDEPEND}"
if tc_has_feature gcj ; then
GCJ_DEPS=">=media-libs/libart_lgpl-2.1"
DEPEND+=" systemtap? ( dev-util/systemtap )"
fi
+if tc_has_feature zstd ; then
+ DEPEND+=" zstd? ( app-arch/zstd )"
+fi
+
+case ${EAPI:-0} in
+ 5*|6) DEPEND+=" ${BDEPEND}" ;;
+esac
+
PDEPEND=">=sys-devel/gcc-config-1.7"
#---->> S + SRC_URI essentials <<----
#---->> pkg_pretend <<----
-toolchain_is_unsupported() {
- [[ -n ${SNAPSHOT} ]] || tc_is_live
-}
-
toolchain_pkg_pretend() {
- if toolchain_is_unsupported &&
- [[ -z ${I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS} ]] ; then
- die "Please \`export I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1\` or define it" \
- "in your make.conf if you want to use this version."
- fi
-
if ! use_if_iuse cxx ; then
use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"'
use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"'
# Prevent new texinfo from breaking old versions (see #198182, #464008)
if tc_version_is_at_least 4.1; then
- tc_apply_patches "Remove texinfo (bug #198182, bug ##464008)" "${FILESDIR}"/gcc-configure-texinfo.patch
+ tc_apply_patches "Remove texinfo (bug #198182, bug #464008)" "${FILESDIR}"/gcc-configure-texinfo.patch
fi
# >=gcc-4
local p d="${WORKDIR}/gcc-${CYGWINPORTS_GITREV}"
# readarray -t is available since bash-4.4 only, #690686
- local patches=( $(sed -e '1,/PATCH_URI="/d;/"/,$d' < "${d}"/gcc.cygport) )
+ local patches=( $(
+ for p in $(
+ sed -e '1,/PATCH_URI="/d;/"/,$d' < "${d}"/gcc.cygport
+ ); do
+ echo "${d}/${p}"
+ done
+ ) )
tc_apply_patches "Applying cygwin port patches ..." ${patches[*]}
}
)
fi
+ if in_iuse zstd ; then
+ confgcc+=( $(use_with zstd) )
+ fi
+
# newer gcc's come with libquadmath, but only fortran uses
# it, so auto punt it when we don't care
if tc_version_is_at_least 4.6 && ! is_fortran ; then
confgcc+=( --without-{cloog,ppl} )
fi
- if tc_version_is_at_least 4.8 && in_iuse sanitize ; then
- # See Note [implicitly enabled flags]
- confgcc+=( $(usex sanitize '' --disable-libsanitizer) )
+ if tc_version_is_at_least 4.8; then
+ if in_iuse sanitize ; then
+ # See Note [implicitly enabled flags]
+ confgcc+=( $(usex sanitize '' --disable-libsanitizer) )
+ else
+ confgcc+=( --disable-libsanitizer )
+ fi
fi
if tc_version_is_at_least 6.0 && in_iuse pie ; then
}
gcc_do_filter_flags() {
+ # Be conservative here:
+ # - don't allow -O3 and like to over-optimize libgcc # 701786
+ # - don't allow -O0 to generate potentially invalid startup code
strip-flags
- replace-flags -O? -O2
+ filter-flags '-O?'
+ append-flags -O2
# dont want to funk ourselves
filter-flags '-mabi*' -m31 -m32 -m64
# handling of binpkgs, don't require these to be found
cp "${ROOT%/}${DATAPATH}"/c{89,99} "${EROOT%/}"/usr/bin/ 2>/dev/null
fi
-
- if toolchain_is_unsupported ; then
- einfo "This GCC ebuild is provided for your convenience, and the use"
- einfo "of this compiler is not supported by the Gentoo Developers."
- einfo "Please report bugs to upstream at http://gcc.gnu.org/bugzilla/"
- fi
}
toolchain_pkg_postrm() {