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