开发者

prevent compiling from generating dSYM on OS X (using make)

开发者 https://www.devze.com 2023-02-08 04:03 出处:网络
I\'ve got a c++ project (open source) that does not need to strip debugging symbols by default. With a lot of test executables, there are a lot of开发者_JAVA技巧 dSYM files generated on OS X. I\'ve tr

I've got a c++ project (open source) that does not need to strip debugging symbols by default. With a lot of test executables, there are a lot of开发者_JAVA技巧 dSYM files generated on OS X. I've tried -g3 as a g++ flag to no avail. Ideas?

Thanks! Juan


If you're compiling with the "-g" flag, remove it.


As Ted Mielczarek pointed out, gcc does not produce dSYM files on its own, it simply stores the information needed to produce them in the object files. If you're using make to build your project, it is most likely that there is a separate step in the makefile which runs dsymutil after compiling/linking the executable, see if you can find and remove it.


Are you compiling via XCode? GCC does not produce .dSYM files, XCode runs dsyumutil to generate them. In my (outdated) XCode 3.2.3, under Project Settings, Build Options -> Debug Information Format, you can choose "DWARF with dSYM File" or just "DWARF". The latter should not result in a dSYM being produced.

However, note that with Apple's toolchain, the DWARF resides in the .o files, and does not get linked into the final binary. (GDB knows how to find it, but it needs the .o files laying around on disk.) If you intend to send the binaries to someone else, you really do need to produce a dSYM to send them along with the binary.

0

精彩评论

暂无评论...
验证码 换一张
取 消