This is an archive of the discontinued LLVM Phabricator instance.

Align LLVM_EXTERNALIZE_DEBUGINFO behaviours on Linux w/ Darwin
Needs ReviewPublic

Authored by directhex on Oct 13 2021, 10:10 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Despite what it says in the documentation[1], LLVM_EXTERNALIZE_DEBUGINFO is not only for Darwin, and has been functional on Linux since 2017[2].

However, It is hardcoded to emit ${name}.debug in the same directory, whereas macOS allows overriding both the extension and the output dir.

This commit adds support for LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION and LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR on Linux.

[1] https://www.llvm.org/docs/CMake.html#llvm-related-variables
[2] https://reviews.llvm.org/D28575

Diff Detail

Event Timeline

directhex created this revision.Oct 13 2021, 10:10 AM
directhex requested review of this revision.Oct 13 2021, 10:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2021, 10:10 AM

This fails when cross-compiling, and needs changes.

Hm, the cross compiler case can be handled by passing a path to an arch-appropriate objcopy/strip binary with CMAKE_OBJCOPY/CMAKE_STRIP, i'm not sure it's worth trying to do some kind of magical auto-handling in lieu of letting the user provide the correct binaries.