Clang link debug_info in executable on OSX

2019-07-22 14:09发布

On OSX when you link a binary from multiple object files like this

clang++ -g myfile.cpp -o myfile.o
clang++ myfile.o -shared -o myfile.dylib

it will generate a .debug_info section (etc.) in myfile.o but in myfile.dylib it just stores a reference to myfile.o and you have to run dsymutil myfile.dylib manually. dsymutil links all the .debug_info sections from the object files together and stores them in a myfile.dylib.dSYM bundle.

My question is: is there a way to make Clang actually link the debug info during compilation and store it directly in myfile.dylib?

Or if that is not possible, is it possible to embed the .dSYM bundle inside the .dylib after it has been generated?

0条回答
登录 后发表回答