summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-07-01 18:14:44 +0200
committerMichał Górny <mgorny@gentoo.org>2017-08-25 15:53:18 +0200
commit6f0e2e53c401a01ee8015e356699bbfb9d246e35 (patch)
treedbd1f1d9e977c140ac6db69702a178bf6fbd225a /eclass/flag-o-matic.eclass
parentflag-o-matic.eclass: test-flag-PROG, ignore unused args in clang (diff)
downloadgentoo-6f0e2e53c401a01ee8015e356699bbfb9d246e35.tar.gz
gentoo-6f0e2e53c401a01ee8015e356699bbfb9d246e35.tar.bz2
gentoo-6f0e2e53c401a01ee8015e356699bbfb9d246e35.zip
flag-o-matic.eclass: Strip LDFLAGS unsupported by the C compiler, #621274
Include LDFLAGS in the variables stripped by strip-unsupported-flags. The code reuses the current functions for testing CC, and so only remove LDFLAGS that are rejected by the C compiler and not the linker. This solves the case of bug #621274 where LDFLAGS contained GCC-specific -flto flag.
Diffstat (limited to 'eclass/flag-o-matic.eclass')
-rw-r--r--eclass/flag-o-matic.eclass3
1 files changed, 3 insertions, 0 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 79866e04a483..4e3cfff5afd5 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -546,6 +546,9 @@ strip-unsupported-flags() {
export CXXFLAGS=$(test-flags-CXX ${CXXFLAGS})
export FFLAGS=$(test-flags-F77 ${FFLAGS})
export FCFLAGS=$(test-flags-FC ${FCFLAGS})
+ # note: this does not verify the linker flags but it is enough
+ # to strip invalid C flags which are much more likely, #621274
+ export LDFLAGS=$(test-flags-CC ${LDFLAGS})
}
# @FUNCTION: get-flag