diff --git a/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass b/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass index 93d4792af4..12a1ec2413 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass @@ -338,7 +338,7 @@ if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] ; then # and https://rust-gcc.github.io/2023/04/24/gccrs-and-gcc13-release.html for why # 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.2.1_p20241026 ${PV} && IUSE+=" time64" + tc_version_is_at_least 13.3.1_p20250522 ${PV} && IUSE+=" time64" tc_version_is_at_least 15.0.0_pre20241124 ${PV} && IUSE+=" libgdiagnostics" tc_version_is_at_least 15.0.1_pre20250316 ${PV} && IUSE+=" cobol" fi @@ -772,6 +772,19 @@ do_gcc_gentoo_patches() { eapply "${WORKDIR}"/musl/{,nocross/}*.patch ${shopt_save} fi + + # + # THIS IS A TEMPORARY SOLUTION AND SHOULD BE REPLACED BY A PROPER FIX. + # Adding it so we can already build stages for further testing. -dilfridge + # + if [[ ${CTARGET} == m68*-aligned-* ]]; then + einfo "Hard-wiring m68k -malign-int switch into gcc" + echo '#define DRIVER_SELF_SPECS "-malign-int"' >> "${S}/gcc/config/m68k/m68k.h" || die + fi + # + # END TEMPORARY SOLUTION + # + fi } @@ -1139,6 +1152,15 @@ toolchain_setup_ada() { ! tc-is-cross-compiler && _toolchain_make_gnat_wrappers export CC="$(tc-getCC) -specs=${T}/ada.spec" + + if ver_test ${PV} -lt 13 && [[ ${CTARGET} == hppa* ]] ; then + # For HPPA, the ada-bootstrap binaries seem to default + # to -fstack-protector still (maybe because of cross-building) + # so we need to override it for <13 (which ignores -fstack-protector) + # as SSP doesn't exist there. The GNAT configure test gets confused + # by GCC warning about this otherwise. + CC+=" -fno-stack-protector" + fi } # @FUNCTION: toolchain_setup_d @@ -1180,7 +1202,7 @@ toolchain_src_configure() { downgrade_arch_flags gcc_do_filter_flags - if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] && tc_version_is_at_least 14.2.1_p20241026 ${PV}; then + if [[ ${PN} != kgcc64 && ${PN} != gcc-* ]] && tc_version_is_at_least 13.3.1_p20250522 ${PV}; then append-cppflags "-D_GENTOO_TIME64_FORCE=$(usex time64 1 0)" fi @@ -2680,8 +2702,8 @@ toolchain_src_install() { # Hack for C++ modules if ! is_crosscompile && tc_version_is_at_least 15.0.1_pre20250316 ${PV}; then # PR19266 (bug #948394) - sed -i -e "s,\.\./lib/gcc/${CHOST}/${GCCMAJOR}/include/,include/," \ - "${ED}"/usr/lib/gcc/${CHOST}/${GCCMAJOR}/libstdc++.modules.json || die + find "${ED}"/usr/lib/gcc/${CHOST}/${GCCMAJOR} -name libstdc++.modules.json \ + -exec sed -i -e "s,\"source-path\": \".*gcc/${CHOST}/${GCCMAJOR}/include/,\"source-path\": \"include/," "{}" + || die fi # As gcc installs object files built against both ${CHOST} and ${CTARGET} @@ -2780,6 +2802,8 @@ toolchain_src_install() { # Don't scan .gox files for executable stacks - false positives export QA_EXECSTACK="usr/lib*/go/*/*.gox" export QA_WX_LOAD="usr/lib*/go/*/*.gox" + # Workaround bug #793770 + export QA_PRESTRIPPED="usr/lib*/go/*/*/*.gox" # Disable RANDMMAP so PCH works, bug #301299 pax-mark -r "${ED}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/cc1"