Closed
Description
I am using the following features and I recieved a ton of linker errors when using the linux musl target. Any ideas how I can get this to build statically without linker errors? This seemed to be the easiest lua engine in rust that is up to date that I've found, yet it doesn't seem to build statically 😕
mlua = { git = "https://github.com/khvzak/mlua", default-features = false, features = [
"luajit",
"vendored",
"module",
"async",
"send",
"serialize",
"macros",
] }
::ptr::drop_in_place<core::result::Result<mlua::table::Table,mlua::error::Error>>':
packa.46f14847-cgu.0:(.text._ZN4core3ptr88drop_in_place$LT$core..result..Result$LT$mlua..table..Table$C$mlua..error..Error$GT$$GT$17hafc083c1789007b0E+0x32): undefined reference to `lua_pushnil'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4core3ptr88drop_in_place$LT$core..result..Result$LT$mlua..table..Table$C$mlua..error..Error$GT$$GT$17hafc083c1789007b0E+0x41): undefined reference to `lua_replace'
/usr/bin/ld: /mnt/data/projects/theos/core/target/x86_64-unknown-linux-musl/release/deps/packa-e94598e29a96bb64.packa.46f14847-cgu.0.rcgu.o: in function `mlua::table::Table::get':
packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17ha575e4fb41f2dd36E+0xf5): undefined reference to `lua_gettop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17ha575e4fb41f2dd36E+0x110): undefined reference to `lua_checkstack'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17ha575e4fb41f2dd36E+0x12c): undefined reference to `lua_pushvalue'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17ha575e4fb41f2dd36E+0x142): undefined reference to `lua_xmove'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17ha575e4fb41f2dd36E+0x1f4): undefined reference to `lua_gettop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17ha575e4fb41f2dd36E+0x210): undefined reference to `lua_settop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17ha575e4fb41f2dd36E+0x3be): undefined reference to `lua_gettop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17ha575e4fb41f2dd36E+0x3d1): undefined reference to `lua_settop'
/usr/bin/ld: /mnt/data/projects/theos/core/target/x86_64-unknown-linux-musl/release/deps/packa-e94598e29a96bb64.packa.46f14847-cgu.0.rcgu.o: in function `mlua::table::Table::get':
packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0xf6): undefined reference to `lua_gettop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x111): undefined reference to `lua_checkstack'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x12e): undefined reference to `lua_pushvalue'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x144): undefined reference to `lua_xmove'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x201): undefined reference to `lua_gettop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x21d): undefined reference to `lua_settop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x54c): undefined reference to `lua_gettop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x563): undefined reference to `lua_settop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x5da): undefined reference to `lua_pushnil'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua5table5Table3get17h882d8968726157eeE+0x5ea): undefined reference to `lua_replace'
/usr/bin/ld: /mnt/data/projects/theos/core/target/x86_64-unknown-linux-musl/release/deps/packa-e94598e29a96bb64.packa.46f14847-cgu.0.rcgu.o: in function `mlua::conversion::<impl mlua::value::ToLua for &str>::to_lua':
packa.46f14847-cgu.0:(.text._ZN4mlua10conversion56_$LT$impl$u20$mlua..value..ToLua$u20$for$u20$$RF$str$GT$6to_lua17hfad88570daaae71cE+0x25): undefined reference to `lua_gettop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua10conversion56_$LT$impl$u20$mlua..value..ToLua$u20$for$u20$$RF$str$GT$6to_lua17hfad88570daaae71cE+0x3a): undefined reference to `lua_checkstack'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua10conversion56_$LT$impl$u20$mlua..value..ToLua$u20$for$u20$$RF$str$GT$6to_lua17hfad88570daaae71cE+0x5b): undefined reference to `lua_gettop'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua10conversion56_$LT$impl$u20$mlua..value..ToLua$u20$for$u20$$RF$str$GT$6to_lua17hfad88570daaae71cE+0x70): undefined reference to `lua_pushcclosure'
/usr/bin/ld: packa.46f14847-cgu.0:(.text._ZN4mlua
Activity
khvzak commentedon Feb 17, 2022
Similar to #85
Could you try to follow the steps from the linked issue.
theoparis commentedon Apr 8, 2022
Not sure if this should be a new issue but I have a new project that does NOT use musl but that gives undefined reference errors along with luau...
I'm using the following dependency configuration:
theoparis commentedon Apr 8, 2022
It seems to also be occurring with lua54 actually 🤔
khvzak commentedon Apr 10, 2022
I'm afraid Luau does not support binary modules at all.
What is your os? Could you try to add "vendored" feature?
theoparis commentedon Apr 20, 2022
I'm on Arch Linux and I tried to use the vendored feature with the lua54 feature again, however it continues to complain about undefined references to lua libraries. If I don't have the vendored feature it will complain about pkgconfig.
khvzak commentedon Jul 17, 2023
Please reopen is this stil actual