commit: 760fcda985678ecd945b7c33764cd2ee2fc879c2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> AuthorDate: Sat May 5 11:35:47 2018 +0000 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> CommitDate: Sat May 5 11:46:04 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=760fcda9
toolchain.eclass: disallow USE="ssp -libssp" on mingw targets gcc-8 added --disable-libssp flag. It used to be gentoo-specific flag up to gcc-5.4.0 and gentoo was passing --disable-libssp on all targets except solaris. On gcc-6 gentoo stopped providing --disable-libssp flag (it became no-op). USE=ssp became the default with gcc-6. gcc-8 reintroduced --disable-libssp and that broke mingw. mingw libc does not provide stack_check_*() functions and USE=ssp forces compiler to emit those calls. This change disallows disabling libssp on mingw if USE=ssp is set. Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> eclass/toolchain.eclass | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 2cac026eefa..47ee5495739 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1207,7 +1207,17 @@ toolchain_src_configure() { if hardened_gcc_is_stable ssp; then export gcc_cv_libc_provides_ssp=yes fi - confgcc+=( --disable-libssp ) + if use_if_iuse ssp; then + # On some targets USE="ssp -libssp" is an invalid + # configuration as target libc does not provide + # stack_chk_* functions. Do not disable libssp there. + case ${CTARGET} in + mingw*|*-mingw*) ewarn "Not disabling libssp" ;; + *) confgcc+=( --disable-libssp ) ;; + esac + else + confgcc+=( --disable-libssp ) + fi fi fi