Skip to content

1.30.0 fails to build for target powerpc-unknown-netbsd #55465

Closed
@he32

Description

@he32

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.

Metadata

Metadata

Assignees

Labels

O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateO-PowerPCTarget: PowerPC processorsO-netbsdOperating system: NetBSDP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions