Skip to contentSkip to conversation

llvm: correct fix for the multilib libdir

PATCH New Jacob Stiffler 1 participant 1 message Apr 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 llvm: correct fix for the multilib libdir

* If llvm.inc is used for native and nativesdk class packages, the resulting llvm-config is broken since "${base_libdir}" is prefixed with the full patch to sysroot
* Replace "/lib" with "/${baselib}" instead of "${base_libdir}" as "${base_libdir}" is the full path and "${baselib}" is the name of the multilib directory.

Upstream status: pending

---
 .../recipes-core/llvm/ti-llvm3.6_3.6.bb            | 37 +++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)
meta-arago-extras/recipes-core/llvm/ti-llvm3.6_3.6.bb +36 -1
index 8efd516..037256c 100644
@@ -1,13 +1,18 @@
 DESCRIPTION = "LLVM 3.6 with support for TI C66x intrinsics"
 HOMEPAGE = "https://gitorious.design.ti.com/ocl/llvm33-src"
 
-PR = "r2"
+PR = "r3"
 
 do_configure_prepend_class-native() {
     # Fix paths in llvm-config
     sed -i "s|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|sys::path::parent_path(CurrentPath))\.str()|g" ${S}/tools/llvm-config/llvm-config.cpp
 }
 
+do_configure_prepend() {
+    # Workaround for libdir fix for multilib to undo what is currently upstream
+    sed -i 's:${base_libdir}:/${baselib}:g' ${S}/tools/llvm-config/llvm-config.cpp
+}
+
 require recipes-core/llvm/llvm.inc
 
 LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d"
@@ -55,11 +60,19 @@ EXTRA_OEMAKE += "LIBXML2_INC="${LIBXML2_INC}" LIBXML2_LIBS="${LIBXML2_LIBS}""
 
 do_compile_class-native() {
   cd ${LLVM_BUILD_DIR}
+
+  # Fix libdir for multilib
+  sed -i 's:(PROJ_prefix)/lib:(PROJ_prefix)/${baselib}:g' Makefile.config
+
   oe_runmake
 }
 
 do_compile_class-nativesdk() {
     cd ${LLVM_BUILD_DIR}
+
+    # Fix libdir for multilib
+    sed -i 's:(PROJ_prefix)/lib:(PROJ_prefix)/${baselib}:g' Makefile.config
+
     oe_runmake \
         AR="${BUILD_AR}" \
         CC="${BUILD_CC}" \
@@ -84,6 +97,28 @@ do_compile_class-nativesdk() {
     oe_runmake
 }
 
+# Workaround for libdir fix for multilib
+do_compile() {
+    cd ${LLVM_BUILD_DIR}
+
+    # Fix libdir for multilib
+    sed -i 's:(PROJ_prefix)${base_libdir}:(PROJ_prefix)/${baselib}:g' Makefile.config
+
+    oe_runmake \
+        AR="${BUILD_AR}" \
+        CC="${BUILD_CC}" \
+        CFLAGS="${BUILD_CFLAGS}" \
+        CXX="${BUILD_CXX}" \
+        CXXFLAGS="${BUILD_CXXFLAGS}" \
+        CPP="${BUILD_CPP}" \
+        CPPFLAGS="${BUILD_CPPFLAGS}" \
+        NM="${BUILD_NM}" \
+        RANLIB="${BUILD_RANLIB}" \
+        PATH="${STAGING_BINDIR_NATIVE}:$PATH" \
+        cross-compile-build-tools
+    oe_runmake
+}
+
 do_install_append_class-target() {
     for b in ${D}${bindir}/${LLVM_DIR}/${HOST_SYS}-clang*; do
         if [ ! -L ${b} ]; then
Signature · 1 line
1.9.1