Closed Bug 1441425 Opened 8 years ago Closed 7 years ago

xpcom-gtest compilation fails at #[derive(xpcom)] expected i8, found u8 on Linux ARMv7

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1453551

People

(Reporter: hsivonen, Assigned: hsivonen)

References

Details

Attachments

(1 file)

Steps to reproduce: 1) Find a Linux ARMv7+NEON system with more than 2 GB of RAM (to let a 32-bit process get the max 2 GB). 2) Build Firefox with --disable-debug --enable-optimize --disable-crashreporter --disable-debug-symbols --disable-av1 --disable-webrtc 3) ./mach gtest Actual results: 0:00.72 /usr/bin/make -C testing/gtest -j4 -s gtest 0:01.62 force-cargo-library-build 0:03.96 Compiling xpcom-gtest v0.1.0 (file:///var/host/media/removable/gecko/gecko/xpcom/rust/gtest/xpcom) 0:05.23 error[E0308]: mismatched types 0:05.23 --> /var/host/media/removable/gecko/gecko/xpcom/rust/gtest/xpcom/test.rs:22:14 0:05.23 | 0:05.23 22 | #[derive(xpcom)] 0:05.23 | ^^^^^ expected i8, found u8 0:05.23 | 0:05.24 = note: expected type `*const i8` 0:05.24 found type `*const u8` 0:05.24 0:05.25 error[E0308]: mismatched types 0:05.25 --> /var/host/media/removable/gecko/gecko/xpcom/rust/gtest/xpcom/test.rs:36:36 0:05.25 | 0:05.25 36 | assert!(CStr::from_ptr(topic).to_str() == Ok("test-rust-observe")); 0:05.25 | ^^^^^ expected u8, found i8 0:05.25 | 0:05.25 = note: expected type `*const u8` 0:05.25 found type `*const i8` 0:05.26 0:05.30 error: aborting due to 2 previous errors 0:05.30 0:05.96 error: Could not compile `xpcom-gtest`. Expected results: Expected gtest to compile and run as on x86_64 with the same revision.
Does derive(xpcom) depend on platform C++ char signedness? Does char signedness differ between ARMv7 and x86_64 Linux?
Flags: needinfo?(nika)
The problem here is that when I wrote the signature I incorrectly assumed c_char was i8 here: https://searchfox.org/mozilla-central/rev/056a4057575029f58eb69ae89bc7b6c3c11e2e28/xpcom/rust/gtest/xpcom/test.rs#32 To fix this, we just need to change that *const i8 to a *const libc::c_char or *const std::os::raw::c_char. It seems like char signedness does differ between ARMv7 and x86_64 linux.
Flags: needinfo?(nika)
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Comment on attachment 8955089 [details] Bug 1441425 - Avoid assuming c_char signedness in gtest for Rust bindings for XPCOM. https://reviewboard.mozilla.org/r/224250/#review230292
Attachment #8955089 - Flags: review?(nika) → review+
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: