[tlbuild] Fixes for LuaJIT on OpenBSD/clang

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Jan 11 17:11:50 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 a lot for the patch.

The code seems to work to build the binaries, except that now the
tests fail due to the lack of the same flags:
    http://build.contextgarden.net/builders/texlive.openbsd-amd64-6.3.prg/builds/189

mv -f .deps/jittest-jittest.Tpo .deps/jittest-jittest.Po
/bin/sh ./libtool  --tag=CC   --mode=link clang -fomit-frame-pointer
-fno-stack-protector  -Wall -g -O2   -o jittest jittest-jittest.o
libtexluajit.la -lm
libtool: link: clang -fomit-frame-pointer -fno-stack-protector -Wall
-g -O2 -o jittest jittest-jittest.o  ./.libs/libtexluajit.a -lm
mv -f LuaJIT-src/src/.deps/luajittry-luajit.Tpo
LuaJIT-src/src/.deps/luajittry-luajit.Po
/bin/sh ./libtool  --tag=CC   --mode=link clang -fomit-frame-pointer
-fno-stack-protector  -Wall -g -O2   -o luajittry
LuaJIT-src/src/luajittry-luajit.o libtexluajit.la -lm
libtool: link: clang -fomit-frame-pointer -fno-stack-protector -Wall
-g -O2 -o luajittry LuaJIT-src/src/luajittry-luajit.o
./.libs/libtexluajit.a -lm
./.libs/libtexluajit.a(lj_debug.o): In function `lj_debug_shortname':
../../../libs/luajit/LuaJIT-src/src/lj_debug.c:343: warning: strcpy()
is almost always misused, please use strlcpy()
./.libs/libtexluajit.a(lj_err.o): In function `lj_err_unwind_dwarf':
../../../libs/luajit/LuaJIT-src/src/lj_err.c:236: undefined reference
to `_Unwind_GetCFA'
../../../libs/luajit/LuaJIT-src/src/lj_err.c:254: undefined reference
to `_Unwind_DeleteException'
../../../libs/luajit/LuaJIT-src/src/lj_err.c:262: undefined reference
to `_Unwind_SetGR'
../../../libs/luajit/LuaJIT-src/src/lj_err.c:273: undefined reference
to `_Unwind_SetGR'
../../../libs/luajit/LuaJIT-src/src/lj_err.c:(.text+0x2d5): undefined
reference to `_Unwind_SetIP'
./.libs/libtexluajit.a(lj_err.o): In function `err_raise_ext':
../../../libs/luajit/LuaJIT-src/src/lj_err.c:301: undefined reference
to `_Unwind_RaiseException'

There is for example
    luajittry_LDFLAGS = $(LUAJIT_LDEXTRA)
in libs/luajit/Makefile.am, but LUAJIT_LIBS are missing at the same place.

I have absolutely no idea which variable is the correct one to use,
maybe both have their use, but if so, LUAJIT_LIBS might need to be
added at some of the places where LUAJIT_LDEXTRA is used.

Mojca


More information about the tlbuild mailing list