diff options
-rw-r--r-- | meta-oe/recipes-devtools/luajit/luajit/ppc-fixplt.patch | 105 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/luajit/luajit_2.0.1.bb | 12 |
2 files changed, 114 insertions, 3 deletions
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 000000000..b9f17f4e3 --- /dev/null +++ b/meta-oe/recipes-devtools/luajit/luajit/ppc-fixplt.patch | |||
@@ -0,0 +1,105 @@ | |||
1 | Upstream-Status: Unknown | ||
2 | |||
3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
4 | |||
5 | libluajit is having symbols that can't be | ||
6 | resolved the reloc cannot accommodate an offset greater than 24 bits. | ||
7 | |||
8 | Looking at libluajit with readelf -r, you see a bunch of entries that look like: | ||
9 | 000082f0 00003c0a R_PPC_REL24 00000000 sqrt + 0 | ||
10 | |||
11 | These should not occur when the code is compiled and linked with -fPIC. | ||
12 | |||
13 | It turns out that libluajit *is* compiled and linked with -fPIC, however... | ||
14 | There is one assembler file called lj_vm.s which is generated during the build. | ||
15 | This file is missing the `@plt' qualifier from external references. | ||
16 | |||
17 | This file is generated by a program called buildvm. This in turn uses tables | ||
18 | in a file called buildvm_arch.h which is generated by dynasm.lua. | ||
19 | |||
20 | Index: LuaJIT-2.0.1/src/host/buildvm.c | ||
21 | =================================================================== | ||
22 | --- LuaJIT-2.0.1.orig/src/host/buildvm.c 2013-02-19 12:15:00.000000000 -0800 | ||
23 | +++ LuaJIT-2.0.1/src/host/buildvm.c 2013-05-14 20:26:05.933444512 -0700 | ||
24 | @@ -107,12 +107,14 @@ | ||
25 | #endif | ||
26 | sprintf(name, "%s%s%s", symprefix, prefix, suffix); | ||
27 | p = strchr(name, '@'); | ||
28 | +#if 0 | ||
29 | if (p) { | ||
30 | if (!LJ_64 && (ctx->mode == BUILD_coffasm || ctx->mode == BUILD_peobj)) | ||
31 | name[0] = '@'; | ||
32 | else | ||
33 | *p = '\0'; | ||
34 | } | ||
35 | +#endif | ||
36 | p = (char *)malloc(strlen(name)+1); /* MSVC doesn't like strdup. */ | ||
37 | strcpy(p, name); | ||
38 | return p; | ||
39 | Index: LuaJIT-2.0.1/src/vm_ppcspe.dasc | ||
40 | =================================================================== | ||
41 | --- LuaJIT-2.0.1.orig/src/vm_ppcspe.dasc 2013-02-19 12:15:00.000000000 -0800 | ||
42 | +++ LuaJIT-2.0.1/src/vm_ppcspe.dasc 2013-05-14 20:26:05.937444512 -0700 | ||
43 | @@ -1390,7 +1390,7 @@ | ||
44 | | checknum CARG2 | ||
45 | | evmergehi CARG1, CARG2, CARG2 | ||
46 | | checkfail ->fff_fallback | ||
47 | - | bl extern func | ||
48 | + | bl extern func@plt | ||
49 | | evmergelo CRET1, CRET1, CRET2 | ||
50 | | b ->fff_restv | ||
51 | |.endmacro | ||
52 | @@ -1405,7 +1405,7 @@ | ||
53 | | checknum CARG1 | ||
54 | | evmergehi CARG3, CARG4, CARG4 | ||
55 | | checkanyfail ->fff_fallback | ||
56 | - | bl extern func | ||
57 | + | bl extern func@plt | ||
58 | | evmergelo CRET1, CRET1, CRET2 | ||
59 | | b ->fff_restv | ||
60 | |.endmacro | ||
61 | @@ -1437,7 +1437,7 @@ | ||
62 | | checknum CARG2 | ||
63 | | evmergehi CARG1, CARG2, CARG2 | ||
64 | | checkfail ->fff_fallback | ||
65 | - | bl extern log | ||
66 | + | bl extern log@plt | ||
67 | | evmergelo CRET1, CRET1, CRET2 | ||
68 | | b ->fff_restv | ||
69 | | | ||
70 | @@ -1471,7 +1471,7 @@ | ||
71 | | checknum CARG1 | ||
72 | | checkanyfail ->fff_fallback | ||
73 | | efdctsi CARG3, CARG4 | ||
74 | - | bl extern ldexp | ||
75 | + | bl extern ldexp@plt | ||
76 | | evmergelo CRET1, CRET1, CRET2 | ||
77 | | b ->fff_restv | ||
78 | | | ||
79 | @@ -1484,7 +1484,7 @@ | ||
80 | | checkfail ->fff_fallback | ||
81 | | la CARG3, DISPATCH_GL(tmptv)(DISPATCH) | ||
82 | | lwz PC, FRAME_PC(BASE) | ||
83 | - | bl extern frexp | ||
84 | + | bl extern frexp@plt | ||
85 | | lwz TMP1, DISPATCH_GL(tmptv)(DISPATCH) | ||
86 | | evmergelo CRET1, CRET1, CRET2 | ||
87 | | efdcfsi CRET2, TMP1 | ||
88 | @@ -1503,7 +1503,7 @@ | ||
89 | | checkfail ->fff_fallback | ||
90 | | la CARG3, -8(BASE) | ||
91 | | lwz PC, FRAME_PC(BASE) | ||
92 | - | bl extern modf | ||
93 | + | bl extern modf@plt | ||
94 | | evmergelo CRET1, CRET1, CRET2 | ||
95 | | la RA, -8(BASE) | ||
96 | | evstdd CRET1, 0(BASE) | ||
97 | @@ -2399,7 +2399,7 @@ | ||
98 | | checknum CARG1 | ||
99 | | evmergehi CARG3, CARG4, CARG4 | ||
100 | | checkanyfail ->vmeta_arith_vv | ||
101 | - | bl extern pow | ||
102 | + | bl extern pow@plt | ||
103 | | evmergelo CRET2, CRET1, CRET2 | ||
104 | | evstddx CRET2, BASE, RA | ||
105 | | 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 99a2ca6fb..6ca5f3494 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" | |||
4 | HOMEPAGE = "http://luajit.org" | 4 | HOMEPAGE = "http://luajit.org" |
5 | 5 | ||
6 | DEPENDS += "lua5.1" | 6 | DEPENDS += "lua5.1" |
7 | SRC_URI = "http://luajit.org/download/LuaJIT-${PV}.tar.gz \ | 7 | SRC_URI = "http://luajit.org/download/LuaJIT-${PV}.tar.gz;name=tarball \ |
8 | file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \ | 8 | file://0001-Do-not-strip-automatically-this-leaves-the-stripping.patch \ |
9 | http://luajit.org/download/v2.0.1_hotfix1.patch;name=hotfix1 \ | ||
9 | " | 10 | " |
10 | SRC_URI[md5sum] = "85e406e8829602988eb1233a82e29f1f" | 11 | SRC_URI_append_fslmachine = " file://ppc-fixplt.patch " |
11 | SRC_URI[sha256sum] = "2371cceb53453d8a7b36451e6a0ccdb66236924545d6042ddd4c34e9668990c0" | 12 | |
13 | SRC_URI[tarball.md5sum] = "85e406e8829602988eb1233a82e29f1f" | ||
14 | SRC_URI[tarball.sha256sum] = "2371cceb53453d8a7b36451e6a0ccdb66236924545d6042ddd4c34e9668990c0" | ||
15 | |||
16 | SRC_URI[hotfix1.md5sum] = "5186c5901e37679a3c835d7b7cdac88e" | ||
17 | SRC_URI[hotfix1.sha256sum] = "143898de3fe84455684fddb92947d36c1a51c6a6e3884813fe5e025bd4652368" | ||
12 | 18 | ||
13 | S = "${WORKDIR}/LuaJIT-${PV}" | 19 | S = "${WORKDIR}/LuaJIT-${PV}" |
14 | 20 | ||