diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-01-27 18:43:35 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2017-01-27 18:43:35 -0800 |
commit | a2d660bf297516cf25d2891aaedf24545dd05a64 (patch) | |
tree | b967ad6cba11f6cace0e65348177b6704568bc2e | |
parent | 1e415ee0fe39cb3463f373533c0af61a4c1ab7d5 (diff) | |
download | meta-clang-a2d660bf297516cf25d2891aaedf24545dd05a64.tar.gz |
clang: Update to latest 4.0 branch and fix build with recipe specific sysroot
clang was searching for <install-dir>/../lib for target libs this started to
break when rss changed the location of cross compiler to be inside package build
dir and suddenly the prefix for target sysroot and cross compiler install path
fall under same path.
Fixes issues like
| arm-oe-linux-gnueabi-clang++ -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -mlittle-endi
an -march=armv7a -D__extern_always_inline=inline -no-integrated-as -Wno-error=unused-command-line-argu
ment --sysroot=/mnt/a/build/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-oe-linux-gnueabi/gptfdisk/1.0.1-r0/
recipe-sysroot crc32.o support.o guid.o gptpart.o mbrpart.o basicmbr.o mbr.o gpt.o bsd.o parttypes.o a
ttributes.o diskio.o diskio-unix.o cgdisk.o gptcurses.o -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -
fstack-protector-strong -Wl,-z,relro,-z,now -luuid -lncursesw -o cgdisk
| /mnt/a/build/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-oe-linux-gnueabi/gptfdisk/1.0.1-r0/recipe-sysroo
t-native/usr/bin/../lib/libncursesw.so.5: file not recognized: File format not recognized
| clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
| make: *** [Makefile:21: cgdisk] Error 1
Here it picked libncursesw.so.5 from native sysroot which is wrong for cross compile
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | recipes-devtools/clang/clang.inc | 10 | ||||
-rw-r--r-- | recipes-devtools/clang/clang/0004-clang-Do-not-search-clang-install-dir-relative-.-lib.patch | 38 | ||||
-rw-r--r-- | recipes-devtools/clang/clang_git.bb | 1 |
3 files changed, 44 insertions, 5 deletions
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 4d0e7b4..5e8f4be 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc | |||
@@ -10,11 +10,11 @@ LLVM_GIT_PROTOCOL ?= "git" | |||
10 | 10 | ||
11 | PV = "4.0.0" | 11 | PV = "4.0.0" |
12 | BRANCH = "release_40" | 12 | BRANCH = "release_40" |
13 | SRCREV_llvm = "80d55d0a78b03a6384b0364f243c645d1a57e723" | 13 | SRCREV_llvm = "50c188766385964a57d93a9db1bff024fce8dd82" |
14 | SRCREV_clang = "2574fd71cbf243821653ec56d4818bc48c2f4be7" | 14 | SRCREV_clang = "7bf54fb33971d145af18ce1ed4b7344df1d8a26f" |
15 | SRCREV_compiler-rt = "850646edf7e605354c66693c16ab69193e04a078" | 15 | SRCREV_compiler-rt = "3e677c3078269d72252faa6ec1d4b944995cb76d" |
16 | SRCREV_cxxabi = "0e46ed1f6c22968c91337aa918cdd7dc302829cb" | 16 | SRCREV_cxxabi = "c980f401c96324d8d5210fbbf9ba64154a740e7b" |
17 | SRCREV_libcxx = "39c36254e55627b5f94d37a453bf97fcd907cd38" | 17 | SRCREV_libcxx = "b53ec893f455b6b258d17f6ac99473a12cf25af9" |
18 | SRCREV_libunwind = "9f88e323c3d0926f52ab3d4a5379eefd92ff28c2" | 18 | SRCREV_libunwind = "9f88e323c3d0926f52ab3d4a5379eefd92ff28c2" |
19 | 19 | ||
20 | LLVMMD5SUM = "e825e017edc35cfd58e26116e5251771" | 20 | LLVMMD5SUM = "e825e017edc35cfd58e26116e5251771" |
diff --git a/recipes-devtools/clang/clang/0004-clang-Do-not-search-clang-install-dir-relative-.-lib.patch b/recipes-devtools/clang/clang/0004-clang-Do-not-search-clang-install-dir-relative-.-lib.patch new file mode 100644 index 0000000..91a3b67 --- /dev/null +++ b/recipes-devtools/clang/clang/0004-clang-Do-not-search-clang-install-dir-relative-.-lib.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From b6080c3e17e348464b025d34d84f5851ac9f3ba3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 27 Jan 2017 11:38:45 -0800 | ||
4 | Subject: [PATCH 4/4] clang: Do not search clang install dir relative ../lib | ||
5 | dir | ||
6 | |||
7 | This in OE is installed in native sysroot and bin/../lib | ||
8 | contains native libraries not target libs | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | lib/Driver/ToolChains.cpp | 1 - | ||
13 | 1 file changed, 1 deletion(-) | ||
14 | |||
15 | Index: clang/lib/Driver/ToolChains.cpp | ||
16 | =================================================================== | ||
17 | --- clang.orig/lib/Driver/ToolChains.cpp | ||
18 | +++ clang/lib/Driver/ToolChains.cpp | ||
19 | @@ -4221,7 +4221,7 @@ Linux::Linux(const Driver &D, const llvm | ||
20 | // directory ('Dir' below) or the ResourceDir. | ||
21 | if (StringRef(D.Dir).startswith(SysRoot)) { | ||
22 | addPathIfExists(D, D.Dir + "/../lib/" + MultiarchTriple, Paths); | ||
23 | - addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths); | ||
24 | +// addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths); | ||
25 | } | ||
26 | |||
27 | addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths); | ||
28 | @@ -4265,8 +4265,8 @@ Linux::Linux(const Driver &D, const llvm | ||
29 | // searched. | ||
30 | // FIXME: It's not clear whether we should use the driver's installed | ||
31 | // directory ('Dir' below) or the ResourceDir. | ||
32 | - if (StringRef(D.Dir).startswith(SysRoot)) | ||
33 | - addPathIfExists(D, D.Dir + "/../lib", Paths); | ||
34 | + //if (StringRef(D.Dir).startswith(SysRoot)) | ||
35 | + // addPathIfExists(D, D.Dir + "/../lib", Paths); | ||
36 | |||
37 | addPathIfExists(D, SysRoot + "/lib", Paths); | ||
38 | addPathIfExists(D, SysRoot + "/usr/lib", Paths); | ||
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index b5331fb..218571f 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
@@ -22,6 +22,7 @@ SRC_URI = "${LLVM_GIT}/llvm.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};n | |||
22 | file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch;patchdir=tools/clang \ | 22 | file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch;patchdir=tools/clang \ |
23 | file://0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch;patchdir=tools/clang \ | 23 | file://0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch;patchdir=tools/clang \ |
24 | file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \ | 24 | file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \ |
25 | file://0004-clang-Do-not-search-clang-install-dir-relative-.-lib.patch;patchdir=tools/clang \ | ||
25 | " | 26 | " |
26 | 27 | ||
27 | SRCREV_FORMAT = "llvm_clang" | 28 | SRCREV_FORMAT = "llvm_clang" |