Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mingw64] [FFmpeg+librav1e] multiple definition of ___chkstk_ms #1483

Closed
subz390 opened this issue Nov 23, 2019 · 10 comments
Closed

[mingw64] [FFmpeg+librav1e] multiple definition of ___chkstk_ms #1483

subz390 opened this issue Nov 23, 2019 · 10 comments
Labels

Comments

@subz390
Copy link

subz390 commented Nov 23, 2019

LD	ffmpeg_g.exe
LD	ffplay_g.exe
LD	ffprobe_g.exe
D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/DEV/media-autobuild/media-autobuild_suite/local64/lib/librav1e.a(compiler_builtins-477d6ada7584f678.compiler_builtins.1c0g4lf3-cgu.0.rcgu.o): in function `___chkstk_ms':
C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.18\src/x86_64.rs:15: multiple definition of `___chkstk_ms'; D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libgcc.a(_chkstk_ms.o):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/DEV/media-autobuild/media-autobuild_suite/local64/lib/librav1e.a(compiler_builtins-477d6ada7584f678.compiler_builtins.1c0g4lf3-cgu.0.rcgu.o): in function `___chkstk_ms':
C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.18\src/x86_64.rs:15: multiple definition of `___chkstk_ms'; D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libgcc.a(_chkstk_ms.o):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [/build/ffmpeg-git/Makefile:111: ffmpeg_g.exe] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/build/ffmpeg-git/Makefile:111: ffplay_g.exe] Error 1
D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/DEV/media-autobuild/media-autobuild_suite/local64/lib/librav1e.a(compiler_builtins-477d6ada7584f678.compiler_builtins.1c0g4lf3-cgu.0.rcgu.o): in function `___chkstk_ms':
C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.18\src/x86_64.rs:15: multiple definition of `___chkstk_ms'; D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libgcc.a(_chkstk_ms.o):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [/build/ffmpeg-git/Makefile:111: ffprobe_g.exe] Error 1
LD	ffmpeg_g.exe
D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/DEV/media-autobuild/media-autobuild_suite/local64/lib/librav1e.a(compiler_builtins-477d6ada7584f678.compiler_builtins.1c0g4lf3-cgu.0.rcgu.o): in function `___chkstk_ms':
C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.18\src/x86_64.rs:15: multiple definition of `___chkstk_ms'; D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libgcc.a(_chkstk_ms.o):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [/build/ffmpeg-git/Makefile:111: ffmpeg_g.exe] Error 1

logs.zip

My apologies, I'm new to this suite and don't understand the error.
I've run media-autobuild_suite.bat four times to make sure everything is up to date and it exits with the same error at the same place each time.

In the meantime, is there anything can I disable in ffmpeg_options.txt please to avoid getting this error as I'm only building this ffmpeg so I can transcode video using hardware accelleration NVIDIA GPU with --enable-libnpp as that's not included on public realeases of ffmpeg. Anything else can go.

@1480c1
Copy link
Member

1480c1 commented Nov 23, 2019

D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/DEV/media-autobuild/media-autobuild_suite/local64/lib/librav1e.a(compiler_builtins-477d6ada7584f678.compiler_builtins.1c0g4lf3-cgu.0.rcgu.o): in function `___chkstk_ms':
C:\Users\VssAdministrator\.cargo\registry\src\git.luolix.top-1ecc6299db9ec823\compiler_builtins-0.1.18\src/x86_64.rs:15: multiple definition of `___chkstk_ms'; D:/DEV/media-autobuild/media-autobuild_suite/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/libgcc.a(_chkstk_ms.o):(.text+0x0): first defined here

It's just complaining that there are two functions with the same name ___chkstk_ms from librav1e and libgcc

@1480c1 1480c1 added the bug label Nov 23, 2019
@subz390
Copy link
Author

subz390 commented Nov 23, 2019

Thank you
I disabled --enable-librav1e in ffmpeg_options.txt and the build completed without error.

@wiiaboo
Copy link
Member

wiiaboo commented Nov 23, 2019 via email

@TransLucida
Copy link

I've had the exact same iusse as @subz390 and I also disabled librav1e but I think now I'm having the same problem again with libxml2 + gcc and the functions get_relative_path, get_relocated_path, get_executable_path, strip_n_prefix_folders, strip_n_suffix_folders, split_path_list and get_relocated_path_list. I'm disabling libxml2 and will report back.

@1480c1
Copy link
Member

1480c1 commented Nov 27, 2019

For your last problem #1485

@1480c1 1480c1 changed the title [mingw64] compile static FFmpeg failing [mingw64] FFmpeg and librav1e multiple definition of ___chkstk_ms Nov 30, 2019
@1480c1 1480c1 changed the title [mingw64] FFmpeg and librav1e multiple definition of ___chkstk_ms [mingw64] [FFmpeg+librav1e] multiple definition of ___chkstk_ms Dec 5, 2019
1480c1 pushed a commit that referenced this issue Dec 12, 2019
Workaround for the problems in #1483
@linnaea
Copy link
Contributor

linnaea commented Jan 4, 2020

@1480c1
Copy link
Member

1480c1 commented Jan 4, 2020

Now the question is to where do we report it, rav1e, cargo-c, or rust-lang

@linnaea
Copy link
Contributor

linnaea commented Jan 4, 2020

Probably rust-lang, chkstk stuff are inserted by compilers if a function needs more than a page worth of stack, rav1e and cargo-c won't have control on that.

@linnaea
Copy link
Contributor

linnaea commented Feb 11, 2020

While we wait for Rust to fix the issue, here's a hack to get it working:

diff --git a/build/media-suite_compile.sh b/build/media-suite_compile.sh
index f840a23..ad78623 100644
--- a/build/media-suite_compile.sh
+++ b/build/media-suite_compile.sh
@@ -1057,6 +1057,13 @@ if { [[ $rav1e = y ]] || enabled librav1e; } &&
             cinstall --release --prefix "$PWD/install-$bits" --jobs "$cpuCount"
         # do_install "install-$bits/bin/rav1e.dll" bin-video/
         # do_install "install-$bits/lib/librav1e.dll.a" lib/
+
+        compiler_builtins=$(ar t "install-$bits/lib/librav1e.a" | grep -xG compiler_builtins-.*compiler_builtins.*-cgu.0.rcgu.o)
+        ar x "install-$bits/lib/librav1e.a" "$compiler_builtins"
+        objcopy -W ___chkstk_ms "$compiler_builtins"
+        ar r "install-$bits/lib/librav1e.a" "$compiler_builtins"
+        rm "$compiler_builtins"
+
         do_install "install-$bits/lib/librav1e.a" lib/
         do_install "install-$bits/lib/pkgconfig/rav1e.pc" lib/pkgconfig/
         do_install "install-$bits/include/rav1e"/*.h include/rav1e/

@1480c1
Copy link
Member

1480c1 commented Feb 11, 2020

@linnaea, do you think can submit a PR so I can easily test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants