diff --git a/sdk_container/src/third_party/portage-stable/sys-libs/binutils-libs/binutils-libs-2.44-r2.ebuild b/sdk_container/src/third_party/portage-stable/sys-libs/binutils-libs/binutils-libs-2.44-r2.ebuild index 68778c83c8..30409721e9 100644 --- a/sdk_container/src/third_party/portage-stable/sys-libs/binutils-libs/binutils-libs-2.44-r2.ebuild +++ b/sdk_container/src/third_party/portage-stable/sys-libs/binutils-libs/binutils-libs-2.44-r2.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit dot-a libtool toolchain-funcs multilib-minimal +inherit dot-a flag-o-matic libtool toolchain-funcs multilib-minimal DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages" HOMEPAGE="https://sourceware.org/binutils/" @@ -208,9 +208,37 @@ multilib_src_configure() { } multilib_src_test() { - # Without this, the default `src_test` check for the 'check' target - # with `-n` may fail with parallel make and silently skip tests (bug #955595) - emake check + ( + # Tests don't expect LTO + filter-lto + + # If we have e.g. -mfpmath=sse -march=pentium4 in CFLAGS, + # we'll get lto1 warnings for some tests which cause + # spurious failures because -mfpmath isn't passed at + # link-time. Filter accordingly. + # + # Alternatively, we could pass C{C,XX}_FOR_TARGET with + # some (ideally not all, surely would break some tests) + # stuffed in. + filter-flags '-mfpmath=*' + + # lto-wrapper warnings which confuse tests + filter-flags '-Wa,*' + + # bug #637066 + filter-flags -Wall -Wreturn-type + + # Note that we need 'check' explicitly if ever cleaning this + # up: the default `src_test` check for the 'check' target + # with `-n` may fail with parallel make and silently skip tests (bug #955595) + emake -k check \ + CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET:-${CFLAGS}}" \ + CXXFLAGS_FOR_TARGET="${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}" \ + LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}" \ + CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LDFLAGS="${LDFLAGS}" + ) } multilib_src_install() { diff --git a/sdk_container/src/third_party/portage-stable/sys-libs/binutils-libs/binutils-libs-9999.ebuild b/sdk_container/src/third_party/portage-stable/sys-libs/binutils-libs/binutils-libs-9999.ebuild index bf7a24d748..5afd4e37fd 100644 --- a/sdk_container/src/third_party/portage-stable/sys-libs/binutils-libs/binutils-libs-9999.ebuild +++ b/sdk_container/src/third_party/portage-stable/sys-libs/binutils-libs/binutils-libs-9999.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit dot-a libtool toolchain-funcs multilib-minimal +inherit dot-a flag-o-matic libtool toolchain-funcs multilib-minimal DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages" HOMEPAGE="https://sourceware.org/binutils/" @@ -208,9 +208,37 @@ multilib_src_configure() { } multilib_src_test() { - # Without this, the default `src_test` check for the 'check' target - # with `-n` may fail with parallel make and silently skip tests (bug #955595) - emake check + ( + # Tests don't expect LTO + filter-lto + + # If we have e.g. -mfpmath=sse -march=pentium4 in CFLAGS, + # we'll get lto1 warnings for some tests which cause + # spurious failures because -mfpmath isn't passed at + # link-time. Filter accordingly. + # + # Alternatively, we could pass C{C,XX}_FOR_TARGET with + # some (ideally not all, surely would break some tests) + # stuffed in. + filter-flags '-mfpmath=*' + + # lto-wrapper warnings which confuse tests + filter-flags '-Wa,*' + + # bug #637066 + filter-flags -Wall -Wreturn-type + + # Note that we need 'check' explicitly if ever cleaning this + # up: the default `src_test` check for the 'check' target + # with `-n` may fail with parallel make and silently skip tests (bug #955595) + emake -k check \ + CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET:-${CFLAGS}}" \ + CXXFLAGS_FOR_TARGET="${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}" \ + LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}" \ + CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LDFLAGS="${LDFLAGS}" + ) } multilib_src_install() {