-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
I've cross-built and built natively rust 1.29.2 for (among others) powerpc-unknown-netbsd, and this appears to work fine. I'm now trying to upgrade to rust 1.30.0, and have managed to build it natively (on amd64 / x86_64) and cross-built for sparc64. However, the cross-build for the powerpc target fails with rust type mismatch compile errors, such as this:
Compiling openssl v0.10.11
...
error[E0308]: mismatched types
--> vendor/openssl/src/nid.rs:87:62
|
87 | .map(|nameptr| str::from_utf8(CStr::from_ptr(nameptr).to_bytes()).unwrap())
| ^^^^^^^ expected u8, found i8
|
= note: expected type `*const u8`
found type `*mut i8`
error[E0308]: mismatched types
--> vendor/openssl/src/nid.rs:98:62
|
98 | .map(|nameptr| str::from_utf8(CStr::from_ptr(nameptr).to_bytes()).unwrap())
| ^^^^^^^ expected u8, found i8
|
= note: expected type `*const u8`
found type `*mut i8`
Another example is:
error[E0308]: mismatched types
--> vendor/openssl/src/version.rs:63:24
|
63 | CStr::from_ptr(OpenSSL_version(OPENSSL_VERSION))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
Now, what separates the NetBSD/powerpc target from amd64 and sparc64 is that on NetBSD/powerpc, the char type is unsigned char, whereas on the other two, it is signed char.
Has rust between 1.29.2 and 1.30.0 introduced code which makes assumptions about the signedness of the C type "char"? I've tried diff'ing the various openssl dirs between the two versions, but have unfortunately not found the problem.