[tlbuild] Fixes for LuaJIT on OpenBSD/clang

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Feb 8 22:02:44 CET 2019


Dear Karl,

On Fri, 11 Jan 2019 at 03:12, Karl Berry wrote:
>
>             LIBLUAJIT_LDEXTRA="$jitlibs"
>
> Mojca, I installed your test in Build/source/m4/kpse-luajit-flags.m4,
> inside a new case for $build_os ~ openbsd*, except for the above line,
> which I changed to
>    LUAJIT_LIBS="$LUAJIT_LIBS $jitlibs"
>
> I'm never sure of anything, but as far as I can see LIBLUAJIT_LDEXTRA is
> not used; KPSE_LUAJIT_DEFINES sets up LUAJIT_LDEXTRA (no LIB), but those
> are flags that would normally appear at the beginning of the load line,
> whereas I think we want these libs to be after the -ltexluajit.
>
> I have no feasible way to test. Let me know if changes are necessary.
> --thanks, karl.

I spent some time playing with it a while back, but could not get it
working properly just yet, and then I ran out of time.

One strange thing to notice is that LUAJIT_LDEXTRA is defined at two
independent places:

* libs/luajit/configure.ac
    AS_CASE([$host_os:$host_cpu],
            [*darwin*:x86_64], [LIBLUAJIT_LDEXTRA='-image_base 7fff04c4a000'])
    AC_SUBST([LIBLUAJIT_LDEXTRA])

* m4/kpse-luajit-flags.m4
    AS_CASE([$host_os:$host_cpu],
            [*darwin*:x86_64], [LUAJIT_LDEXTRA='-pagezero_size 10000
-image_base 100000000'])
    AC_SUBST([LUAJIT_LDEXTRA])

while LUAJIT_LIBS is only in

* m4/kpse-luajit-flags.m4
    AC_DEFUN([KPSE_LUAJIT_FLAGS]

being called from

* texk/web2c/configure.ac

Commit
    http://tug.org/svn/texlive?view=revision&revision=49674
didn't really help, but I suspect that's because I would need to
copy-paste the same function to libs/luajit/configure.ac to actually
see that variable from libs/luajit.

What I didn't try yet was to call the suitable macro from
libs/luajit/configure.ac.

The builds are still broken, and I believe that the code in TeX Live
and LuaTeX has now diverged in this particular aspect, which would be
nice to fix.

If you want to look into this, you don't really need OpenBSD to test
for correctness of the code.

Just replace the strange code around
    _Unwind_Context *ctx;
with some trivial C statements (either valid or invalid), and replace
    jitlibs="-lc++abi -lpthread"
with some random LDFLAGS (ideally valid for your system), and check
whether they make it to the Makefiles for building luajit.

It would probably also be nice to reduce duplication of LUAJIT_LDEXTRA
definitions.

Mojca


More information about the tlbuild mailing list