From a2d660bf297516cf25d2891aaedf24545dd05a64 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 27 Jan 2017 18:43:35 -0800 Subject: clang: Update to latest 4.0 branch and fix build with recipe specific sysroot clang was searching for /../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 --- recipes-devtools/clang/clang.inc | 10 +++--- ...t-search-clang-install-dir-relative-.-lib.patch | 38 ++++++++++++++++++++++ recipes-devtools/clang/clang_git.bb | 1 + 3 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 recipes-devtools/clang/clang/0004-clang-Do-not-search-clang-install-dir-relative-.-lib.patch 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" PV = "4.0.0" BRANCH = "release_40" -SRCREV_llvm = "80d55d0a78b03a6384b0364f243c645d1a57e723" -SRCREV_clang = "2574fd71cbf243821653ec56d4818bc48c2f4be7" -SRCREV_compiler-rt = "850646edf7e605354c66693c16ab69193e04a078" -SRCREV_cxxabi = "0e46ed1f6c22968c91337aa918cdd7dc302829cb" -SRCREV_libcxx = "39c36254e55627b5f94d37a453bf97fcd907cd38" +SRCREV_llvm = "50c188766385964a57d93a9db1bff024fce8dd82" +SRCREV_clang = "7bf54fb33971d145af18ce1ed4b7344df1d8a26f" +SRCREV_compiler-rt = "3e677c3078269d72252faa6ec1d4b944995cb76d" +SRCREV_cxxabi = "c980f401c96324d8d5210fbbf9ba64154a740e7b" +SRCREV_libcxx = "b53ec893f455b6b258d17f6ac99473a12cf25af9" SRCREV_libunwind = "9f88e323c3d0926f52ab3d4a5379eefd92ff28c2" 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 @@ +From b6080c3e17e348464b025d34d84f5851ac9f3ba3 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 27 Jan 2017 11:38:45 -0800 +Subject: [PATCH 4/4] clang: Do not search clang install dir relative ../lib + dir + +This in OE is installed in native sysroot and bin/../lib +contains native libraries not target libs + +Signed-off-by: Khem Raj +--- + lib/Driver/ToolChains.cpp | 1 - + 1 file changed, 1 deletion(-) + +Index: clang/lib/Driver/ToolChains.cpp +=================================================================== +--- clang.orig/lib/Driver/ToolChains.cpp ++++ clang/lib/Driver/ToolChains.cpp +@@ -4221,7 +4221,7 @@ Linux::Linux(const Driver &D, const llvm + // directory ('Dir' below) or the ResourceDir. + if (StringRef(D.Dir).startswith(SysRoot)) { + addPathIfExists(D, D.Dir + "/../lib/" + MultiarchTriple, Paths); +- addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths); ++// addPathIfExists(D, D.Dir + "/../" + OSLibDir, Paths); + } + + addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths); +@@ -4265,8 +4265,8 @@ Linux::Linux(const Driver &D, const llvm + // searched. + // FIXME: It's not clear whether we should use the driver's installed + // directory ('Dir' below) or the ResourceDir. +- if (StringRef(D.Dir).startswith(SysRoot)) +- addPathIfExists(D, D.Dir + "/../lib", Paths); ++ //if (StringRef(D.Dir).startswith(SysRoot)) ++ // addPathIfExists(D, D.Dir + "/../lib", Paths); + + addPathIfExists(D, SysRoot + "/lib", Paths); + 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 file://0001-clang-driver-Use-lib-for-ldso-on-OE.patch;patchdir=tools/clang \ file://0002-clang-Driver-tools.cpp-Add-lssp-and-lssp_nonshared-o.patch;patchdir=tools/clang \ file://0003-clang-musl-ppc-does-not-support-128-bit-long-double.patch;patchdir=tools/clang \ + file://0004-clang-Do-not-search-clang-install-dir-relative-.-lib.patch;patchdir=tools/clang \ " SRCREV_FORMAT = "llvm_clang" -- cgit v1.2.3-54-g00ecf