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

Request to support BIG Endian architecture #45

Open
vishwabmc opened this issue Jul 29, 2022 · 2 comments
Open

Request to support BIG Endian architecture #45

vishwabmc opened this issue Jul 29, 2022 · 2 comments

Comments

@vishwabmc
Copy link

vishwabmc commented Jul 29, 2022

Hello,

I am building https://github.com/ProjectOpenSea/seaport#readme on s390x platform, which is a BIG Endian, and running into an issue where I get Runtime error: expected the system to be little-endian! error. I talked to Vasili Skurydzin (https://github.com/V-for-Vasili) and he figured out that the error was coming from node_modules/rustbn.js/lib/index.asm.js

Commands I ran :

git clone https://github.com/ProjectOpenSea/seaport && cd seaport
yarn set version 1.22.19
yarn install
yarn build
yarn test

The command that gives this error is yarn test.

node.js version : v10.19.0
yarn version : 1.22.19

Could you please help if you would be providing a version that supports BIG Endian architecture ?. Thank you very much for your support !.

!! Vishwa !!

@V-for-Vasili
Copy link

V-for-Vasili commented Jul 29, 2022

To give some context: I have previously looked into making Emscripten support BE architectures (by default it doesn't as WASM is Little Endian by definition).

Emscripten supports cross-compiling for BE machines since emscripten-core/emscripten#13413. If you add -sSUPPORT_BIG_ENDIAN flag to emcc calls then the generated .wasm/.js files can be run on BE machines same way as they are run on x64 (Instead of giving the usual Runtime error: expected the system to be little-endian!).

@acolytec3
Copy link
Contributor

Would it make more sense to update this package to use a different WASM toolchain perhaps? I'm not super knowledgeable on rust but it looks like the emscripten target is pretty poorly supported and maybe we could update this to use wasm-unknown-unknown instead and compile with wasm-bindgen or else wasi? I'm not sure if that would get around this issue or not.

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