Michal Rostecki ec4e0f71bc llvm-runtimes/libcxxabi: Support build with cross emerge wrapper
When cross emerge wrapper is used, using `llvm_prepend_path` without
any options, results in prepending the following path:

```
${ESYSROOT}/usr/lib/llvm/${slot}/bin
```

For example:

```
/usr/aarch64-unknown-linux-musl/usr/lib/llvm/19/bin
```

The problem is that cross emerge wrapper uses a cross clang wrapper as
a compiler, e.g. `aarch64-unknown-linux-musl-clang`. However, the file
with such name can be usually found in two places:

* `/usr/lib/llvm/19/bin/aarch64-unknown-linux-musl-clang`, which is
  a clang wrapper that calls the host clang with appropriate
  configuration. We want to call that file.
* `/usr/aarch64-unknown-linux-musl/usr/lib/llvm/19/bin/aarch64-unknown-linux-musl-clang`,
  which is an actual aarch64 compiler binary. We cannot execute it on
  x86_64, or other incompatible host.

However, the path added by `llvm_prepend_path` causes resolution of
`aarch64-unknown-linux-musl-clang` to the second path, therefore causing
errors like:

```
/usr/aarch64-unknown-linux-musl/usr/lib/llvm/19/bin/clang: cannot execute binary file: Exec format error
```

Solve that by:

* Using `LLVM_ROOT` CMake parameter to point the build to LLVM library
  artifacts.
* Using `llvm_prepend_path` with `-b` argument if we need clang, which
  is the case when either `clang` or `test` USE flags are enabled.

Signed-off-by: Michal Rostecki <vadorovsky@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/39280
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/39280
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2025-08-06 14:29:18 +02:00
2025-08-02 19:16:45 +02:00
2025-08-02 19:16:45 +02:00
2025-08-05 15:53:28 -04:00
2025-08-01 09:26:45 +03:00
2025-08-05 08:58:32 +03:00
2025-08-03 15:26:56 +02:00
2025-08-03 11:50:01 -04:00
2025-08-01 19:55:58 +02:00
2025-08-05 15:53:30 -04:00
2025-07-12 13:34:20 +02:00
2025-08-06 03:27:22 +01:00
2025-08-05 11:34:11 +02:00
2025-08-05 15:53:28 -04:00
2025-08-06 03:27:22 +01:00
2025-07-29 18:41:11 -04:00
2025-07-30 13:59:48 +03:00
2025-08-06 06:20:29 +01:00
2025-08-03 11:07:10 +02:00
2025-07-25 11:54:53 +03:00
2025-08-03 03:41:46 -04:00
2025-08-06 05:06:01 +01:00
2025-07-29 00:45:58 +02:00
2025-08-04 22:22:41 +01:00
2025-07-27 20:48:03 +03:00
2025-07-30 18:57:02 +02:00
2025-07-23 21:40:44 +01:00
2025-07-27 20:35:30 +03:00
2025-08-01 09:44:04 +02:00
2025-07-28 18:55:52 +02:00
2025-08-04 11:26:41 +02:00
2025-08-06 06:01:55 +01:00
2025-08-02 19:41:56 +02:00
2025-07-27 10:48:31 +02:00
2025-08-02 20:03:05 +08:00
2025-08-04 20:41:02 +02:00
2025-08-05 11:34:13 +02:00
2025-08-01 14:41:07 +02:00
…
S
Description
No description provided
9.8 GiB
Languages
Shell 98%
Roff 1.4%
Emacs Lisp 0.2%
C 0.1%