summaryrefslogtreecommitdiff
path: root/eclass/toolchain.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass18
1 files changed, 12 insertions, 6 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index c605c437f355..85b5a2b23392 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -688,6 +688,11 @@ toolchain_src_prepare() {
eapply_user
+ # Workaround -march=native not working for stage1 with non-GCC (bug #933772).
+ if ! tc-is-gcc && [[ "${CFLAGS}${CXXFLAGS}" == *-march=native* ]] ; then
+ CLANG_DISABLE_CET_HACK=1
+ fi
+
if ! use vanilla ; then
tc_enable_hardened_gcc
fi
@@ -1178,11 +1183,6 @@ toolchain_src_configure() {
export ac_cv_std_swap_in_utility=no
fi
- # Workaround -march=native not working for stage1 with non-GCC (bug #933772).
- if ! tc-is-gcc && [[ "${CFLAGS}${CXXFLAGS}" == *-march=native* ]] ; then
- CLANG_DISABLE_CET_HACK=1
- fi
-
local flag
for flag in $(all-flag-vars) ; do
einfo "${flag}=\"${!flag}\""
@@ -1804,7 +1804,7 @@ toolchain_src_configure() {
fi
case ${CBUILD}-${CHOST}-${CTARGET} in
- *i686-w64-mingw32*|*x86_64-w64-mingw32*)
+ *-w*-mingw*)
# config/i386/t-cygming requires fixincludes (bug #925204)
GCC_RUN_FIXINCLUDES=1
;;
@@ -2961,6 +2961,12 @@ toolchain_pkg_postrm() {
rm -f "${EROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64}
fi
return 0
+ else
+ # Removed the last GCC installed (bug #906040)
+ if ! has_version "sys-devel/gcc" && has_version "sys-devel/clang" ; then
+ einfo "Last GCC version removed. Cleaning up ${EROOT}/etc/clang/gentoo-gcc-install.cfg."
+ echo > "${EROOT}"/etc/clang/gentoo-gcc-install.cfg
+ fi
fi
# gcc stopped installing .la files fixer in June 2020.