cargo-zigbuild
cargo-zigbuild copied to clipboard
Linking is not working correctly
I try to build my example:
$ cargo zigbuild --target armv7-unknown-linux-gnueabihf.2.33 --release
If I check it:
$ readelf -s ./target/armv7-unknown-linux-gnueabihf/release/example | grep GLIBC_2.34
11: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
15: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
47: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
49: 00000000 0 FUNC GLOBAL DEFAULT UND _[...]@GLIBC_2.34 (3)
50: 00000000 0 FUNC WEAK DEFAULT UND _[...]@GLIBC_2.34 (3)
61: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
70: 00000000 0 FUNC GLOBAL DEFAULT UND dlsym@GLIBC_2.34 (3)
83: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
84: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
92: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
103: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
111: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
114: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
132: 00000000 0 FUNC GLOBAL DEFAULT UND p[...]@GLIBC_2.34 (3)
43271: 00000000 0 FUNC GLOBAL DEFAULT UND dlsym@GLIBC_2.34
I have GLIBC_2.34 instead of GLIBC_2.33.
This has been covered in the README, are you sure you're not doing a static build or any other known condition that would fail? You should provide more details for reproducing.
If you think it is related due to the different target platform, try confirm that you get expected behaviour when building for your native target.
Further details on linking behaviour is covered thoroughly here (which is where the related README content was derived from):
- https://github.com/rust-cross/cargo-zigbuild/pull/232#discussion_r1519253113
- https://github.com/rust-cross/cargo-zigbuild/issues/231#issuecomment-1987845738