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

debug info issues when linking libc on mingw #2951

Closed
emekoi opened this issue Jul 27, 2019 · 4 comments
Closed

debug info issues when linking libc on mingw #2951

emekoi opened this issue Jul 27, 2019 · 4 comments
Milestone

Comments

@emekoi
Copy link
Contributor

emekoi commented Jul 27, 2019

when linking to libc on mingw-w64 lld places the pdb info in the .buildid rather than .rdata. this breaks stack traces and debug info parsing on mingw-w64. another possible interesting area of research is that lld seems to support outputting DWARF debug info for windows. perhaps for debug builds on windows we could try finding some way to output both types of debug info.

@emekoi
Copy link
Contributor Author

emekoi commented Jul 27, 2019

the easiest workaround would appear to be removing this line, but i'm not sure if this introduces intended behavior. yep, lld can't link without it.

@andrewrk andrewrk added this to the 0.6.0 milestone Jul 29, 2019
@andrewrk
Copy link
Member

This is the code choosing CodeView instead of DWARF:

zig/src/codegen.cpp

Lines 8004 to 8008 in bc982e6

if (target_object_format(g->zig_target) == ZigLLVM_COFF) {
ZigLLVMAddModuleCodeViewFlag(g->module);
} else {
ZigLLVMAddModuleDebugInfoFlag(g->module);
}

@Sahnvour
Copy link
Contributor

Sahnvour commented Aug 3, 2019

Looking at why they do it this way, it's quite a special case llvm-mirror/lld@9722f66.

@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Feb 10, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Oct 30, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Jun 4, 2021
@andrewrk
Copy link
Member

Would be happy to accept reasonable PRs for mingw compat but it is not one of the supported targets of Zig, so I don't want to have issues open for it.

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

4 participants