[oe] [meta-java][PATCH] llvm-config: Work around shebang max length issue

Thilo Fromm fromm at dresearch-fe.de
Mon Jan 30 09:10:14 UTC 2012


This patch works around a max shebang length issue
in llvm's llvm-config.

llvm-config is a perl script. meta-java configures
the llvm sources to use OE's perl which might reside in
a path longer than 127 chars. llvm's perl script
will then have a shebang line longer than 127 characters.
This will break the script.
In linux, shebang interpreter paths are cut off after 127 bytes.

meta-java's llvm recipe already wraps the perl script llvm-config
with a small shell script. This patch adds an explicit perl
interpreter call to this wrapping shell script.

Signed-off-by: Thilo Fromm <github at thilo-fromm.de>

---
 recipes-core/llvm/llvm-common.bb          |   12 ++++++++++++
 recipes-core/llvm/llvm-common/llvm-config |    2 +-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/recipes-core/llvm/llvm-common.bb b/recipes-core/llvm/llvm-common.bb
index 38ca1ee..3db4af0 100644
--- a/recipes-core/llvm/llvm-common.bb
+++ b/recipes-core/llvm/llvm-common.bb
@@ -4,8 +4,20 @@ LIC_FILES_CHKSUM =
"file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3

file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420
\
                    "

+# provide native perl binaries via PATH
+inherit perlnative
+DEPENDS += "perl-native"
+
 SRC_URI = "file://llvm-config"

+do_compile() {
+  cd ..
+  # This adds an explicit call to the interpreter in the wrapper script
+  #  so we don't run into shebang max size issues in the
llvm-configX.X perl script
+  #  if the path to perl-native > 127 chars.
+  sed -i -e "s|@PATH_TO_PERL@|`which perl`|" llvm-config
+}
+
 do_install() {
   install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
   install -m 0755 ${WORKDIR}/llvm-config
${SYSROOT_DESTDIR}${bindir_crossscripts}/
diff --git a/recipes-core/llvm/llvm-common/llvm-config
b/recipes-core/llvm/llvm-common/llvm-config
index a9a416d..08463e5 100644
--- a/recipes-core/llvm/llvm-common/llvm-config
+++ b/recipes-core/llvm/llvm-common/llvm-config
@@ -2,7 +2,7 @@
 # Wrapper script for real llvm-config. Simply calls

 if [ $WANT_LLVM_RELEASE ]; then
-	exec `dirname $0`/${TARGET_PREFIX}llvm-config$WANT_LLVM_RELEASE ${@}
+	exec "@PATH_TO_PERL@" `dirname
$0`/${TARGET_PREFIX}llvm-config$WANT_LLVM_RELEASE ${@}
 else
   echo "The variable WANT_LLVM_RELEASE is not defined and exported"
 	echo "by your build recipe. Go figure."
-- 
1.7.5.4


-- 
Dipl.-Ing (FH) Thilo Fromm, MSc., Embedded Systems Architect
DResearch Fahrzeugelektronik GmbH
Otto-Schmirgal-Str. 3, D-10319 Berlin, Germany
Tel: +49 (30) 515 932 228   mailto:fromm at dresearch-fe.de
Fax: +49 (30) 515 932 77    http://www.dresearch.de
Amtsgericht: Berlin Charlottenburg, HRB 130120 B
Ust.-IDNr. DE273952058
Geschäftsführer: Dr. M. Weber, W. Mögle




More information about the Openembedded-devel mailing list