On some setups (Solaris), clang-repl attempts to enable out-of-process
execution,
but fails to locate the ORC runtime due to a mismatch between the
toolchain’s
expected compiler-rt path and the actual on-disk layout.
Specifically, ToolChain::getCompilerRT() relies on
getArchNameForCompilerRTLib(),
which returns an architecture name that does not match the Solaris
compiler-rt
directory naming. As a result, the ORC runtime (orc_rt) is not detected
at the
correct path, even though it exists under
lib/clang/<version>/lib/sunos/.
As an initial workaround, special-case Solaris in
getArchNameForCompilerRTLib() to return "sunos", aligning the expected
path with
the system layout and preventing clang-repl from attempting
out-of-process
execution on Solaris.
Note that compiler-rt libraries on Solaris are suffixed with -<arch>
(e.g.
liborc_rt-x86_64.a) to support multilib configurations, which is not yet
fully
handled by the current lookup logic. A more complete solution will
require
revisiting compiler-rt path resolution for Solaris.
The discussion is available here:
https://github.com/llvm/llvm-project/pull/175322