Closed arnaudgolfouse closed 1 year ago
Maybe we should also use musl ?
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl
cp target/x86_64-unknown-linux-musl/release/libdijkstra_map_gd.so addons/dijkstra-map/Dijkstra_map_library/bin/linux/libdijkstra_map_gd-MUSL.so
I personally get the error
error: cannot produce cdylib for `dijkstra_map_gd v0.1.0 (...Dijkstra_map_for_Godot/dijkstra-map-gd)`
as the target `x86_64-unknown-linux-musl` does not support these crate types
It's required that we provide a .so file to godot so seems like a dead end
Yep, but this should work by also creating the .cargo/config.toml
as described in the first comment (at least that’s what happened for me :) ). I don’t exactly know what will be the difference in the end though…
The issue
The latest
addons/dijkstra-map/Dijkstra_map_library/bin/linux/libdijkstra_map_gd.so
does not work on my machine : it fails withAfter investigation, it seems to be because this specific
.so
was compiled on Ubuntu 22.04, whereas I am running Ubuntu 20.04. This causes the version of GLIBC required to be at least 2.34, but it seems to be 2.31 in Ubuntu 20.04.We can indeed see that there are symbols depending explicitly on GLIBC_2.33 or GLIBC_2.34:
```sh > readelf -s addons/dijkstra-map/Dijkstra_map_library/bin/linux/libdijkstra_map_gd.so | grep GLIBC_2.33 16: 0000000000000000 0 FUNC GLOBAL DEFAULT UND stat64@GLIBC_2.33 (8) 38: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fstat64@GLIBC_2.33 (8) 705: 0000000000000000 0 FUNC GLOBAL DEFAULT UND stat64@GLIBC_2.33 730: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fstat64@GLIBC_2.33 > readelf -s addons/dijkstra-map/Dijkstra_map_library/bin/linux/libdijkstra_map_gd.so | grep GLIBC_2.34 10: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_getspecific@GLIBC_2.34 (6) 17: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_key_create@GLIBC_2.34 (6) 22: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_key_delete@GLIBC_2.34 (6) 44: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_setspecific@GLIBC_2.34 (6) ``` So, informations about files, and some pthread functions.I believe this will also fail in any scenario where the GLIBC version on the compiling machine is higher that the end user's...
The solution ?
There is, apparently, a possible solution to this: just create the file
.cargo/config.toml
, and put the following contents in it:Then rebuild the library.
This would need someone to test it on Ubuntu 22.04, and then either
readelf -s addons/dijkstra-map/Dijkstra_map_library/bin/linux/libdijkstra_map_gd.so | grep GLIBC_2.33
, check that the output is empty, or ;@astrale-sharp Maybe you could do this ? 😁