Closed sandy-lcq closed 3 months ago
This is an RFC patch, according to current state, I think maybe no one need this luajit for now, so maybe we could remove it.
The build check failed since minicom do_configure failed. But I can build minicom successfully with both gcc and clang. I don't see why my change will cause this failure, seems not related.
Just find that the build out executable bcc-lua for x86-64 maybe try to found modules on host path. According to the offical webpage luajit, I cannot found how to cross compile out an target arch object by luajit, I need to confirm with luajit upstream.
root@qemux86-64:/usr/share/bcc/examples/lua# bcc-lua ./kprobe-latency.lua
bcc-lua: bcc.lua:3052: module 'syscall' not found:
no field package.preload['syscall']
no file './syscall.lua'
no file '/build/tmp-glibc/work/x86_64-linux/luajit-native/2.1/recipe-sysroot-native/usr/share/luaj'
no file '/usr/local/share/lua/5.1/syscall.lua'
no file '/usr/local/share/lua/5.1/syscall/init.lua'
no file '/build/tmp-glibc/work/x86_64-linux/luajit-native/2.1/recipe-sysroot-native/usr/share/lua/'
no file '/build/tmp-glibc/work/x86_64-linux/luajit-native/2.1/recipe-sysroot-native/usr/share/lua/'
no file './syscall.so'
no file '/usr/local/lib/lua/5.1/syscall.so'
no file '/build/tmp-glibc/work/x86_64-linux/luajit-native/2.1/recipe-sysroot-native/usr/lib/lua/5.'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
bcc.lua:3052: in function
The build check failed since minicom do_configure failed. But I can build minicom successfully with both gcc and clang. I don't see why my change will cause this failure, seems not related.
Just rebase your branch and push again it will rerun the CI loop
Current LUAJIT actually not works, below is snip of src/lua/CMakeLists.txt [snip] find_package(LuaJIT) find_program(LUAJIT luajit)
if (LUAJIT_LIBRARIES AND LUAJIT) FILE(GLOB_RECURSE SRC_LUA ${CMAKE_CURRENT_SOURCE_DIR}/bcc/.lua ${CMAKE_CURRENT_SOURCE_DIR}/bcc/vendor/.lua ${CMAKE_CURRENT_SOURCE_DIR}/bpf/*.lua)
[snip]
LUAJIT will be set when luajit is found. For oe, maybe we need to DEPENDS on luajit-native. But there are still 2 problems after I change DEPENDS from luajit to luajit-native and export LUA_PATH="${RECIPE_SYSROOT_NATIVE}/usr/share/luajit-2.1/?.lua"
Refer [1], seems like option "-a" can used to generate other arch object. But luajit-native don't have this option: cortexa57-wrs-linux/bcc/0.29.1/recipe-sysroot-native/usr/bin/luajit [options]... [script [args]...]. Available options are: -e chunk Execute string 'chunk'. -l name Require library 'name'. -b ... Save or list bytecode. -j cmd Perform LuaJIT control command. -O[opt] Control LuaJIT optimizations. -i Enter interactive mode after executing 'script'. -v Show version information. -E Ignore environment variables. – Stop handling options.
root@qemux86-64:/usr/share/bcc/examples/lua# bcc-lua ./kprobe-latency.lua bcc-lua: bcc.lua:3052: module 'syscall' not found: no field package.preload['syscall'] no file './syscall.lua' no file '/build/tmp-glibc/work/x86_64-linux/luajit-native/2.1/recipe-sysroot-native/usr/share/luaj' no file '/usr/local/share/lua/5.1/syscall.lua' no file '/usr/local/share/lua/5.1/syscall/init.lua' no file '/build/tmp-glibc/work/x86_64-linux/luajit-native/2.1/recipe-sysroot-native/usr/share/lua/' no file '/build/tmp-glibc/work/x86_64-linux/luajit-native/2.1/recipe-sysroot-native/usr/share/lua/' no file './syscall.so' no file '/usr/local/lib/lua/5.1/syscall.so' no file '/build/tmp-glibc/work/x86_64-linux/luajit-native/2.1/recipe-sysroot-native/usr/lib/lua/5.' no file '/usr/local/lib/lua/5.1/loadall.so'
so remove LUAJIT setting and related examples first
[1] https://luajit.org/running.html [2] https://github.com/iovisor/bcc/issues/1621