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

No pdb files generated in release mode #116

Open
aboelens opened this issue Oct 28, 2024 · 4 comments
Open

No pdb files generated in release mode #116

aboelens opened this issue Oct 28, 2024 · 4 comments

Comments

@aboelens
Copy link
Contributor

In the process of getting openssl to build with the MSVC toolchain I ran into a problem where there are no pdb files produced in release mode:

microsoft/vcpkg#41796 (comment)

Would you agree with this statement from one of the maintainers I have been communicating with that this should be enabled in the toolchain?

"/DEBUG /OPT:REF is expected to come from the cmake toolchain.
From the gmp port (error logs), I know this value:

set(VCPKG_DETECTED_CMAKE_SHARED_LINKER_FLAGS_RELEASE "-machine:x64 -nologo -DEBUG -INCREMENTAL:NO -OPT:REF -OPT:ICF")
So -OPT:REF -DEBUG is already there."

@MarkSchofield
Copy link
Owner

CMake "Release" builds typically don't have PDB files, "RelWithDebInfo" builds do. That's configured by (I think) the logic in Modules/Platform/Windows-MSVC.cmake, which sets (for example) CMAKE_EXE_LINKER_FLAGS_<CONFIG>_INIT. So the default behavior comes from CMake, not a toolchain.

Since VCPkg typically just builds two configurations 'dbg' and rel', then it's not unreasonable for the 'rel' builds to have PDB's incase they're consumed from 'RelWithDebInfo' builds, but I'd have thought that that would be something that VCPkg would handle in, say, vcpkg_cmake_configure.

TBH, I'm not sure what you're trying to do. If you're just building openssl using 'WindowsToolchain', I'm not sure why you'd file a vcpkg issue...? If you're building openssl as a VCPkg port, then VCPkg hooks-up it's own toolchain that (IIRC) depends on environment variables that vcpkg.exe sets (much like a Visual Studio command prompt), so you shouldn't be using WindowsToolchain?

@aboelens
Copy link
Contributor Author

I am trying to build the vcpkg port of openssl using the VCPKG_CHAINLOAD_TOOLCHAIN_FILE option in the triplet file. That way both my code and its dependencies are build with the same SDK and compiler versions.

@MarkSchofield
Copy link
Owner

Rather than switching Vcpkg to use WindowsToolchain, can you use properties that WindowsToolchain has set to influence the behavior of the Vcpkg toolchain...? That seems like a slightly less intrusive approach.

@aboelens
Copy link
Contributor Author

aboelens commented Nov 5, 2024

I like the idea, but that is generally difficult. To provide consistent builds, vcpkg sets up a clean build environment for every port by default.

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

No branches or pull requests

2 participants