From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by mail.openembedded.org (Postfix) with ESMTP id 74B4562051 for ; Tue, 28 May 2013 01:24:57 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id bi5so7368784pad.36 for ; Mon, 27 May 2013 18:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=6qG81ZrWd/c4oezJCQJOiXBi2YqOGpPAclqEx1gIWeM=; b=d/zgrtA6zCjPEZc4D2XeQoBQOK9Q+2vbhZdXjIx9Fi/CAknue9gSVGbc7bRY3YBoIl qkCE06IjmhGxVBBil3YuUGLv1EMAbkPsyqGImOSME6BgLeS5uLtvAewcadWQY2e7zCXa WkjyzpAXDXS9QLSs8LosZ9J2JlpnWytJwteaIK94z1mYETH8nWvwlN0H7Nrs2xZCd1Sr ovhcHJO5U1bo6xWCsPhpYD6G5fK6WEcecEaKAxy/Q2bXCIS3rkuzsDks6j/2uL8cdZAh kMaF82WqL9kv0r3XnIaa2DgqjGPsxOshtpoLl6n3ufBA+4S+hyt8ZB/CDBbx+/XBLCp+ 0XmA== X-Received: by 10.66.193.72 with SMTP id hm8mr32287440pac.23.1369704298073; Mon, 27 May 2013 18:24:58 -0700 (PDT) Received: from isis.gateway.2wire.net (99-57-140-209.lightspeed.sntcca.sbcglobal.net. [99.57.140.209]) by mx.google.com with ESMTPSA id qb1sm30539104pbb.33.2013.05.27.18.24.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 May 2013 18:24:57 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Mon, 27 May 2013 18:22:51 -0700 Message-Id: <1369704171-2046-1-git-send-email-raj.khem@gmail.com> X-Mailer: git-send-email 1.7.9.5 Subject: [meta-oe][PATCH] luajit: Fix ppc spe issue with PIC code X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: openembedded-devel@lists.openembedded.org List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 01:24:58 -0000 some parts of libluajit is not compiled with PICness lets fix it. Also get the hotfix patch for luajit dot org Signed-off-by: Khem Raj --- .../luajit/luajit/ppc-fixplt.patch | 105 ++++++++++++++++++++ meta-oe/recipes-devtools/luajit/luajit_2.0.1.bb | 12 ++- 2 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 meta-oe/recipes-devtools/luajit/luajit/ppc-fixplt.patch diff --git a/meta-oe/recipes-devtools/luajit/luajit/ppc-fixplt.patch b/meta-oe/recipes-devtools/luajit/luajit/ppc-fixplt.patch new file mode 100644 index 0000000..b9f17f4 --- /dev/null +++ b/meta-oe/recipes-devtools/luajit/luajit/ppc-fixplt.patch @@ -0,0 +1,105 @@ +Upstream-Status: Unknown + +Signed-off-by: Khem Raj + +libluajit is having symbols that can't be +resolved the reloc cannot accommodate an offset greater than 24 bits. + +Looking at libluajit with readelf -r, you see a bunch of entries that look like: + 000082f0 00003c0a R_PPC_REL24 00000000 sqrt + 0 + +These should not occur when the code is compiled and linked with -fPIC. + +It turns out that libluajit *is* compiled and linked with -fPIC, however... +There is one assembler file called lj_vm.s which is generated during the build. +This file is missing the `@plt' qualifier from external references. + +This file is generated by a program called buildvm. This in turn uses tables +in a file called buildvm_arch.h which is generated by dynasm.lua. + +Index: LuaJIT-2.0.1/src/host/buildvm.c +=================================================================== +--- LuaJIT-2.0.1.orig/src/host/buildvm.c 2013-02-19 12:15:00.000000000 -0800 ++++ LuaJIT-2.0.1/src/host/buildvm.c 2013-05-14 20:26:05.933444512 -0700 +@@ -107,12 +107,14 @@ + #endif + sprintf(name, "%s%s%s", symprefix, prefix, suffix); + p = strchr(name, '@'); ++#if 0 + if (p) { + if (!LJ_64 && (ctx->mode == BUILD_coffasm || ctx->mode == BUILD_peobj)) + name[0] = '@'; + else + *p = '\0'; + } ++#endif + p = (char *)malloc(strlen(name)+1); /* MSVC doesn't like strdup. */ + strcpy(p, name); + return p; +Index: LuaJIT-2.0.1/src/vm_ppcspe.dasc +=================================================================== +--- LuaJIT-2.0.1.orig/src/vm_ppcspe.dasc 2013-02-19 12:15:00.000000000 -0800 ++++ LuaJIT-2.0.1/src/vm_ppcspe.dasc 2013-05-14 20:26:05.937444512 -0700 +@@ -1390,7 +1390,7 @@ + | checknum CARG2 + | evmergehi CARG1, CARG2, CARG2 + | checkfail ->fff_fallback +- | bl extern func ++ | bl extern func@plt + | evmergelo CRET1, CRET1, CRET2 + | b ->fff_restv + |.endmacro +@@ -1405,7 +1405,7 @@ + | checknum CARG1 + | evmergehi CARG3, CARG4, CARG4 + | checkanyfail ->fff_fallback +- | bl extern func ++ | bl extern func@plt + | evmergelo CRET1, CRET1, CRET2 + | b ->fff_restv + |.endmacro +@@ -1437,7 +1437,7 @@ + | checknum CARG2 + | evmergehi CARG1, CARG2, CARG2 + | checkfail ->fff_fallback +- | bl extern log ++ | bl extern log@plt + | evmergelo CRET1, CRET1, CRET2 + | b ->fff_restv + | +@@ -1471,7 +1471,7 @@ + | checknum CARG1 + | checkanyfail ->fff_fallback + | efdctsi CARG3, CARG4 +- | bl extern ldexp ++ | bl extern ldexp@plt + | evmergelo CRET1, CRET1, CRET2 + | b ->fff_restv + | +@@ -1484,7 +1484,7 @@ + | checkfail ->fff_fallback + | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) + | lwz PC, FRAME_PC(BASE) +- | bl extern frexp ++ | bl extern frexp@plt + | lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH) + | evmergelo CRET1, CRET1, CRET2 + | efdcfsi CRET2, TMP1 +@@ -1503,7 +1503,7 @@ + | checkfail ->fff_fallback + | la CARG3, -8(BASE) + | lwz PC, FRAME_PC(BASE) +- | bl extern modf ++ | bl extern modf@plt + | evmergelo CRET1, CRET1, CRET2 + | la RA, -8(BASE) + | evstdd CRET1, 0(BASE) +@@ -2399,7 +2399,7 @@ + | checknum CARG1 + | evmergehi CARG3, CARG4, CARG4 + | checkanyfail ->vmeta_arith_vv +- | bl extern pow ++ | bl extern pow@plt + | evmergelo CRET2, CRET1, CRET2 + | evstddx CRET2, BASE, RA + | ins_next diff --git a/meta-oe/recipes-devtools/luajit/luajit_2.0.1.bb b/meta-oe/recipes-devtools/luajit/luajit_2.0.1.bb index 99a2ca6..6ca5f34 100644 --- a/meta-oe/recipes-devtools/luajit/luajit_2.0.1.bb +++ b/meta-oe/recipes-devtools/luajit/luajit_2.0.1.bb @@ -4,11 +4,17 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=1793ef52a5d577794cd886a501a7f861" HOMEPAGE = "http://luajit.org" DEPENDS += "lua5.1" -SRC_URI = "http://luajit.org/download/LuaJIT-${PV}.tar.gz \ +SRC_URI = "http://luajit.org/download/LuaJIT-${PV}.tar.gz;name=tarball \ file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \ + http://luajit.org/download/v2.0.1_hotfix1.patch;name=hotfix1 \ " -SRC_URI[md5sum] = "85e406e8829602988eb1233a82e29f1f" -SRC_URI[sha256sum] = "2371cceb53453d8a7b36451e6a0ccdb66236924545d6042ddd4c34e9668990c0" +SRC_URI_append_fslmachine = " file://ppc-fixplt.patch " + +SRC_URI[tarball.md5sum] = "85e406e8829602988eb1233a82e29f1f" +SRC_URI[tarball.sha256sum] = "2371cceb53453d8a7b36451e6a0ccdb66236924545d6042ddd4c34e9668990c0" + +SRC_URI[hotfix1.md5sum] = "5186c5901e37679a3c835d7b7cdac88e" +SRC_URI[hotfix1.sha256sum] = "143898de3fe84455684fddb92947d36c1a51c6a6e3884813fe5e025bd4652368" S = "${WORKDIR}/LuaJIT-${PV}" -- 1.7.9.5