diff options
| author | Khem Raj <raj.khem@gmail.com> | 2017-08-16 15:51:39 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2017-08-16 15:51:39 -0700 |
| commit | 0383b374ef8e328de9622505e508950d4d4d2596 (patch) | |
| tree | 0b50f596f94e0ac27bdd75883481075c2832af85 /recipes-devtools | |
| parent | cf62c51dbcda770a106e040483f13de057e62733 (diff) | |
| download | meta-clang-0383b374ef8e328de9622505e508950d4d4d2596.tar.gz | |
clang: Fix dynamic linker on x86/musl
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-devtools')
| -rw-r--r-- | recipes-devtools/clang/clang/0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch | 41 | ||||
| -rw-r--r-- | recipes-devtools/clang/common.inc | 1 |
2 files changed, 42 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch b/recipes-devtools/clang/clang/0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch new file mode 100644 index 0000000..51970e8 --- /dev/null +++ b/recipes-devtools/clang/clang/0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | From cdae04d9e1950f07e89ea5aa8eed7ed7ce6b7938 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 16 Aug 2017 15:16:15 -0700 | ||
| 4 | Subject: [PATCH] clang: Fix ldso for musl on x86 and x32 architectures | ||
| 5 | |||
| 6 | x32 linker is called ld-musl-x32.so.1 and x86 linker | ||
| 7 | is called ld-musl-i386.so.1, Currently, linker for | ||
| 8 | x86 is returned as ld-musl-i586.so.1, when default | ||
| 9 | arch is i586, which is not the right thing | ||
| 10 | |||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | --- | ||
| 13 | lib/Driver/ToolChains/Linux.cpp | 7 +++++++ | ||
| 14 | 1 file changed, 7 insertions(+) | ||
| 15 | |||
| 16 | Index: clang/lib/Driver/ToolChains/Linux.cpp | ||
| 17 | =================================================================== | ||
| 18 | --- clang.orig/lib/Driver/ToolChains/Linux.cpp | ||
| 19 | +++ clang/lib/Driver/ToolChains/Linux.cpp | ||
| 20 | @@ -422,6 +422,7 @@ std::string Linux::getDynamicLinker(cons | ||
| 21 | if (Triple.isMusl()) { | ||
| 22 | std::string ArchName; | ||
| 23 | bool IsArm = false; | ||
| 24 | + bool isX32 = false; | ||
| 25 | |||
| 26 | switch (Arch) { | ||
| 27 | case llvm::Triple::arm: | ||
| 28 | @@ -434,6 +435,13 @@ std::string Linux::getDynamicLinker(cons | ||
| 29 | ArchName = "armeb"; | ||
| 30 | IsArm = true; | ||
| 31 | break; | ||
| 32 | + case llvm::Triple::x86: | ||
| 33 | + ArchName = "i386"; | ||
| 34 | + break; | ||
| 35 | + case llvm::Triple::x86_64: | ||
| 36 | + isX32 = Triple.getEnvironment() == llvm::Triple::GNUX32; | ||
| 37 | + ArchName = isX32 ? "x32" : Triple.getArchName().str(); | ||
| 38 | + break; | ||
| 39 | default: | ||
| 40 | ArchName = Triple.getArchName().str(); | ||
| 41 | } | ||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index f5e7acb..93463b7 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
| @@ -18,6 +18,7 @@ CLANGPATCHES = "\ | |||
| 18 | file://0004-clang-Prepend-trailing-to-sysroot.patch;patchdir=tools/clang \ | 18 | file://0004-clang-Prepend-trailing-to-sysroot.patch;patchdir=tools/clang \ |
| 19 | file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch;patchdir=tools/clang \ | 19 | file://0005-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch;patchdir=tools/clang \ |
| 20 | file://0006-clang-Define-releative-gcc-installation-dir.patch;patchdir=tools/clang \ | 20 | file://0006-clang-Define-releative-gcc-installation-dir.patch;patchdir=tools/clang \ |
| 21 | file://0008-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch;patchdir=tools/clang \ | ||
| 21 | " | 22 | " |
| 22 | CLANGPATCHES += "${@'file://0007-clang-Enable-SSP-and-PIE-by-default.patch;patchdir=tools/clang' if '${GCCPIE}' else ''}" | 23 | CLANGPATCHES += "${@'file://0007-clang-Enable-SSP-and-PIE-by-default.patch;patchdir=tools/clang' if '${GCCPIE}' else ''}" |
| 23 | 24 | ||
