cloudflare / cf_benchmark

40 stars 14 forks source link

Error when compiling libluajit #8

Open baonq-me opened 1 year ago

baonq-me commented 1 year ago

Server spec:

gcc main.o -lpthread -lm  -ldl ./LuaJIT/src/libluajit.a -o bench
./LuaJIT/src/libluajit.a(lj_clib.o): In function `lj_clib_index':
lj_clib.c:(.text+0x1bc): undefined reference to `dlsym'
./LuaJIT/src/libluajit.a(lj_clib.o): In function `lj_clib_load':
lj_clib.c:(.text+0x2c8): undefined reference to `dlopen'
lj_clib.c:(.text+0x360): undefined reference to `dlopen'
lj_clib.c:(.text+0x370): undefined reference to `dlerror'
lj_clib.c:(.text+0x488): undefined reference to `dlopen'
lj_clib.c:(.text+0x4d0): undefined reference to `dlerror'
./LuaJIT/src/libluajit.a(lj_clib.o): In function `lj_clib_unload':
lj_clib.c:(.text+0x4f0): undefined reference to `dlclose'
./LuaJIT/src/libluajit.a(lj_clib.o): In function `clib_error_':
lj_clib.c:(.text.unlikely+0x8): undefined reference to `dlerror'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_BC_POW':
buildvm_arm64.dasc:(.text+0xd98): undefined reference to `pow'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_log':
buildvm_arm64.dasc:(.text+0x2f24): undefined reference to `log'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_log10':
buildvm_arm64.dasc:(.text+0x2f44): undefined reference to `log10'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_exp':
buildvm_arm64.dasc:(.text+0x2f64): undefined reference to `exp'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_sin':
buildvm_arm64.dasc:(.text+0x2f84): undefined reference to `sin'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_cos':
buildvm_arm64.dasc:(.text+0x2fa4): undefined reference to `cos'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_tan':
buildvm_arm64.dasc:(.text+0x2fc4): undefined reference to `tan'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_asin':
buildvm_arm64.dasc:(.text+0x2fe4): undefined reference to `asin'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_acos':
buildvm_arm64.dasc:(.text+0x3004): undefined reference to `acos'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_atan':
buildvm_arm64.dasc:(.text+0x3024): undefined reference to `atan'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_sinh':
buildvm_arm64.dasc:(.text+0x3044): undefined reference to `sinh'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_cosh':
buildvm_arm64.dasc:(.text+0x3064): undefined reference to `cosh'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_tanh':
buildvm_arm64.dasc:(.text+0x3084): undefined reference to `tanh'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_pow':
buildvm_arm64.dasc:(.text+0x30ac): undefined reference to `pow'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_atan2':
buildvm_arm64.dasc:(.text+0x30d4): undefined reference to `atan2'
./LuaJIT/src/libluajit.a(lj_vm.o): In function `lj_ff_math_fmod':
buildvm_arm64.dasc:(.text+0x30fc): undefined reference to `fmod'
./LuaJIT/src/libluajit.a(lj_vmmath.o): In function `lj_vm_foldarith':
lj_vmmath.c:(.text+0x7c): undefined reference to `atan2'
lj_vmmath.c:(.text+0xcc): undefined reference to `pow'
./LuaJIT/src/libluajit.a(lj_vmmath.o): In function `lj_vm_foldfpm':
lj_vmmath.c:(.text+0x1b4): undefined reference to `tan'
lj_vmmath.c:(.text+0x1ec): undefined reference to `exp'
lj_vmmath.c:(.text+0x1f0): undefined reference to `log10'
lj_vmmath.c:(.text+0x1f4): undefined reference to `cos'
baonq-me commented 1 year ago

Results are not recorded

image

baonq-me commented 1 year ago

I change ./LuaJIT/src/libluajit.a to ./LuaJIT/src/libluajit.so, and the compiler has success.

gcc main.o -lpthread -lm  -ldl ./LuaJIT/src/libluajit.so -o bench

Then I decide to replace ./LuaJIT/src/libluajit.a by ./LuaJIT/src/libluajit.so and run run_benchmarks.sh again. Got fixed !

image