Investigate using PDB files in mingw clang builds
Categories
(Firefox Build System :: General: Unsupported Platforms, enhancement, P5)
Tracking
(firefox-esr60 fixed, firefox64 fixed)
People
(Reporter: jacek, Assigned: tjr)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 10 obsolete files)
|
12.79 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
|
3.88 KB,
patch
|
jcristau
:
approval-mozilla-esr60+
|
Details | Diff | Splinter Review |
|
9.16 KB,
patch
|
jcristau
:
approval-mozilla-esr60+
|
Details | Diff | Splinter Review |
| Reporter | ||
Comment 1•7 years ago
|
||
| Reporter | ||
Comment 2•7 years ago
|
||
Comment 4•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
Comment 6•7 years ago
|
||
| Assignee | ||
Comment 7•7 years ago
|
||
| Reporter | ||
Comment 8•7 years ago
|
||
| Reporter | ||
Comment 9•7 years ago
|
||
| Reporter | ||
Comment 10•7 years ago
|
||
| Reporter | ||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
| Reporter | ||
Comment 13•7 years ago
|
||
| Assignee | ||
Comment 14•7 years ago
|
||
| Assignee | ||
Comment 15•7 years ago
|
||
| Assignee | ||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
| Reporter | ||
Comment 18•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Comment 19•7 years ago
|
||
| Assignee | ||
Comment 20•7 years ago
|
||
Comment 21•7 years ago
|
||
| Assignee | ||
Comment 22•7 years ago
|
||
| Assignee | ||
Comment 23•7 years ago
|
||
Comment 24•7 years ago
|
||
Comment 25•7 years ago
|
||
| Assignee | ||
Comment 26•7 years ago
|
||
| Assignee | ||
Comment 27•7 years ago
|
||
Comment 28•7 years ago
|
||
| Assignee | ||
Comment 29•7 years ago
|
||
| Assignee | ||
Comment 30•7 years ago
|
||
Comment 31•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
Comment 32•7 years ago
|
||
Comment 33•7 years ago
|
||
Comment 34•7 years ago
|
||
Comment 35•7 years ago
|
||
| Assignee | ||
Comment 36•7 years ago
|
||
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
Updated•7 years ago
|
| Assignee | ||
Updated•7 years ago
|
Comment 38•7 years ago
|
||
Comment 39•7 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 40•7 years ago
|
||
| Assignee | ||
Comment 41•7 years ago
|
||
Comment on attachment 9035859 [details] [diff] [review]
Bug 1475562 - Fix check_binary to examine mingw-clang modules r=ted (esr60)
This is one of series of patches I am requesting uplift to esr60. Please don't uplift any if the entire series won't go. The whole series will need to go in one push.
This try run (applied on tip-of-esr60 as of an hour ago; and beginning with 'Bug 1491901 - move MK*SHLIB to moz.configure') represents the patch series. It must be applied in that order: https://treeherder.mozilla.org/#/jobs?repo=try&revision=0659d6e265f3b624ad6fbac0c9cd7ce246094596 (If this try run doesn't complete successfully, I will investigate and figure out why)
The uplift request form is the same for all of the patch series; see https://bugzilla.mozilla.org/show_bug.cgi?id=1491901#c10
Comment 42•7 years ago
|
||
Comment on attachment 9035859 [details] [diff] [review]
Bug 1475562 - Fix check_binary to examine mingw-clang modules r=ted (esr60)
approved for 60.5esr
Comment 43•7 years ago
|
||
| bugherder uplift | ||
| Assignee | ||
Comment 44•7 years ago
|
||
[ESR Uplift Approval Request]
If this is not a sec:{high,crit} bug, please state case for ESR consideration: We would like to generate debug pdbs for the mingw-clang builds. For simplicitly, we previously uplifted one requirement for doing this; but did not actually uplift the pdb generation.
User impact if declined: the mingw-clang builds in esr60 will require a local patch to get debugging information for them. That will be kind of annoying and mean esr60 and central will be out of sync.
Fix Landed on Version: 64.0a1 / 20181018123730
Risk to taking this patch: Low
Why is the change risky/not risky? (and alternatives if risky): This is a build-time change to mingw-clang and Windows ASAN builds.
String or UUID changes made by this patch:
Comment 45•7 years ago
|
||
Comment 46•7 years ago
|
||
| bugherder uplift | ||
Comment 47•7 years ago
|
||
I'm considering either changing/extending the -pdb option to LLD and I'm interested in your opinions.
In discussions with VLC developers, we realized a limitation with the current -pdb option to LLD; in various build systems, it might be tricky to add the option properly (when building lots of different DLLs); one can't just run configure with "LDFLAGS=-Wl,-pdb,output.pdb" because that'll clobber the same file for all DLLs that are linked.
Instead it would be nice to have an option that indicates "output a PDB, with the default name matching the dll/exe output" without having to literally specify the filename. (This would be similar to what link.exe does if you just pass -debug to it, afaik.)
The problem with the current option in the form "-pdb mymodule.pdb" is that it's impossible to make it into a form without a value.
The ways forward are either to change the form of the option into "-pdb=mymodule.pdb", to allow for a plain "-pdb" with the default behaviour, or to add a completely new option. (Are there any suggestions for a sensible option name for the latter?)
As the mingw -pdb option to LLD is specific to LLD, I don't believe it is in very widespread use yet, so you might be one of the main users so far.
What do you think?
Comment 48•7 years ago
|
||
I don't feel qualified to comment on whether breaking the existing syntax is acceptable. Maybe that should get some input from one of the LLVM lists. If it turns out to be OK, that would certainly be the simplest approach.
If a new option is needed, perhaps it could be called "-debug" to mimic link.exe, or (I don't know if the option parsing allows this) would it be possible use "-pdb=" in such a way that all of {"-pdb x.pdb", "-pdb=x.pdb", "-pdb="} are accepted?
Comment 49•7 years ago
|
||
(In reply to David Major [:dmajor] from comment #48)
I don't feel qualified to comment on whether breaking the existing syntax is acceptable. Maybe that should get some input from one of the LLVM lists. If it turns out to be OK, that would certainly be the simplest approach.
Thanks for taking the time to comment on this!
If a new option is needed, perhaps it could be called "-debug" to mimic link.exe
I don't think that's generally appropriate, because debug info in general, when it comes to the mingw linkers, is dwarf.
or (I don't know if the option parsing allows this) would it be possible use "-pdb=" in such a way that all of {"-pdb x.pdb", "-pdb=x.pdb", "-pdb="} are accepted?
That's doable with the llvm options parser, and an alternative worth considering. Thanks!
| Assignee | ||
Comment 50•7 years ago
|
||
(In reply to Martin Storsjö from comment #47)
I'm considering either changing/extending the -pdb option to LLD and I'm interested in your opinions.
In discussions with VLC developers, we realized a limitation with the current -pdb option to LLD; in various build systems, it might be tricky to add the option properly (when building lots of different DLLs); one can't just run configure with "LDFLAGS=-Wl,-pdb,output.pdb" because that'll clobber the same file for all DLLs that are linked.
Instead it would be nice to have an option that indicates "output a PDB, with the default name matching the dll/exe output" without having to literally specify the filename. (This would be similar to what link.exe does if you just pass -debug to it, afaik.)
This wwould be really nice. I had to contort to get our build system to work without clobber the output.
The problem with the current option in the form "-pdb mymodule.pdb" is that it's impossible to make it into a form without a value.
The ways forward are either to change the form of the option into "-pdb=mymodule.pdb", to allow for a plain "-pdb" with the default behaviour, or to add a completely new option. (Are there any suggestions for a sensible option name for the latter?)
As the mingw -pdb option to LLD is specific to LLD, I don't believe it is in very widespread use yet, so you might be one of the main users so far.
What do you think?
I have no preference for how you do it, but would be happy if you did =)
Comment 51•7 years ago
|
||
(In reply to Tom Ritter [:tjr] (On Leave) from comment #50)
(In reply to Martin Storsjö from comment #47)
I'm considering either changing/extending the -pdb option to LLD and I'm interested in your opinions.
In discussions with VLC developers, we realized a limitation with the current -pdb option to LLD; in various build systems, it might be tricky to add the option properly (when building lots of different DLLs); one can't just run configure with "LDFLAGS=-Wl,-pdb,output.pdb" because that'll clobber the same file for all DLLs that are linked.
Instead it would be nice to have an option that indicates "output a PDB, with the default name matching the dll/exe output" without having to literally specify the filename. (This would be similar to what link.exe does if you just pass -debug to it, afaik.)
This wwould be really nice. I had to contort to get our build system to work without clobber the output.
There's a patch evolving for passing the right options when building VLC already though, so it might on the other hand not end up necessary.
One other aspect I thought of, though: When building with autotools (as VLC uses), the linked DLLs are stored in a subdirectory named ".libs". If the build system is unaware of the generated PDBs, it'll be a bit more awkward for a user to collect the generated PDBs from such a directory, compared to them being generated in the main directory (where they aren't stored next to the real DLL though). If the built DLLs are copied somewhere via a command like "make install", that step needs to account for the PDBs as well, and at that point, the convenience of the linker pdb option is probably only a minor detail.
In your case, I guess the build system already knew how to take care of generated PDB files though?
| Assignee | ||
Comment 52•7 years ago
|
||
(In reply to Martin Storsjö from comment #51)
In your case, I guess the build system already knew how to take care of generated PDB files though?
Yes and No. Normally we build the pdbs... somewhere else. But with mingw-clang and ASAN we build them next to the binaries. We already had code for ASAN to deal with that, so I was able to repurpose that code for copying-to-output purposes; I just had to deal with the mingw-clang requirement of specifying the output dll name.
Updated•7 years ago
|
Description
•