Closed ivan-aksamentov closed 2 weeks ago
Closing as duplicate to https://github.com/rust-ndarray/ndarray-linalg/pull/354
Reopening, because my version is better - it uses core::ffi::c_char
not std
.
Either way the root cause is https://github.com/blas-lapack-rs/lapack-sys/pull/15 and it needs to be merged for the thing to not be UB.
https://github.com/rust-ndarray/ndarray-linalg/pull/354 now also uses core::
. Closing
Depends on https://github.com/blas-lapack-rs/lapack-sys/pull/15
This replaces hardcoded platform-specific
char*
types with the opaque types fromcore::ffi
. This is necessary when cross-compiling.I believe when interacting with C and Fortran, both
lax
andlapack-sys
should not assume integer and pointer types. Current setup is biased towards x86_64 platform, for the most part due to a bug inlapack-sys
(see https://github.com/blas-lapack-rs/lapack-sys/pull/15), and it could cause broken builds and undefined behavior on other platforms.For example, cross compilation build could fail with:
Full build log for aarch64-unknown-linux-gnu: build.log.txt
In this PR I change
i8
tocore::ffi::c_char
- this, for example, resolves toi8
on x86 and tou8
on ARM, but is also universal for any platform rust supports, removing bias towards x86.