openresty / luajit2

OpenResty's Branch of LuaJIT 2
https://luajit.org/luajit.html
Other
1.26k stars 202 forks source link

Some test fails on Linux Debian 12 (amd64|arm64) with v2.1-20240626 #238

Open amdei opened 4 months ago

amdei commented 4 months ago

This example:

export LUAJIT_PREFIX=/opt/my-opt
export LUAJIT_COMMON_TESTS_XCFLAGS="-DLUA_USE_APICHECK -DLUA_USE_ASSERT -DLUAJIT_NUMMODE=2 -O1"
# For amd64 only!
export LUAJIT_EXTRA_XCFLAGS="-msse4.2"
export LUAJIT_EXTRA_TESTS_XCFLAGS="-DLUAJIT_ENABLE_LUA52COMPAT"
export LUAJIT_XCFLAGS="$LUAJIT_COMMON_TESTS_XCFLAGS $LUAJIT_EXTRA_XCFLAGS $LUAJIT_EXTRA_TESTS_XCFLAGS"
export LUA52=1
export CFLAGS="--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Werror=implicit-function-declaration -Winit-self -Wp,-D_FORTIFY_SOURCE=2 -fPIC"
export LDFLAGS="-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie"
make amalg -j `nproc` PREFIX=$LUAJIT_PREFIX XCFLAGS="$LUAJIT_XCFLAGS"
make install PREFIX=$LUAJIT_PREFIX
git clone https://github.com/openresty/luajit2-test-suite.git ../luajit2-test-suite
cd ../luajit2-test-suite
./run-tests -j `nproc` $LUAJIT_PREFIX

works fine on Debian 11. It is not on Debian 12 (both amd64 and arm64): First fail:

=== test/sysdep/ffi_include_std.lua
/opt/my-opt/bin/luajit-2.1.1720897551: ffi_include_std.lua:49: unexpected symbol near '__nmatch' at line 8531
stack traceback:
    [C]: in function 'cdef'
    ffi_include_std.lua:49: in main chunk
    [C]: at 0xaaaab5648bc4
Failed test when running /opt/ngate/bin/luajit-2.1.1720897551 ffi_include_std.lua 1: 256

Second fail:

== test/sysdep/ffi_lib_c.lua
/opt/my-opt/bin/luajit-2.1.1720897551: ffi_lib_c.lua:84: libpthread.so: cannot open shared object file: No such file or directory
stack traceback:
    [C]: in function 'load'
    ffi_lib_c.lua:84: in main chunk
    [C]: at 0xaaaab8dd8bc4
Failed test when running /opt/ngate/bin/luajit-2.1.1720897551 ffi_lib_c.lua 1: 256

Well, last one seems to be due to that newer libc to not have libpthread.so at all. And libpthread.a is simply empty.

First one.... I don know...

johnheenan commented 1 month ago

Tests need updating?

libpthread got removed from glibc 2.34. Its code got integrated directly into the main library. See https://developers.redhat.com/articles/2021/12/17/why-glibc-234-removed-libpthread#