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

Add win32 support for RelWithDebInfo builds #3445

Open
shane-lawrence opened this issue Jan 10, 2025 · 2 comments
Open

Add win32 support for RelWithDebInfo builds #3445

shane-lawrence opened this issue Jan 10, 2025 · 2 comments
Milestone

Comments

@shane-lawrence
Copy link
Contributor

Motivation
As discussed in https://github.com/falcosecurity/falco/pull/3440/files#r1906703514, the method used to add separate debug symbols (objcopy) won't work on Windows. We should find an appropriate way to do this for Windows environments, but I don't think it should block the current PR.

Different sources have given me different instructions for how to do this with Visual Studio. Possibly with:

    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Zi")
    set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG")
    set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG")

Or this page suggests this:

elseif(...) # check for MSVC
    set_target_properties(
      ${PRJNAME}
      PROPERTIES
          DEBUG_SYMBOL_FILE "$<TARGET_PDB_FILE:${PRJNAME}>"
          DEBUG_SYMBOL_FILE_NAME "$<TARGET_PDB_FILE_NAME:${PRJNAME}>"
    )
    install(
        FILES
            "$<TARGET_GENEX_EVAL:${PRJNAME},$<TARGET_PROPERTY:${PRJNAME},DEBUG_SYMBOL_FILE>>"
        DESTINATION
            "${CMAKE_INSTALL_LIBDIR}"
    )

Some sources say that Visual Studio generates PDB files automatically with every build and we don't need to do anything. I don't have a test environment set up to work through this right now but I'm sure there's someone out there who does :).

For anyone using Windows but not Visual Studio, it's even less clear to me what the idiomatic way of doing this might be.

Feature

Alternatives

Additional context

@shane-lawrence
Copy link
Contributor Author

Added a TODO comment for this here.

@FedeDP
Copy link
Contributor

FedeDP commented Jan 17, 2025

/milestone TBD

Since we are not shipping Windows artifacts, there is no hurry to fix this one.

@poiana poiana added this to the TBD milestone Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants