This is an archive of the discontinued LLVM Phabricator instance.

[Compiler-RT] On Apple Platforms switch to always emitting full debug info
ClosedPublic

Authored by delcypher on Aug 4 2021, 2:46 PM.

Details

Summary

Previously the build used -gline-tables-only when COMPILER_RT_DEBUG
was off (default) and -g when COMPILER_RT_DEBUG was on. The end
result of this meant that the release build of the Sanitizer runtimes
were difficult to debug (e.g. information about variables and function
arguments were missing).

Presumably the reason for preferring -gline-tables-only for release
builds was to save space. However, for Apple platforms this doesn't
matter because debug info lives in separate .dSYM files (which aren't
shipped) rather than in the shipped .dylib files.

Now on Apple platforms we always emit full debug info if the compiler
supports it and we emit a fatal error if -g isn't supported.

rdar://79223184

Diff Detail

Event Timeline

delcypher created this revision.Aug 4 2021, 2:46 PM
delcypher requested review of this revision.Aug 4 2021, 2:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2021, 2:46 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

How come we emit a fatal error if -g isn’t supported?

How come we emit a fatal error if -g isn’t supported?

@aralisza
Because I don't want to silently drop debug info. All compilers I'm aware of actually used to build on Apple platforms should support it. If it causes problems we can remove the check.

aralisza accepted this revision.Aug 4 2021, 4:25 PM

Sounds good to me

This revision is now accepted and ready to land.Aug 4 2021, 4:25 PM