aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amdfalconx86/recipes-core/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amdfalconx86/recipes-core/llvm')
-rw-r--r--meta-amdfalconx86/recipes-core/llvm/files/0001-force-link-pass.o.patch42
-rw-r--r--meta-amdfalconx86/recipes-core/llvm/llvm3.7.0.inc49
-rw-r--r--meta-amdfalconx86/recipes-core/llvm/llvm3.7.0_3.7.0.bb29
3 files changed, 120 insertions, 0 deletions
diff --git a/meta-amdfalconx86/recipes-core/llvm/files/0001-force-link-pass.o.patch b/meta-amdfalconx86/recipes-core/llvm/files/0001-force-link-pass.o.patch
new file mode 100644
index 00000000..e4b5f471
--- /dev/null
+++ b/meta-amdfalconx86/recipes-core/llvm/files/0001-force-link-pass.o.patch
@@ -0,0 +1,42 @@
+From 2f1e7f43ee516e56f9042c94abf6f90b8f61b7a9 Mon Sep 17 00:00:00 2001
+From: Arindam Nath <arindam.nath@amd.com>
+Date: Thu, 16 Apr 2015 16:11:24 +0530
+Subject: [PATCH 1/1] force link pass.o
+
+Signed-off-by: Arindam Nath <arindam.nath@amd.com>
+---
+ tools/bugpoint/Makefile | 3 +++
+ tools/opt/Makefile | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/tools/bugpoint/Makefile b/tools/bugpoint/Makefile
+index 174f8d2..dfde77c 100644
+--- a/tools/bugpoint/Makefile
++++ b/tools/bugpoint/Makefile
+@@ -12,6 +12,9 @@ TOOLNAME := bugpoint
+ LINK_COMPONENTS := asmparser instrumentation scalaropts ipo linker bitreader \
+ bitwriter irreader vectorize objcarcopts codegen
+
++# Crappy workaround to make sure it links correctly.
++LLVMLibsOptions := ../../lib/IR/Release*/Pass.o
++
+ # Support plugins.
+ NO_DEAD_STRIP := 1
+
+diff --git a/tools/opt/Makefile b/tools/opt/Makefile
+index 2422eb4..79ab3f7 100644
+--- a/tools/opt/Makefile
++++ b/tools/opt/Makefile
+@@ -11,6 +11,9 @@ LEVEL := ../..
+ TOOLNAME := opt
+ LINK_COMPONENTS := bitreader bitwriter asmparser irreader instrumentation scalaropts objcarcopts ipo vectorize all-targets codegen passes
+
++# Crappy workaround to make sure it links correctly.
++LLVMLibsOptions := ../../lib/IR/Release*/Pass.o
++
+ # Support plugins.
+ NO_DEAD_STRIP := 1
+
+--
+1.9.1
+
diff --git a/meta-amdfalconx86/recipes-core/llvm/llvm3.7.0.inc b/meta-amdfalconx86/recipes-core/llvm/llvm3.7.0.inc
new file mode 100644
index 00000000..bb6c5ca3
--- /dev/null
+++ b/meta-amdfalconx86/recipes-core/llvm/llvm3.7.0.inc
@@ -0,0 +1,49 @@
+#
+# Since we need LLVM 3.7.0 but meta-oe currently only supports
+# 3.3, override the minimum bits needed to get it to work.
+# Eventually this will need to be reconciled with upstream
+#
+
+# Ideally this would be done as a patch but since llvm3.inc already
+# manipulates this file with sed we have to do similar. We also need
+# to do this as an append to ensure proper sequencing.
+do_configure_append_x86-64() {
+ # Fix paths in llvm-config
+ sed -ri "s#lib/${LLVM_DIR}#${baselib}/${LLVM_DIR}#g" ${S}/tools/llvm-config/llvm-config.cpp
+}
+
+#
+# Override the do_install() provided by llvm3.inc to use the lib64
+# directory naming.
+#
+# This should probably be cleaned up at some point in the stock LLVM
+# sources but at the moment they do not appear to handle lib64 very well.
+#
+do_install() {
+ cd ${LLVM_BUILD_DIR}
+ oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install
+
+ mv ${LLVM_INSTALL_DIR}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_INSTALL_DIR}/llvm-config-host
+
+ install -d ${D}${bindir}/${LLVM_DIR}
+ mv ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/
+
+ install -d ${D}${includedir}/${LLVM_DIR}
+ mv ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/
+
+ install -d ${D}${libdir}/${LLVM_DIR}
+
+ # The LLVM sources have "/lib" embedded and so we cannot completely rely on the ${libdir} variable
+ if [ -d ${LLVM_INSTALL_DIR}${libdir}/ ]; then
+ mv ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/
+ elif [ -d ${LLVM_INSTALL_DIR}${prefix}/lib ]; then
+ mv ${LLVM_INSTALL_DIR}${prefix}/lib/* ${D}${libdir}/${LLVM_DIR}/
+ elif [ -d ${LLVM_INSTALL_DIR}${prefix}/lib64 ]; then
+ mv ${LLVM_INSTALL_DIR}${prefix}/lib64/* ${D}${libdir}/${LLVM_DIR}/
+ fi
+
+ ln -s ${LLVM_DIR}/libLLVM-${PV}${SOLIBSDEV} ${D}${libdir}/libLLVM-${PV}${SOLIBSDEV}
+
+ install -d ${D}${docdir}/${LLVM_DIR}
+ mv ${LLVM_INSTALL_DIR}${prefix}/docs/llvm/* ${D}${docdir}/${LLVM_DIR}
+}
diff --git a/meta-amdfalconx86/recipes-core/llvm/llvm3.7.0_3.7.0.bb b/meta-amdfalconx86/recipes-core/llvm/llvm3.7.0_3.7.0.bb
new file mode 100644
index 00000000..00bd0b1a
--- /dev/null
+++ b/meta-amdfalconx86/recipes-core/llvm/llvm3.7.0_3.7.0.bb
@@ -0,0 +1,29 @@
+require recipes-core/llvm/llvm.inc
+require llvm3.7.0.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
+
+DEPENDS += "zlib"
+RDEPENDS_${PN} += "ncurses-terminfo"
+PROVIDES += "llvm"
+
+EXTRA_OECONF += "--enable-zlib"
+PACKAGECONFIG_append_amd = "r600"
+
+SRC_URI = "\
+ git://llvm.org/git/llvm.git;branch=master;protocol=http \
+ file://0001-force-link-pass.o.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+SRCREV = "ffc045ab802ea542aabf1f1f22f97cb8a0ad6cde"
+PV = "3.7.0"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[r600] = "--enable-experimental-targets=R600,,,"
+
+do_configure_prepend() {
+ # Drop "svn" suffix from version string
+ sed -i 's/${PV}svn/${PV}/g' ${S}/configure
+}