Clang link debug_info in executable on OSX

谁说胖子不能爱 提交于 2019-12-11 06:08:51

问题


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?

来源:https://stackoverflow.com/questions/49083800/clang-link-debug-info-in-executable-on-osx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!