cargo-zigbuild icon indicating copy to clipboard operation
cargo-zigbuild copied to clipboard

can't build sqlx in glibc.2.17

Open peacess opened this issue 8 months ago • 1 comments

libsqlx_macros-9e58b39bda010bf1.so: undefined symbol: __ubsan_handle_type_mismatch_v1

cmd: cargo zigbuild --release --target x86_64-unknown-linux-gnu.2.17

peacess avatar Apr 11 '25 12:04 peacess

Possibly related to https://github.com/ziglang/zig/issues/23052

You can try working down the glibc versions to see if there's a specific version the breakage happens at, otherwise it's something else.

I've encountered this sort of problem when building crates that build/link a build that didn't seem to get built from zig itself, thus it used the system glibc and when linking to an older glibc target with zig, the symbol is not valid so build fails.

I'm currently trying to investigate this with libbpf-sys crate which seems to introduce the issue as building the C library directly with zig cc works without issues. Not sure if it's something specific to the crate or a difference introduced from cargo zigbuild.

polarathene avatar Jun 29 '25 04:06 polarathene