mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-11 15:06:58 +02:00
eclass/toolchain: Sync with Gentoo
It's from Gentoo commit e08def09c01c484bcd0f1305e88165b4418f43b3.
This commit is contained in:
parent
4ed458d3e8
commit
276dfffb52
@ -14,6 +14,8 @@
|
|||||||
if [[ -z ${_TOOLCHAIN_ECLASS} ]]; then
|
if [[ -z ${_TOOLCHAIN_ECLASS} ]]; then
|
||||||
_TOOLCHAIN_ECLASS=1
|
_TOOLCHAIN_ECLASS=1
|
||||||
|
|
||||||
|
RUST_OPTIONAL="1"
|
||||||
|
|
||||||
case ${EAPI} in
|
case ${EAPI} in
|
||||||
7|8) ;;
|
7|8) ;;
|
||||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||||
@ -22,7 +24,7 @@ esac
|
|||||||
DESCRIPTION="The GNU Compiler Collection"
|
DESCRIPTION="The GNU Compiler Collection"
|
||||||
HOMEPAGE="https://gcc.gnu.org/"
|
HOMEPAGE="https://gcc.gnu.org/"
|
||||||
|
|
||||||
inherit edo flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix
|
inherit edo flag-o-matic gnuconfig libtool multilib pax-utils rust toolchain-funcs prefix
|
||||||
|
|
||||||
[[ -n ${TOOLCHAIN_HAS_TESTS} ]] && inherit python-any-r1
|
[[ -n ${TOOLCHAIN_HAS_TESTS} ]] && inherit python-any-r1
|
||||||
|
|
||||||
@ -330,6 +332,7 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then
|
|||||||
# and https://rust-gcc.github.io/2023/04/24/gccrs-and-gcc13-release.html for why
|
# and https://rust-gcc.github.io/2023/04/24/gccrs-and-gcc13-release.html for why
|
||||||
# it was disabled in 13.
|
# it was disabled in 13.
|
||||||
tc_version_is_at_least 14.0.0_pre20230423 ${PV} && IUSE+=" rust" TC_FEATURES+=( rust )
|
tc_version_is_at_least 14.0.0_pre20230423 ${PV} && IUSE+=" rust" TC_FEATURES+=( rust )
|
||||||
|
tc_version_is_at_least 14.2.1_p20241026 ${PV} && IUSE+=" time64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if tc_version_is_at_least 10; then
|
if tc_version_is_at_least 10; then
|
||||||
@ -426,7 +429,7 @@ fi
|
|||||||
if tc_has_feature rust && tc_version_is_at_least 14.0.0_pre20230421 ; then
|
if tc_has_feature rust && tc_version_is_at_least 14.0.0_pre20230421 ; then
|
||||||
# This was added upstream in r14-9968-g3e1e73fc995844 as a temporary measure.
|
# This was added upstream in r14-9968-g3e1e73fc995844 as a temporary measure.
|
||||||
# See https://inbox.sourceware.org/gcc/34fec7ea-8762-4cac-a1c8-ff54e20e31ed@embecosm.com/
|
# See https://inbox.sourceware.org/gcc/34fec7ea-8762-4cac-a1c8-ff54e20e31ed@embecosm.com/
|
||||||
BDEPEND+=" rust? ( virtual/rust )"
|
BDEPEND+=" rust? ( ${RUST_DEPEND} )"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PDEPEND=">=sys-devel/gcc-config-2.11"
|
PDEPEND=">=sys-devel/gcc-config-2.11"
|
||||||
@ -592,6 +595,8 @@ toolchain_pkg_setup() {
|
|||||||
MAKEOPTS="--output-sync=line ${MAKEOPTS}"
|
MAKEOPTS="--output-sync=line ${MAKEOPTS}"
|
||||||
|
|
||||||
[[ -n ${TOOLCHAIN_HAS_TESTS} ]] && use test && python-any-r1_pkg_setup
|
[[ -n ${TOOLCHAIN_HAS_TESTS} ]] && use test && python-any-r1_pkg_setup
|
||||||
|
|
||||||
|
_tc_use_if_iuse rust && rust_pkg_setup
|
||||||
}
|
}
|
||||||
|
|
||||||
#---->> src_unpack <<----
|
#---->> src_unpack <<----
|
||||||
@ -1060,6 +1065,9 @@ toolchain_src_configure() {
|
|||||||
|
|
||||||
downgrade_arch_flags
|
downgrade_arch_flags
|
||||||
gcc_do_filter_flags
|
gcc_do_filter_flags
|
||||||
|
if tc_version_is_at_least 14.2.1_p20241026 ${PV}; then
|
||||||
|
append-cppflags "-D_GENTOO_TIME64_FORCE=$(usex time64 1 0)"
|
||||||
|
fi
|
||||||
|
|
||||||
if ! tc_version_is_at_least 11 && [[ $(gcc-major-version) -ge 12 ]] ; then
|
if ! tc_version_is_at_least 11 && [[ $(gcc-major-version) -ge 12 ]] ; then
|
||||||
# https://gcc.gnu.org/PR105695 (bug #849359)
|
# https://gcc.gnu.org/PR105695 (bug #849359)
|
||||||
@ -1575,7 +1583,7 @@ toolchain_src_configure() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_cet_for 'i[34567]86' 'linux' 'cet'
|
enable_cet_for 'i[34567]86' 'gnu' 'cet'
|
||||||
enable_cet_for 'x86_64' 'gnu' 'cet'
|
enable_cet_for 'x86_64' 'gnu' 'cet'
|
||||||
enable_cet_for 'aarch64' 'gnu' 'standard-branch-protection'
|
enable_cet_for 'aarch64' 'gnu' 'standard-branch-protection'
|
||||||
fi
|
fi
|
||||||
@ -1944,6 +1952,15 @@ gcc_do_filter_flags() {
|
|||||||
filter-flags -Walloc-size
|
filter-flags -Walloc-size
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ver_test -lt 15.1 ; then
|
||||||
|
filter-flags -fdiagnostics-explain-harder -fdiagnostics-details
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_d ; then
|
||||||
|
# bug #940750
|
||||||
|
filter-flags -Warray-bounds
|
||||||
|
fi
|
||||||
|
|
||||||
# Please use USE=lto instead (bug #906007).
|
# Please use USE=lto instead (bug #906007).
|
||||||
filter-lto
|
filter-lto
|
||||||
|
|
||||||
@ -2963,18 +2980,21 @@ XGCC() { get_make_var GCC_FOR_TARGET ; }
|
|||||||
|
|
||||||
has toolchain_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" toolchain_death_notice"
|
has toolchain_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" toolchain_death_notice"
|
||||||
toolchain_death_notice() {
|
toolchain_death_notice() {
|
||||||
if [[ -e "${WORKDIR}"/build ]] ; then
|
local dir
|
||||||
pushd "${WORKDIR}"/build >/dev/null
|
for dir in "${WORKDIR}"/build-jit "${WORKDIR}"/build ; do
|
||||||
(echo '' | $(tc-getCC ${CTARGET}) ${CFLAGS} -v -E - 2>&1) > gccinfo.log
|
if [[ -e "${dir}" ]] ; then
|
||||||
[[ -e "${T}"/build.log ]] && cp "${T}"/build.log .
|
pushd "${WORKDIR}" >/dev/null
|
||||||
tar -acf "${WORKDIR}"/gcc-build-logs.tar.xz \
|
(echo '' | $(tc-getCC ${CTARGET}) ${CFLAGS} -v -E - 2>&1) > "${dir}"/gccinfo.log
|
||||||
gccinfo.log build.log $(find -name config.log)
|
[[ -e "${T}"/build.log ]] && cp "${T}"/build.log "${dir}"
|
||||||
rm gccinfo.log build.log
|
tar -arf "${WORKDIR}"/gcc-build-logs.tar.xz \
|
||||||
eerror
|
"${dir#${WORKDIR}/}"/gccinfo.log "${dir#${WORKDIR}/}"/build.log $(find -name "${dir}"/config.log)
|
||||||
eerror "Please include ${WORKDIR}/gcc-build-logs.tar.xz in your bug report."
|
rm "${dir}"/gccinfo.log "${dir}"/build.log
|
||||||
eerror
|
eerror
|
||||||
popd >/dev/null
|
eerror "Please include ${WORKDIR}/gcc-build-logs.tar.xz in your bug report."
|
||||||
fi
|
eerror
|
||||||
|
popd >/dev/null
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user