Commit a0579bc
committed
tc_build: tools: Check for multicall binary in find_host_cc()
There are two minor problems with find_host_cc() when using a multicall
binary setup.
The first is calling .resolve() on a multicall binary, which breaks the
multicall setup because the symlink is how the multicall binary works in
the first place. Avoid calling .resolve() in the case of multicall
binaries.
The second is clang-<ver> is not present in a multicall setup, so a
versioned binary from elsewhere in PATH can be chosen before a multicall
binary because plain clang is checked after the versioned binaries.
Check if the first clang in PATH is a multicall binary and use it if so.
Otherwise, fallback to looking at versioned binaries first then the
unversioned clang so that newer versions of clang, such as those from
apt.llvm.org, are chosen first.
While in the area, use an else branch for the for loop that looks for
compilers, saving a couple lines and a cc check.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>1 parent 25bb27e commit a0579bc
1 file changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
50 | 64 | | |
51 | | - | |
52 | | - | |
| 65 | + | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
| |||
0 commit comments