diff options
-rw-r--r-- | recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch | 44 | ||||
-rw-r--r-- | recipes-devtools/clang/common.inc | 1 |
2 files changed, 45 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch b/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch new file mode 100644 index 0000000..5edf8ad --- /dev/null +++ b/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From fa44b5037ceac5d201b5ab0395ec9c5b928f79bf Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 4 Dec 2019 11:50:09 -0800 | ||
4 | Subject: [PATCH] llvm: Let llvm-ar name contain 'lib' | ||
5 | |||
6 | In cross-compile cases canonical names are created using symlinks but | ||
7 | they fail to execute because the name confuses 'lib' instead of toolname | ||
8 | |||
9 | In multilib(lib32) case, the arm-pokymllib32-linux-gnueabi-llvm-ar (${TARGET_PREFIX}llvm-ar) gives: | ||
10 | qc: no such file or directory | ||
11 | |||
12 | Which is because when the llvm-ar symbol link's name contains "lib", it would be considered as llvm-lib: | ||
13 | |||
14 | Signed-off-by: Michael Davis <michael.davis@essvote.com> | ||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | llvm/tools/llvm-ar/llvm-ar.cpp | 8 ++++---- | ||
18 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
19 | |||
20 | diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp | ||
21 | index 91746d0fab3..daef39ede79 100644 | ||
22 | --- a/llvm/tools/llvm-ar/llvm-ar.cpp | ||
23 | +++ b/llvm/tools/llvm-ar/llvm-ar.cpp | ||
24 | @@ -1125,16 +1125,16 @@ int main(int argc, char **argv) { | ||
25 | llvm::InitializeAllAsmParsers(); | ||
26 | |||
27 | Stem = sys::path::stem(ToolName); | ||
28 | - if (Stem.contains_lower("dlltool")) | ||
29 | + if (Stem.endswith("dlltool") || Stem.contains("dlltool-")) | ||
30 | return dlltoolDriverMain(makeArrayRef(argv, argc)); | ||
31 | |||
32 | - if (Stem.contains_lower("ranlib")) | ||
33 | + if (Stem.endswith("ranlib") || Stem.contains("ranlib-")) | ||
34 | return ranlib_main(argc, argv); | ||
35 | |||
36 | - if (Stem.contains_lower("lib")) | ||
37 | + if (Stem.endswith("lib") || Stem.contains("lib-")) | ||
38 | return libDriverMain(makeArrayRef(argv, argc)); | ||
39 | |||
40 | - if (Stem.contains_lower("ar")) | ||
41 | + if (Stem.endswith("ar") || Stem.contains("ar-")) | ||
42 | return ar_main(argc, argv); | ||
43 | fail("Not ranlib, ar, lib or dlltool!"); | ||
44 | } | ||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 3f50fd0..c5e8d48 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -32,6 +32,7 @@ SRC_URI = "\ | |||
32 | file://0022-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ | 32 | file://0022-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ |
33 | file://0023-openmp-Recognise-ARMv7ve-machine-arch.patch \ | 33 | file://0023-openmp-Recognise-ARMv7ve-machine-arch.patch \ |
34 | file://0024-Check-for-atomic-double-intrinsics.patch \ | 34 | file://0024-Check-for-atomic-double-intrinsics.patch \ |
35 | file://0025-llvm-Let-llvm-ar-name-contain-lib.patch \ | ||
35 | " | 36 | " |
36 | 37 | ||
37 | # Fallback to no-PIE if not set | 38 | # Fallback to no-PIE if not set |