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

[ffmpeg] ld: warning: could not create compact unwind #19699

Closed
daschuer opened this issue Aug 22, 2021 · 19 comments
Closed

[ffmpeg] ld: warning: could not create compact unwind #19699

daschuer opened this issue Aug 22, 2021 · 19 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project

Comments

@daschuer
Copy link
Contributor

daschuer commented Aug 22, 2021

When I try to link to the ffmpeg libraries I get the following linker warnings:

2021-08-18T22:06:41.3473950Z ld: warning: could not create compact unwind for _ff_cfhd_init_vlcs: stack subq instruction is too different from dwarf stack size
2021-08-18T22:06:41.3475230Z ld: warning: could not create compact unwind for _ff_rl_init_vlc: stack subq instruction is too different from dwarf stack size

The linking itself succeeds and so far it works as well.
How can I get rid of the warnings?

ffmpeg is build with these options

-- Building Options: --enable-pic --disable-doc --enable-debug --enable-runtime-cpudetect --enable-asm --enable-x86asm --enable-gpl --disable-ffmpeg --disable-ffplay --disable-ffprobe --enable-avcodec --enable-avdevice --enable-avformat --enable-avfilter --enable-postproc --enable-swresample --enable-swscale --disable-libass --disable-avisynth --disable-bzlib --disable-libdav1d --disable-libfdk-aac --disable-libfontconfig --disable-libfreetype --disable-libfribidi --disable-iconv --disable-libilbc --disable-lzma --disable-libmp3lame --disable-libmodplug --disable-cuda --disable-nvenc --disable-nvdec  --disable-cuvid --disable-ffnvcodec --disable-opencl --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-openssl --disable-libopus --disable-sdl2 --disable-libsnappy --disable-libsoxr --disable-libspeex --disable-libssh --disable-libtensorflow --disable-libtesseract --disable-libtheora --disable-libvorbis --disable-libvpx --disable-libwebp --disable-libx264 --disable-libx265 --disable-libxml2 --disable-zlib --disable-vdpau --extra-cflags="-isysroot /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk" --extra-ldflags="-isysroot /Applications/Xcode_12.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"  --enable-cross-compile --target-os=darwin --arch=x86_64 --extra-ldflags=-arch --extra-ldflags=x86_64 --extra-cflags=-arch --extra-cflags=x86_64 --extra-cxxflags=-arch --extra-cxxflags=x86_64 --pkg-config-flags=--static

Environment

  • OS: osx
  • Compiler: AppleClang 12.0.0.12000032

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install ffmpeg
  2. link mixxx application

Here is the workflow run building Mixxx
https://github.com/mixxxdj/mixxx/pull/4225/checks?check_run_id=3365982171

And here the Run building vcpkg
https://github.com/mixxxdj/vcpkg/runs/3332915409

Expected behavior
No warning should be logged

I would be great if someone has an idea how to fix the issue or debug it more.
Thank you.

@Be-ing
Copy link
Contributor

Be-ing commented Aug 22, 2021

@daschuer
Copy link
Contributor Author

At least the --arch=x86_64 option is set. See above.

@Be-ing
Copy link
Contributor

Be-ing commented Aug 22, 2021

I am not sure it actually does get set:

--arch=x86_64 --extra-ldflags=-arch --extra-ldflags=x86_64 --extra-cflags=-arch --extra-cflags=x86_64 --extra-cxxflags=-arch --extra-cxxflags=x86_64

--extra-ldflags is set twice, first to -arch then to x86_64. The same happens for --extra-cflags and --extra-cxxflags. Perhaps only the first one has an effect.

@NancyLi1013 NancyLi1013 added the category:question This issue is a question label Aug 23, 2021
@NancyLi1013
Copy link
Contributor

Hi @daschuer

Thanks for posting this issue.

Do you encounter this issue on your local machine or on the CI mixxxdj/mixxx#4225?

Could you please try to pass the compiler option to rebuild?

LDFLAGS="-Wl,-no_compact_unwind"

@daschuer
Copy link
Contributor Author

This linker flag removes the warning. See https://github.com/daschuer/mixxx/runs/3399675678

I encounter the issue on the GitHub CI. I have unfortunately no access to a local macOS machine.

Can you give some insights?

  • Why the linker only complains about these two ffmpeg functions? Are other warnings suppressed or are only these two affected?
  • For my feeling the linker flag is a workaround since it affect all functions, right?
  • It seems to cause issues with the exception stack see: https://developer.apple.com/documentation/xcode/addressing-language-exception-crashes
  • Crawling in GitHub I have found other solutions where the warning is silenced with LDFLAGS="-Wl,-w"
  • What is the recommended Fix in case of this warning by the supplier?
  • Is there something official where the "no_compact_unwind" flag is explained?

@daschuer
Copy link
Contributor Author

By the way, when I do not link to ffmpeg the warning disappears. What could be the cause? It there something special with it?

@JackBoosY JackBoosY removed the category:question This issue is a question label Aug 25, 2021
@JackBoosY
Copy link
Contributor

@daschuer Sorry but I didn'f found the error messages you mentioned in https://github.com/daschuer/mixxx/runs/3399675678, can you please extract it and provide me a log file?

Also, can you get the config logs and install logs in your ci system?

Thanks.

@JackBoosY JackBoosY added requires:more-information This Issue requires more information to solve requires:repro The issue is not currently repro-able labels Aug 25, 2021
@JackBoosY JackBoosY self-assigned this Aug 25, 2021
@daschuer
Copy link
Contributor Author

https://github.com/daschuer/mixxx/runs/3399675678 is the run with LDFLAGS="-Wl,-no_compact_unwind"

The original error can be found here:
https://github.com/mixxxdj/mixxx/pull/4225/checks?check_run_id=3403021507

The logs from the vcpkg build run can be downloaded as artifact here:
https://github.com/mixxxdj/vcpkg/runs/3332915409

Thank you for having a look.

@daschuer
Copy link
Contributor Author

Maybe quotes are missing when passing the arch parameters to ./configure

--extra-ldflags=-arch --extra-ldflags=x86_64

May become

--extra-ldflags="-arch x86_64"

Just a guess

@daschuer
Copy link
Contributor Author

set(OPTIONS_CROSS " --enable-cross-compile --target-os=darwin --arch=x86_64 --extra-ldflags=-arch --extra-ldflags=x86_64 --extra-cflags=-arch --extra-cflags=x86_64 --extra-cxxflags=-arch --extra-cxxflags=x86_64")

@JackBoosY
Copy link
Contributor

@daschuer
image

@daschuer
Copy link
Contributor Author

You need to open the "build" section fist in order to make the search feature work.
Alternative you may look at the whole log using the "..." Menu.

@JackBoosY JackBoosY removed the requires:more-information This Issue requires more information to solve label Aug 26, 2021
@daschuer
Copy link
Contributor Author

I have used single quotes for --extra-ldflags='-arch x86_64' but this does not make a difference.

@JackBoosY
Copy link
Contributor

@mcmtroffaes Do you know why?

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Aug 27, 2021
@mcmtroffaes
Copy link
Contributor

I've seen this warning too on ci, but I don't know the cause. It seems to have no impact on the executables as far as I've tested. I'm sorry I can't be more helpful at this instance.

@daschuer
Copy link
Contributor Author

By default ffmpeg is build with gcc. I have patched the build.sh.in to use clang but the warning remains, so it is not a compiler bug.
If I disable the dfhd encoder and decoder, one warning disappears. So it seems to be an issue with the function itself.
Both function have in common that they allocate big arrays on the stack. I guess that this causes the linker to fail applying compact unwind.

I will report the issue upstream, maybe they can suggest a workaround.

@daschuer
Copy link
Contributor Author

@LilyWangLL LilyWangLL removed the requires:repro The issue is not currently repro-able label Jan 14, 2022
@Adela0814 Adela0814 added the depends:upstream-changes Waiting on a change to the upstream project label Jan 26, 2022
@JackBoosY
Copy link
Contributor

Close this PR until upstream fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support depends:upstream-changes Waiting on a change to the upstream project
Projects
None yet
Development

No branches or pull requests

8 participants
@mcmtroffaes @daschuer @Be-ing @NancyLi1013 @JackBoosY @LilyWangLL @Adela0814 and others