diff mbox series

[FFmpeg-devel] configure: Disable inline assembly with nonlocal labels with LTO on Clang on Windows

Message ID 20231220124248.2816809-1-martin@martin.st
State Accepted
Commit 102045028ee57967973ea90acac41eb747d3c601
Headers show
Series [FFmpeg-devel] configure: Disable inline assembly with nonlocal labels with LTO on Clang on Windows | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Martin Storsjö Dec. 20, 2023, 12:42 p.m. UTC
The file libavcodec/x86/mlpdsp_init.c uses inline assembly with
nonlocal labels that are referenced outside of the assembly in C.
This fails to link with LTO when built with Clang when targeting
Windows.

The root cause has been reported upstream at
https://github.com/llvm/llvm-project/issues/76046.

Fixes: https://trac.ffmpeg.org/ticket/10548
---
 configure | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Martin Storsjö Jan. 4, 2024, 12:48 p.m. UTC | #1
On Wed, 20 Dec 2023, Martin Storsjö wrote:

> The file libavcodec/x86/mlpdsp_init.c uses inline assembly with
> nonlocal labels that are referenced outside of the assembly in C.
> This fails to link with LTO when built with Clang when targeting
> Windows.
>
> The root cause has been reported upstream at
> https://github.com/llvm/llvm-project/issues/76046.
>
> Fixes: https://trac.ffmpeg.org/ticket/10548
> ---
> configure | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/configure b/configure
> index 7742ea4ba2..b4f7c2de66 100755
> --- a/configure
> +++ b/configure
> @@ -7372,6 +7372,16 @@ if [ -n "$lto" ]; then
>     check_cflags  $lto
>     check_ldflags $lto $cpuflags
>     disable inline_asm_direct_symbol_refs
> +    if test "$cc_type" = "clang"; then
> +        # Clang's LTO fails on Windows, when there are references outside
> +        # of inline assembly to nonlocal labels defined within inline assembly,
> +        # see https://github.com/llvm/llvm-project/issues/76046.
> +        case $target_os in
> +        mingw32|win32)
> +            disable inline_asm_nonlocal_labels
> +            ;;
> +        esac
> +    fi
> fi

Will push soon

// Martin
diff mbox series

Patch

diff --git a/configure b/configure
index 7742ea4ba2..b4f7c2de66 100755
--- a/configure
+++ b/configure
@@ -7372,6 +7372,16 @@  if [ -n "$lto" ]; then
     check_cflags  $lto
     check_ldflags $lto $cpuflags
     disable inline_asm_direct_symbol_refs
+    if test "$cc_type" = "clang"; then
+        # Clang's LTO fails on Windows, when there are references outside
+        # of inline assembly to nonlocal labels defined within inline assembly,
+        # see https://github.com/llvm/llvm-project/issues/76046.
+        case $target_os in
+        mingw32|win32)
+            disable inline_asm_nonlocal_labels
+            ;;
+        esac
+    fi
 fi
 
 enabled ftrapv && check_cflags -ftrapv