-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
Description
Building rust-libxml on FreeBSD for i386 architecture fail due to binding tests.
The same code works perfectly for other architectures : adm64, arm32, arm64
Compiling libxml v0.3.8 (/root/rust-libxml)
error[E0080]: attempt to compute `16_usize - 20_usize`, which would overflow
--> /root/rust-libxml/target/debug/build/libxml-a2b7c127d8710574/out/bindings.rs:417:29
|
417 | ["Size of __max_align_t"][::std::mem::size_of::<__max_align_t>() - 20usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `bindings::_` failed here
The issue seems to be related to the way __max_align_t size is evaluated. I don't know if it's relevant but I did the following test in C with clang
#include <stdio.h>
#include <stddef.h>
int main()
{
printf("max_align size = %d\n", sizeof(max_align_t));
}
Who returns : max_align size = 20
If I disabling the test with .layout_tests(false) the compilation works and produce a completely usable rust-libxlm binary I was able to test when compiling hurl
Build environment:
- FreeBSD FreeBSD 14.3 i386
- clang version 19.1.7
- rust 1.90.0