Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

servo (mozjs, servo/dom/bindings) won't build on 32bit Ubuntu #307

Closed
astrieanna opened this issue Mar 21, 2013 · 1 comment
Closed

servo (mozjs, servo/dom/bindings) won't build on 32bit Ubuntu #307

astrieanna opened this issue Mar 21, 2013 · 1 comment

Comments

@astrieanna
Copy link
Contributor

@astrieanna astrieanna commented Mar 21, 2013

I am attempting to run Servo by following the instructions in the Readme for Debian-base Linux. I am running 32-bit Xubuntu.

I am as far as attempting to run make.

I get this error output from make:

make[1]: Entering directory `/home/leah/code/servo/build/src/rust-mozjs'
/home/leah/code/servo/build/src/rust/i686-unknown-linux-gnu/stage2/bin/rustc -A default_methods -O -L /home/leah/code/servo/build/src/mozjs /home/leah/code/servo/src/rust-mozjs/js.rc -o libjs.dummy
/home/leah/code/servo/src/rust-mozjs/js.rc:93:28: 93:42 error: mismatched types: expected `i32` but found `i64` (expected i32 but found i64)
/home/leah/code/servo/src/rust-mozjs/js.rc:93 pub const JSID_VOID: jsid = JSID_TYPE_VOID;
                                                                          ^~~~~~~~~~~~~~
error: aborting due to previous error
make[1]: *** [libjs.dummy] Error 101
make[1]: Leaving directory `/home/leah/code/servo/build/src/rust-mozjs'
make: *** [/home/leah/code/servo/build/src/rust-mozjs/lib*.dummy] Error 2

The relevant line from mozjs.rs is:

pub const JSID_VOID: jsid = JSID_TYPE_VOID;

The definition of JSID_TYPE_VOID is just above that:

pub const JSID_TYPE_VOID: i64 = 2;

I'm not sure whether it applies to JSID_TYPE_VOID, but there's a block of constants just above the one containing it that starts with this comment:

//The following constants are totally broken on non-64bit platforms.
//See jsapi.h for the proper macro definitions.

Upon looking in jsapi.h for the proper definitions for 32bit platforms, I found that they don't exist:

/* FIXME: global variable JSVAL_NULL */

Compiling without JSVAL_NULL defined causes errors elsewhere.

At this point, I looked for any documentation that might say "Servo is for 64bit platforms only" or something similar, but I didn't find anything to that effect.

I decided to ignore the JSVAL_ globals and look just for some JSID_TYPE_VOID definitions in jsapi.h instead. I found a block with a JSTYPE_VOID, so I took those and renamed them from names starting with JSTYPE_ to equivalent ones beginning JSID_TYPE_. After the compiler complained, I changed their types from u32 to i32.

I'm not sure if this is the right thing to do, but it made mozjs compile.

Now, make has reached a new error (in servo/dom/bindings) about findings a u64 where it expected a u32.

The full make output is in this gist, but these are the errors:

/home/leah/code/servo/src/servo/dom/bindings/node.rs:73:39: 73:61 error: mismatched types: expected `u32` but found `u64` (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/node.rs:73     let val = js::GetReservedSlot(obj, DOM_OBJECT_SLOT as u64);
                                                                                               ^~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:58:46: 58:74 error: mismatched types: expected `u32` but found `u64` (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:58     let v = GetFunctionNativeReserved(callee, TOSTRING_CLASS_RESERVED_SLOT);
                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:61:46: 61:73 error: mismatched types: expected `u32` but found `u64` (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:61     let v = GetFunctionNativeReserved(callee, TOSTRING_NAME_RESERVED_SLOT);
                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:450:47: 450:75 error: mismatched types: expected `u32` but found `u64` (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:450         SetFunctionNativeReserved(toStringObj, TOSTRING_CLASS_RESERVED_SLOT,
                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:456:47: 456:74 error: mismatched types: expected `u32` but found `u64` (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:456         SetFunctionNativeReserved(toStringObj, TOSTRING_NAME_RESERVED_SLOT,
                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/proxyhandler.rs:62:59: 62:104 error: mismatched types: expected `u32` but found `u64` (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/proxyhandler.rs:62     let chars: *mut jschar = cast::transmute(JS_malloc(cx, nchars as u64 * (size_of::<jschar>() as u64)));
                                                                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/proxyhandler.rs:72:59: 72:72 error: mismatched types: expected `u32` but found `u64` (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/proxyhandler.rs:72     let jsstr = JS_NewUCString(cx, cast::transmute(chars), nchars as u64);
                                                                                                                           ^~~~~~~~~~~~~
error: aborting due to 7 previous errors
make: *** [servo] Error 101

It seems like there are a lot of 32/64 bit errors, so either Servo is not meant to build on 32bit machines (which should be in the Readme) or I'm doing something wrong. I'd be really happy if it's the latter and you can tell me what it is. :)

In case it is relevant, gnome system monitor says my OS version is:

Ubuntu Release 12.10 (quantal) 32-bit
Kernel Linux 3.5.0-23-generic
@burg
Copy link

@burg burg commented Mar 21, 2013

We have not attempted 32bit support, AFAIK. It adds complexity that we dont want to explore right now. The Readme should be more explicit about that.

On Mar 21, 2013, at 5:39, Leah Hanson notifications@github.com wrote:

I am attempting to run Servo by following the instructions in the Readme for Debian-base Linux. I am running 32-bit Xubuntu.

I am as far as attempting to run make.

I get this error output from make:

make[1]: Entering directory /home/leah/code/servo/build/src/rust-mozjs' /home/leah/code/servo/build/src/rust/i686-unknown-linux-gnu/stage2/bin/rustc -A default_methods -O -L /home/leah/code/servo/build/src/mozjs /home/leah/code/servo/src/rust-mozjs/js.rc -o libjs.dummy /home/leah/code/servo/src/rust-mozjs/js.rc:93:28: 93:42 error: mismatched types: expectedi32but foundi64(expected i32 but found i64) /home/leah/code/servo/src/rust-mozjs/js.rc:93 pub const JSID_VOID: jsid = JSID_TYPE_VOID; ^~~~~~~~~~~~~~ error: aborting due to previous error make[1]: *** [libjs.dummy] Error 101 make[1]: Leaving directory/home/leah/code/servo/build/src/rust-mozjs'
make: ** [/home/leah/code/servo/build/src/rust-mozjs/lib.dummy] Error 2
The relevant line from mozjs.rs is:

pub const JSID_VOID: jsid = JSID_TYPE_VOID;
The definition of JSID_TYPE_VOID is just above that:

pub const JSID_TYPE_VOID: i64 = 2;
I'm not sure whether it applies to JSID_TYPE_VOID, but there's a block of constants just above the one containing it that starts with this comment:

//The following constants are totally broken on non-64bit platforms.
//See jsapi.h for the proper macro definitions.
Upon looking in jsapi.h for the proper definitions for 32bit platforms, I found that they don't exist:

/* FIXME: global variable JSVAL_NULL */
Compiling without JSVAL_NULL defined causes errors elsewhere.

At this point, I looked for any documentation that might say "Servo is for 64bit platforms only" or something similar, but I didn't find anything to that effect.

I decided to ignore the JSVAL_ globals and look just for some JSID_TYPE_VOID definitions in jsapi.h instead. I found a block with a JSTYPE_VOID, so I took those and renamed them from names starting with JSTYPE_ to equivalent ones beginning JSID_TYPE_. After the compiler complained, I changed their types from u32 to i32.

I'm not sure if this is the right thing to do, but it made mozjs compile.

Now, make has reached a new error (in servo/dom/bindings) about findings a u64 where it expected a u32.

The full make output is in this gist, but these are the errors:

/home/leah/code/servo/src/servo/dom/bindings/node.rs:73:39: 73:61 error: mismatched types: expected u32 but found u64 (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/node.rs:73 let val = js::GetReservedSlot(obj, DOM_OBJECT_SLOT as u64);
^~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:58:46: 58:74 error: mismatched types: expected u32 but found u64 (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:58 let v = GetFunctionNativeReserved(callee, TOSTRING_CLASS_RESERVED_SLOT);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:61:46: 61:73 error: mismatched types: expected u32 but found u64 (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:61 let v = GetFunctionNativeReserved(callee, TOSTRING_NAME_RESERVED_SLOT);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:450:47: 450:75 error: mismatched types: expected u32 but found u64 (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:450 SetFunctionNativeReserved(toStringObj, TOSTRING_CLASS_RESERVED_SLOT,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:456:47: 456:74 error: mismatched types: expected u32 but found u64 (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/utils.rs:456 SetFunctionNativeReserved(toStringObj, TOSTRING_NAME_RESERVED_SLOT,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/proxyhandler.rs:62:59: 62:104 error: mismatched types: expected u32 but found u64 (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/proxyhandler.rs:62 let chars: mut jschar = cast::transmute(JS_malloc(cx, nchars as u64 * (size_of::() as u64)));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/leah/code/servo/src/servo/dom/bindings/proxyhandler.rs:72:59: 72:72 error: mismatched types: expected u32 but found u64 (expected u32 but found u64)
/home/leah/code/servo/src/servo/dom/bindings/proxyhandler.rs:72 let jsstr = JS_NewUCString(cx, cast::transmute(chars), nchars as u64);
^~~~~~~~~~~~~
error: aborting due to 7 previous errors
make: *
* [servo] Error 101
It seems like there are a lot of 32/64 bit errors, so either Servo is not meant to build on 32bit machines (which should be in the Readme) or I'm doing something wrong. I'd be really happy if it's the latter and you can tell me what it is. :)

In case it is relevant, gnome system monitor says my OS version is:

Ubuntu Release 12.10 (quantal) 32-bit
Kernel Linux 3.5.0-23-generic

Reply to this email directly or view it on GitHub.

@brson brson closed this in e2c5249 Mar 26, 2013
ChrisParis pushed a commit to ChrisParis/servo that referenced this issue Sep 7, 2014
Add additional tests for the named getter in form with other listed elements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.