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.
This commit is contained in:
Michał Górny
2017-08-08 21:42:17 +02:00
parent 692442585c
commit 0e6d20439e
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -535,6 +535,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
+1 -1
View File
@@ -55,7 +55,7 @@ done <<<"
tbegin "strip-unsupported-flags"
strip-unsupported-flags
[[ ${CFLAGS} == "" ]] && [[ ${CXXFLAGS} == "-z=2" ]]
[[ ${CFLAGS} == "" ]] && [[ ${CXXFLAGS} == "-z=2" ]] && [[ ${LDFLAGS} == "" ]]
ftend
for var in $(all-flag-vars) ; do