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

Broken binary on 64-bit Windows #269

Closed
seishun opened this issue Feb 7, 2020 · 5 comments
Closed

Broken binary on 64-bit Windows #269

seishun opened this issue Feb 7, 2020 · 5 comments

Comments

@seishun
Copy link
Contributor

seishun commented Feb 7, 2020

I might be doing something wrong, but it seems binding.cc gets built for x64, while the Rust code gets built for x86. This causes linker errors when this crate is used: denoland/deno#3716

Steps:

  1. Clone the repo and run cargo build -vv.
  2. Open target/debug/librusty_v8.rlib in 7-Zip, extract rusty_v8/binding.obj and one of the Rust .o files, compare their dumpbin /headers outputs.

Expected: same "machine" values.

Actual: Rust object files have 14C machine (x86), binding.obj has 8664 machine (x64).

@piscisaureus
Copy link
Member

What does the output of rustup show look like?

@seishun
Copy link
Contributor Author

seishun commented Feb 8, 2020

Default host: i686-pc-windows-msvc
rustup home:  C:\Users\Nikolai\.rustup

stable-i686-pc-windows-msvc (default)
rustc 1.41.0 (5e1a79984 2020-01-27)

@piscisaureus
Copy link
Member

piscisaureus commented Feb 9, 2020

We don't support building Deno for 32-bit x86 targets, and I'm not sure we ever will.
So i'd suggest to install the 64-bit rust toolchain. I'm not really sure how to do this, so I'd suggest:

  1. Uninstall rust / rustup.
  2. Install rust using rustup-init x64 from https://win.rustup.rs/x86_64

This is what you're after:

D:\deno2>rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\BertBelder\.rustup

installed toolchains
--------------------

stable-x86_64-pc-windows-msvc (default)

active toolchain
----------------

stable-x86_64-pc-windows-msvc (default)

@seishun
Copy link
Contributor Author

seishun commented Feb 9, 2020

Should that be mentioned in the docs here (and in deno)? Currently, installing Rust from https://www.rust-lang.org/tools/install will get you a 32-bit toolchain by default (although it seems it's going to change, see rust-lang/rustup#2186 and rust-lang/www.rust-lang.org#1004).

@ry
Copy link
Member

ry commented Feb 9, 2020

@seishun yes some comments in the manual would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants