From: Sergei Trofimovich Date: Sat, 5 May 2018 11:35:47 +0000 (+0100) Subject: toolchain.eclass: disallow USE="ssp -libssp" on mingw targets X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=760fcda985678ecd945b7c33764cd2ee2fc879c2;p=gentoo.git 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 --- diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 2cac026eefa8..47ee5495739c 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