agra-uni-bremen / riscv-vp

RISC-V Virtual Prototype
MIT License
139 stars 49 forks source link

LUA 5.3 Linking : undefined reference to symbol 'dlclose@@GLIBC_2.2.5 #25

Closed disdi closed 1 year ago

disdi commented 1 year ago

In building hifive env, below error is seen during linking :

usr/local/lib/liblua.a(loadlib.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5

disdi commented 1 year ago

Below patch fixes the issue for me:

diff --git a/env/hifive/vp-breadboard/CMakeLists.txt b/env/hifive/vp-breadboard/CMakeLists.txt index eb9c940..3e7e0fa 100644 --- a/env/hifive/vp-breadboard/CMakeLists.txt +++ b/env/hifive/vp-breadboard/CMakeLists.txt @@ -20,6 +20,8 @@ if(NOT LUA_LIB) message(FATAL_ERROR "lua library not found") endif() endif() +set(LUA_LIB "/usr/local/lib/liblua.a;/usr/lib/x86_64-linux-gnu/libdl.so") +

if(NOT DONT_INCLUDE_LUA_DEVICES) set(DONT_INCLUDE_LUA_DEVICES false)

I am not sure if this is the correct way to solve the issue so keeping the issue open.

Cirromulus commented 1 year ago

Thanks for looking into it! We don't want any hardcoded library paths in there, so we can't accept this patch. But you can add the path to the cmake command if your system has different versions of the glibc: cmake -DLUA_LIB="/path/to/lua;/others" ..