如何合并多个PDB文件? [英] How do I merge multiple PDB files?
问题描述
我们目前使用单一的命令行工具在Windows和Linux上构建我们的产品。
We are currently using a single command line tool to build our product on both Windows and Linux.
Si far的工作原理很好,允许我们构建源代码并且具有比我们以前的构建系统允许的更高的依赖性。
Si far its works nicely, allowing us to build out of source and with finer dependencies than what any of our previous build system allowed. This buys us great incremental and parallel build capabilities.
为了描述构建过程,我们得到了通常的结果:
To describe shortly the build process, we get the usual:
.cpp -- cl.exe --> .obj and .pdb
multiple .obj and .pdb -- cl.exe --> single .dll .lib .pdb
multiple .obj and .pdb -- cl.exe --> single .exe .pdb
msvc C / C ++编译器可以充分支持它。
The msvc C/C++ compiler supports it adequately.
最近需要构建一些静态库。
从我们收集的,构建一个静态库的过程是:
Recently the need to build a few static libraries emerged. From what we gathered, the process to build a static library is:
multiple .cpp -- cl.exe --> multiple .obj and a single .pdb
multiple .obj -- lib.exe --> a single .lib
单个.pdb意味着 cl.exe
应该只对所有.cpp源执行一次。这个单独的执行意味着我们不能并行化这个静态库的构建。这真的很不幸。
The single .pdb means that cl.exe
should only be executed once for all the .cpp sources. This single execution means that we can't parallelize the build for this static library. This is really unfortunate.
我们进一步调查并根据文档(和可用的命令行选项):
We investigated a bit further and according to the documentation (and the available command line options):
-
cl.exe
不知道如何构建静态库 -
lib.exe
不知道如何构建.pdb文件
cl.exe
does not know how to build static librarieslib.exe
does not know how to build .pdb files
合并多个PDB文件?我们注定要为静态库减慢构建速度吗?如何使用工具如Incredibuild解决这个问题?
Does anybody know a way to merge multiple PDB files ? Are we doomed to have slow builds for static libraries ? How do tools like Incredibuild work around this issue ?
推荐答案
我没有做C ++很长时间, href =http://blogs.msdn.com/b/vcblog/archive/2014/03/05/shrink-my-program-database-pdb-file.aspx =nofollow noreferrer>文章,看起来这是一个性能技巧,停止重用公共头的符号。
I've not done C++ for a long time but from this article, it appears that this is a performance trick to stop the recreation of symbols for common headers.
您可以尝试/ Z7在每个obj中嵌入信息,而不是创建一个PDB,然后链接并使用rebase重新创建它,如 article 。
You could try /Z7 to embed info in each obj, and not create a PDB and then link and recreate it with a rebase as in this article.
这篇关于如何合并多个PDB文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!