From patchwork Mon Jan 30 09:41:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [meta-java] llvm-config: Work around shebang max length issue Date: Mon, 30 Jan 2012 09:41:22 -0000 From: Thilo Fromm X-Patchwork-Id: 20295 Message-Id: <1327916482-16069-1-git-send-email-fromm@dresearch-fe.de> To: openembedded-devel@lists.openembedded.org Cc: Thilo Fromm 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 --- 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."