In LLVM unified builds `%swift_obj_root` points to `<LLVM build dir>/tools/swift`,
and folders like `bin`, `lib` and `share` are not under `swift_obj_root`, which
makes some tests fail.
For the cases in which `%swift_obj_root/lib` was used, replace it by
using `%swift-lib-dir` instead. Replicate `%swift-lib-dir` to create
`%swift-bin-dir` and `%swift-share-dir`, and use those instead of
`%swift_obj_root/bin` and `%swift_obj_root/share`.
This alternates work both in Swift build-script builds and also in LLVM
unified builds.
`remote-run` should look in the environment for input/output paths as
well as considering command line arguments.
With this change, `test/Runtime/Paths.cpp` should work for remote testing
and device testing.
rdar://106294557
We need to be able to locate `swift-backtrace` relative to the current
location of the runtime library.
This needs to work:
* In a Swift build directory.
* On Darwin, where we're installed in /usr/lib/swift and /usr/libexec/swift.
* On Linux, where we're in /usr/lib/swift/linux and /usr/libexec/swift/linux.
* On Windows, where we may be in a flat directory layout (because of limitations
of Windows DLL lookups).
rdar://103071801