summaryrefslogtreecommitdiff
path: root/print/luatex/patches
diff options
context:
space:
mode:
authorjperkin <jperkin>2016-07-06 09:47:52 +0000
committerjperkin <jperkin>2016-07-06 09:47:52 +0000
commit3592735d58abc4d9c4a43b8ca3aa94e2addeb04e (patch)
treeea1c302360e33f06332b1153624aa7584e3b3198 /print/luatex/patches
parent1326b1c4502e0c778214e65811086554903c3f85 (diff)
downloadpkgsrc-3592735d58abc4d9c4a43b8ca3aa94e2addeb04e.tar.gz
Generate lj_vm_asm.S at build time using a patched generator, should
ensure both SunOS and NetBSD builds are fixed.
Diffstat (limited to 'print/luatex/patches')
-rw-r--r--print/luatex/patches/patch-libs_luajit_LuaJIT-src_src_host_buildvm__asm.c42
-rw-r--r--print/luatex/patches/patch-libs_luajit_Makefile.in20
2 files changed, 42 insertions, 20 deletions
diff --git a/print/luatex/patches/patch-libs_luajit_LuaJIT-src_src_host_buildvm__asm.c b/print/luatex/patches/patch-libs_luajit_LuaJIT-src_src_host_buildvm__asm.c
new file mode 100644
index 00000000000..59207f22dc9
--- /dev/null
+++ b/print/luatex/patches/patch-libs_luajit_LuaJIT-src_src_host_buildvm__asm.c
@@ -0,0 +1,42 @@
+$NetBSD: patch-libs_luajit_LuaJIT-src_src_host_buildvm__asm.c,v 1.1 2016/07/06 09:47:52 jperkin Exp $
+
+Generate SunOS compatible assembly.
+
+--- libs/luajit/LuaJIT-src/src/host/buildvm_asm.c.orig 2016-03-09 22:32:00.000000000 +0000
++++ libs/luajit/LuaJIT-src/src/host/buildvm_asm.c
+@@ -29,7 +29,11 @@ static void emit_asm_reloc(BuildCtx *ctx
+ switch (ctx->mode) {
+ case BUILD_elfasm:
+ if (type)
++#ifdef __sun
++ fprintf(ctx->fp, "\t.long %s@PLT-.-4\n", sym);
++#else
+ fprintf(ctx->fp, "\t.long %s-.-4\n", sym);
++#endif
+ else
+ fprintf(ctx->fp, "\t.long %s\n", sym);
+ break;
+@@ -75,7 +79,11 @@ err:
+ /* Various fixups for external symbols outside of our binary. */
+ if (ctx->mode == BUILD_elfasm) {
+ if (LJ_32)
++#ifdef __sun
++ fprintf(ctx->fp, "#if __PIC__\n\t%s lj_wrap_%s@PLT\n#else\n", opname, sym);
++#else
+ fprintf(ctx->fp, "#if __PIC__\n\t%s lj_wrap_%s\n#else\n", opname, sym);
++#endif
+ fprintf(ctx->fp, "\t%s %s@PLT\n", opname, sym);
+ if (LJ_32)
+ fprintf(ctx->fp, "#endif\n");
+@@ -85,7 +93,11 @@ err:
+ return;
+ }
+ }
++#ifdef __sun
++ fprintf(ctx->fp, "\t%s %s@PLT\n", opname, sym);
++#else
+ fprintf(ctx->fp, "\t%s %s\n", opname, sym);
++#endif
+ }
+ #else
+ /* Emit words piecewise as assembler text. */
diff --git a/print/luatex/patches/patch-libs_luajit_Makefile.in b/print/luatex/patches/patch-libs_luajit_Makefile.in
deleted file mode 100644
index a92c936698b..00000000000
--- a/print/luatex/patches/patch-libs_luajit_Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-libs_luajit_Makefile.in,v 1.3 2016/07/05 12:34:12 jperkin Exp $
-
-Ensure that the luajit generated asm file is PIC for libtool use, particularly
-important when linking under SunOS... appending @PLT seems to workaround the
-issue with generated PC relative calls.
-
---- libs/luajit/Makefile.in.orig 2016-03-21 20:23:37.000000000 +0000
-+++ libs/luajit/Makefile.in
-@@ -1827,6 +1827,11 @@ lj_folddef.h: native/buildvm-stamp
-
- lj_vm_obj.o lj_vm_asm.S: native/buildvm-stamp
- $(AM_V_GEN)native/buildvm -m $(LJVM_MODE) -o $@
-+ mv -f lj_vm_asm.S lj_vm_asm.S.orig
-+ $(SED) < lj_vm_asm.S.orig > lj_vm_asm.S \
-+ -e 's/\(call lj_.*\)$$/\1@PLT/' \
-+ -e 's/\(jmp lj_.*\)$$/\1@PLT/' \
-+ -e 's/\(long lj_.*\)-/\1@PLT-/'
-
- lj_vm_obj.lo: lj_vm_obj.o lib_base.lo
- $(AM_V_GEN)sed 's/lib_base/lj_vm_obj/' lib_base.lo >$@ \