-
Notifications
You must be signed in to change notification settings - Fork 5
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
Static libavif looses debug info #39
Comments
We're resorting to drastic measures to avoid fiddling with the internals of the libavif build system by applying `/Z7` instead of the customary `/Zi`, so that debug info is embedded into the objects instead of an external PDB. While this increases the size of the object files, the result when building the gd.dll should be the same. And although this CMake option is only available as of version 3.25, that shouldn't be an issue at least for the GH builds, since these ship pretty recent CMake versions anyway.
While working on this, I've learned that libavif merges all involved static libs into avif.lib when doing LOCAL builds (as we do). That means that the aom.lib we're shipping is completely useless for PHP at least. Then I've learned that the way we're building currently, libyuv is automatically build behind the scenes (using And I've also learned that similar to libjpeg-turbo there is not only a single (or let's say three) static libraries, but some libs are build behind the scenes. So unless we'd be doing something like winlibs/libjpeg@1177955, there is no way to have fully working PDBs for static libavif, but libavif is way more complex than libjpeg and might be moving faster at this point in time. So going with embedded debug info ( If we want to go with embedded debug info, we should probably drop shipping aom_a.lib, and to make it optional dependency for ext/gd. A bit of an issue if we want to update libavif for stable PHP versions (would either need to ship the real aom_a.lib, or a basically empty fake). Another option would be to actually have the three libraries, by doing non-LOCAL builds; An alternative would be to build a shared libavif, but see winlibs/libavif#1. |
Pros:
Cons:
Test build: https://github.com/winlibs/winlib-builder/actions/runs/12892972580 Generally, I think shared libs are the way to head to. Static libs caused serious pain in the past (prior to adding the undocumented |
For RelWithDebInfo, (almost?) all debug info is lost, since we ignore avif_obj.pdb and yuv_a.pdb; and we do not even built aom with RelWithDebInfo, but rather Release. The latter is not nice, but the former makes the linker scream LNK4099, what is really annoying.
I'm filing this here since this is related to our builds, but might actually need a patch in https://github.com/winlibs/libavif, or even upstream.
The text was updated successfully, but these errors were encountered: