Yubico / libfido2

Provides library functionality for FIDO2, including communication with a device over USB or NFC.
Other
581 stars 153 forks source link

Windows static libraries have incorrect PDB filenames #773

Closed mcnameej closed 7 months ago

mcnameej commented 7 months ago

What version of libfido2 are you using?

1.14.0

Binary release downloaded from https://developers.yubico.com/libfido2/Releases/libfido2-1.14.0-win.zip

What operating system are you running?

Windows X64

What application are you using in conjunction with libfido2?

Application is under development.

How does the problem manifest itself?

Linking against fido2.lib static library (and the included dependencies) results in ~400 warnings from the linker.

Examples:

fido2.lib(aes256.obj) : warning LNK4099: PDB 'fido2_static.pdb' was not found with 'fido2.lib(aes256.obj)' or at 'C:\foo\bar\fido2_static.pdb'; linking object as if no debug info
crypto-50.lib(aes_core.obj) : warning LNK4099: PDB 'crypto_obj.pdb' was not found with 'crypto-50.lib(aes_core.obj)' or at 'C:\foo\bar\crypto_obj.pdb'; linking object as if no debug info

A warning is generated for every OBJ pulled in from fido2.lib, crypto-50.lib, and zlib1.lib. cbor.lib is OK.

While the resulting executable is OK, having ~400 warnings during a build is a deal killer. My project has a "warnings are errors" policy.

Is the problem reproducible?

Yes.

What are the steps that lead to the problem?

Just link with the static libraries provided on Yubico web site.

Cause of the problem

The PDB filenames are incorrect in the binary release...

The PDB filenames are baked into the OBJ files during compilation, and the OBJ's are copied into the LIB file.

I suspect the PDB files were renamed to match the names of the LIB files when creating the binary release package.

Suggested fix

The path of least resistance is to use the original PDB filenames when creating a binary release. Don't rename them.

Alternatively you could update the build process for fido2.lib and the dependencies. Using /Z7 rather than /Zi during compilation will include all the debug symbols in the OBJ files rather than creating a separate PDB file. You just have to distribute the LIB file. This is my preferred option when I build static libraries, but opinions vary. libfido2 uses CMake, so fixing it should be easy. OpenSSL and zlib have their own unique build systems, and will be more difficult.

Does the problem happen with different authenticators?

N/A

Please include the output of fido2-token -L.

N/A

Please include the output of fido2-token -I.

N/A

Please include the output of FIDO_DEBUG=1.

N/A

LDVG commented 7 months ago

Apologies for the inconvenience. Our next release should fix this. In the meantime, I hope restoring the original names is not too much of an hassle. Thank you for your report!