Prevent compilation from dSYM generation on OS X (using make)

I have a C ++ (open source) project that by default is not required to disable debugging symbols. With a lot of test executables, there are many dSYM files generated in OS X. I tried -g3 as the g ++ flag to no avail. Ideas?

Thanks! Juan

+4
source share
3 answers

As Ted Mielcharek noted, gcc does not create dSYM files on its own, it simply stores the information needed to create them in object files. If you use make to create your project, most likely there will be a separate step in the make file that dsymutil launches after compiling / linking the executable file, see if you can find and delete it.

+3
source

Are you going with Xcode? GCC does not create .dSYM files; Xcode runs dsyumutil to create them. In my (obsolete) Xcode 3.2.3 under "Project Settings", "Build Settings" → "Debugging Format" you can select "DWARF with dSYM file" or just "DWARF". The latter should not lead to the creation of dSYM.

However, note that with the Apple toolchain, DWARF is located in .o files and does not bind to the final binary. (GDB knows how to find it, but it needs .o files lying on the disk.) If you are going to send binary files to someone else, you really need to create dSYM to send them along with the binary code.

+1
source

If you compile the -g flag, remove it.

0
source

Source: https://habr.com/ru/post/1337771/


All Articles