Commit 3bc2970
committed
Improve linker-flavor detection
Linker drivers such as gcc, clang or lld often have a version postfix,
e.g clang-12. The previous logic would not account for this and would
fall back to guessing the linker flavor to be the default linker flavor
for the target, which causes linker errors when this is not the case.
By accounting for the possible version postfix and also considering
g++ and clang++, we considerably reduce the amount of times the
fallback guess has to be used.
To simplify matching check for a version postfix and match against the
linker stem without any version postfix.
In contrast to gcc, clang supports all architectures in one binary.
This means there are no variants like `aarch64-linux-gnu-clang` and
there is no need to check for `-clang` variants.1 parent 5ca6f7d commit 3bc2970
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1231 | 1231 | | |
1232 | 1232 | | |
1233 | 1233 | | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1234 | 1241 | | |
1235 | 1242 | | |
1236 | 1243 | | |
1237 | 1244 | | |
| 1245 | + | |
| 1246 | + | |
1238 | 1247 | | |
1239 | | - | |
| 1248 | + | |
1240 | 1249 | | |
1241 | 1250 | | |
1242 | 1251 | | |
| |||
0 commit comments