summaryrefslogtreecommitdiff
path: root/sys-devel/binutils/binutils-2.42-r1.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/binutils/binutils-2.42-r1.ebuild')
-rw-r--r--sys-devel/binutils/binutils-2.42-r1.ebuild32
1 files changed, 28 insertions, 4 deletions
diff --git a/sys-devel/binutils/binutils-2.42-r1.ebuild b/sys-devel/binutils/binutils-2.42-r1.ebuild
index 247aaaa1fa03..a7bca7df85af 100644
--- a/sys-devel/binutils/binutils-2.42-r1.ebuild
+++ b/sys-devel/binutils/binutils-2.42-r1.ebuild
@@ -333,10 +333,20 @@ src_configure() {
)
fi
+ if use test || { use pgo && tc-is-lto ; } ; then
+ # -Wa,* needs to be consistent everywhere or lto-wrapper will complain
+ filter-flags '-Wa,*'
+ fi
+
if ! is_cross ; then
- myconf+=( $(use_enable pgo pgo-build lto) )
+ myconf+=( $(use_enable pgo pgo-build $(tc-is-lto && echo "lto" || echo "yes")) )
if use pgo ; then
+ # We let configure handle it for us because it has to run
+ # the testsuite later on for profiling, and LTO isn't compatible
+ # with the testsuite.
+ filter-lto
+
export BUILD_CFLAGS="${CFLAGS}"
fi
fi
@@ -378,10 +388,24 @@ src_test() {
local -x XZ_OPT="-T1"
local -x XZ_DEFAULTS="-T1"
- # bug #637066
- filter-flags -Wall -Wreturn-type
+ (
+ # Tests don't expect LTO
+ filter-lto
- emake -k check
+ # lto-wrapper warnings which confuse tests
+ filter-flags '-Wa,*'
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ 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}"
+ )
}
src_install() {