When FFmpeg is configured with --enable-lto using Clang and a generic CPU 
target, the LTO linker-flag check passes $cpuflags (which includes 
-march=generic) together with -flto. Clang does not accept -march=generic 
(“unknown target CPU ‘generic’”), so the check fails and -flto is never added 
to LDFLAGS. The build then fails at the final link stage, because the object 
files are LLVM bitcode that the linker cannot handle without -flto (“file 
format not recognized”).

The CPU flags are already validated by check_allcflags just above, so they are 
not needed in the linker-flag check. Drop $cpuflags from check_ldflags so the 
LTO flag is tested on its own.

Signed-off-by: Alhuda Khan [email protected]

configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 2bbc7812eb..c3ea5a2ad3 100755
--- a/configure
+++ b/configure
@@ -7971,7 +7971,7 @@ check_optflags -fno-signed-zeros
if [ -n “$lto” ]; then
test “$cc_type” != “$ld_type” && die “LTO requires same compiler and linker”
check_allcflags $lto

check_ldflags $lto $cpuflags
check_ldflags $lto
disable inline_asm_direct_symbol_refs
if test “$cc_type” = “clang”; then
# Clang’s LTO fails on Windows, when there are references outside
_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to