Closed Mivik closed 1 year ago
Thanks for the report! Your guess is as good as mine w.r.t. linker flags. I happily accept a PR that removes the flag for the given config as long as the current CI tests keep passing.
@ralfbiedert Are the nasm builds actually tested in CI though? As far as I can tell, the runners do not have nasm pre-installed...
With regards to prefixing: AFAIK, it's an MSVC toolchain thing, it wants to prefix user function names with and underscore, linux toolchains do not do this. Not sure about macOS, but it seems that the underscore prefixing was added in a commit fixing macOS build, so... Maybe it also does it??
Are the nasm builds actually tested in CI though? As far as I can tell, the runners do not have nasm pre-installed...
Agreed, nasm probably isn't installed (PR welcome).
I am working on it
This got fixed by #28, right?
Yes, it works for me now
The library itself builds well on linux x86_64 with nasm installed. However, when I was trying to build a binary package, the linking stage failed.
I tried to inspect these symbols, and found that in the object file (specifically
libopenh264_common.a
), these symbols are all prefixed with underscore and thus the linker failed to find them.Through experiments I found that removing this line solves the problem:
https://github.com/ralfbiedert/openh264-rust/blob/0dd2282a690ba5b2e92a7a8013e275eae69614c9/openh264-sys2/build.rs#L60
, which indeed disables name prefixing.
Actually I'm not familiar with these linking stuff, so some of my understandings can be wrong. Given that, this fix can be dirty and not universally appliable so I'm asking here instead of creating a pull request.