summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-devtools/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-devtools/llvm')
-rw-r--r--poky/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch41
-rw-r--r--poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch47
-rw-r--r--poky/meta/recipes-devtools/llvm/llvm_git.bb18
3 files changed, 49 insertions, 57 deletions
diff --git a/poky/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch b/poky/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch
deleted file mode 100644
index 2809e4c59..000000000
--- a/poky/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 7f7743ce233fcd735ec580c75270413493658aa6 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 19 Apr 2018 18:08:31 -0700
-Subject: [PATCH] Disable generating a native llvm-config
-
-OpenEmbedded already builds this as part of llvm-native
-
-Upstream-Status: Inappropriate [OE-Specific]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- tools/llvm-config/CMakeLists.txt | 16 ----------------
- 1 file changed, 16 deletions(-)
-
-diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
-index 25f99cec978..c45e9b642a8 100644
---- a/tools/llvm-config/CMakeLists.txt
-+++ b/tools/llvm-config/CMakeLists.txt
-@@ -63,19 +63,3 @@ endif()
-
- # Add the dependency on the generation step.
- add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH})
--
--if(CMAKE_CROSSCOMPILING)
-- set(${project}_LLVM_CONFIG_EXE "${LLVM_NATIVE_BUILD}/bin/llvm-config")
-- set(${project}_LLVM_CONFIG_EXE ${${project}_LLVM_CONFIG_EXE} PARENT_SCOPE)
--
-- add_custom_command(OUTPUT "${${project}_LLVM_CONFIG_EXE}"
-- COMMAND ${CMAKE_COMMAND} --build . --target llvm-config --config $<CONFIGURATION>
-- DEPENDS ${LLVM_NATIVE_BUILD}/CMakeCache.txt
-- WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
-- COMMENT "Building native llvm-config..."
-- USES_TERMINAL)
-- add_custom_target(${project}NativeLLVMConfig DEPENDS ${${project}_LLVM_CONFIG_EXE})
-- add_dependencies(${project}NativeLLVMConfig CONFIGURE_LLVM_NATIVE)
--
-- add_dependencies(llvm-config ${project}NativeLLVMConfig)
--endif(CMAKE_CROSSCOMPILING)
---
-2.17.0
-
diff --git a/poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch b/poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch
index 21d2f81b5..6a9283323 100644
--- a/poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch
+++ b/poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch
@@ -1,4 +1,4 @@
-From 2f8ea767afdaa440c6368040630e1b3ea6a0977a Mon Sep 17 00:00:00 2001
+From aeccf16eaccdd80e4d5ecaa51673ce4b2bac1130 Mon Sep 17 00:00:00 2001
From: Martin Kelly <mkelly@xevo.com>
Date: Fri, 19 May 2017 00:22:57 -0700
Subject: [PATCH 2/2] llvm: allow env override of exe path
@@ -8,16 +8,19 @@ return the libraries, include directories, etc. from inside the sysroot rather
than from the native sysroot. Thus provide an env override for calling
llvm-config from a target sysroot.
+To let it work in multilib environment, we need to provide a knob to supply
+multilib dirname as well
+
+Upstream-Status: Inappropriate [OE-Specific]
+
Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
-Upstream-Status: Pending
-
- tools/llvm-config/llvm-config.cpp | 7 +++++++
- 1 file changed, 7 insertions(+)
+ tools/llvm-config/llvm-config.cpp | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index 08b096afb05..d8d7742744e 100644
+index 08b096afb05..360cc5abf4e 100644
--- a/tools/llvm-config/llvm-config.cpp
+++ b/tools/llvm-config/llvm-config.cpp
@@ -225,6 +225,13 @@ Typical components:\n\
@@ -34,6 +37,36 @@ index 08b096afb05..d8d7742744e 100644
// This just needs to be some symbol in the binary; C++ doesn't
// allow taking the address of ::main however.
void *P = (void *)(intptr_t)GetExecutablePath;
+@@ -306,12 +313,20 @@ int main(int argc, char **argv) {
+ std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
+ ActiveCMakeDir;
+ std::string ActiveIncludeOption;
++ // Hack for Yocto: we need to override the multilib path when we are using
++ // llvm-config from within a target sysroot.
++ std::string Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");
++ if (Multilibdir.empty()) {
++ Multilibdir = "/lib" LLVM_LIBDIR_SUFFIX;
++ }
++
+ if (IsInDevelopmentTree) {
+ ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
+ ActivePrefix = CurrentExecPrefix;
+
+ // CMake organizes the products differently than a normal prefix style
+ // layout.
++
+ switch (DevelopmentTreeLayout) {
+ case CMakeStyle:
+ ActiveBinDir = ActiveObjRoot + "/bin";
+@@ -336,7 +351,7 @@ int main(int argc, char **argv) {
+ SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+ sys::fs::make_absolute(ActivePrefix, path);
+ ActiveBinDir = path.str();
+- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
++ ActiveLibDir = ActivePrefix + Multilibdir;
+ ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
--
-2.16.1
+2.18.0
diff --git a/poky/meta/recipes-devtools/llvm/llvm_git.bb b/poky/meta/recipes-devtools/llvm/llvm_git.bb
index cb3bba6fa..727876303 100644
--- a/poky/meta/recipes-devtools/llvm/llvm_git.bb
+++ b/poky/meta/recipes-devtools/llvm/llvm_git.bb
@@ -19,14 +19,13 @@ PROVIDES += "llvm${PV}"
LLVM_RELEASE = "${PV}"
LLVM_DIR = "llvm${LLVM_RELEASE}"
-SRCREV = "089d4c0c490687db6c75f1d074e99c4d42936a50"
+SRCREV = "5136df4d089a086b70d452160ad5451861269498"
PV = "6.0"
BRANCH = "release_60"
-PATCH_VERSION = "0"
+PATCH_VERSION = "1"
SRC_URI = "git://github.com/llvm-mirror/llvm.git;branch=${BRANCH};protocol=http \
file://0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \
file://0002-llvm-allow-env-override-of-exe-path.patch \
- file://0001-Disable-generating-a-native-llvm-config.patch \
"
UPSTREAM_CHECK_COMMITS = "1"
S = "${WORKDIR}/git"
@@ -45,14 +44,13 @@ def get_llvm_arch(bb, d, arch_var):
else:
raise bb.parse.SkipRecipe("Cannot map '%s' to a supported LLVM architecture" % a)
-def get_llvm_target_arch(bb, d):
- return get_llvm_arch(bb, d, 'TARGET_ARCH')
+def get_llvm_host_arch(bb, d):
+ return get_llvm_arch(bb, d, 'HOST_ARCH')
+
#
# Default to build all OE-Core supported target arches (user overridable).
#
-LLVM_TARGETS ?= "${@get_llvm_target_arch(bb, d)}"
-LLVM_TARGETS_prepend_x86 = "AMDGPU;"
-LLVM_TARGETS_prepend_x86-64 = "AMDGPU;"
+LLVM_TARGETS ?= "AMDGPU;${@get_llvm_host_arch(bb, d)}"
ARM_INSTRUCTION_SET_armv5 = "arm"
ARM_INSTRUCTION_SET_armv4t = "arm"
@@ -65,17 +63,19 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_FFI=ON \
-DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
- -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS}" \
+ -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS}' \
-G Ninja"
EXTRA_OECMAKE_append_class-target = "\
-DCMAKE_CROSSCOMPILING:BOOL=ON \
-DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \
+ -DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \
"
EXTRA_OECMAKE_append_class-nativesdk = "\
-DCMAKE_CROSSCOMPILING:BOOL=ON \
-DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \
+ -DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \
"
do_configure_prepend() {
OpenPOWER on IntegriCloud