Skip to content

meson: disable LTO in HAVE_AS_FUNC check

J. Dekker requested to merge jdek/dav1d:have_as_lto_fix into master

When LTO is enabled using -flto, simply compiling does not produce an error. Either LTO must be turned off or a linking check must be performed. LTO does not seem to affect non-assembly checks.

Fixes #423 (closed).

This behaviour can be seen in the following test:

$ cat t.c
int main(void)
{
    __asm__ (".foobar this_directive_doesnt_exist");
    return 0;
}
$ cc t.c -o t.o -flto -c
$ echo $?
0
$ cc t.c -o t.o -flto
ld: <inline asm>:1:2: unknown directive
    .foobar this_directive_doesnt_exist
    ^
 for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ echo $?
1

Signed-off-by: J. Dekker jdek@itanimul.li

Merge request reports