-
Notifications
You must be signed in to change notification settings - Fork 45
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
Can't compile with build-bindgen #20
Comments
Are you certain that you properly set up clang? I unfortunately do not have access to a MacOS machine so I can't test this and the stderr output doesn't really help me out either. But I do believe this problem lies with either you clang setup or bindgen itself from looking through its issue tracker. |
I think I resolved the issue because I'm cross compiling to
Seems to work, although another issue appears.
It seems like I'm unable to compile wasm3/source with |
This might be on me, given that it only seems to fail due to wasi stuff. Can you see if this also happens when building without the wasi feature? wasm3 = { version = *, default-features = false, features = ["std", "use-32bit-slots"] } |
Looks like for some reason it doesn't find this header/the defines in there https://github.com/wasm3/wasm3/blob/a207a3328ff64a3392a575f112582f6d4c12a5d7/source/extra/wasi_core.h |
Can't compile it using
For some reason the code that was working before including wasm3 now gives error, but I can ignore it for now. The main error is the absense of an allocator, probably because you are assuming std is available right? In no_std I don't have an allocator. I've also noticed that |
The crate still relies on |
Not a big issue atm, I'd like just being able to do 2+2 in WASM 😄 So for now it means that I have to implement an allocator, maybe one from phil's tutorial? https://os.phil-opp.com/allocator-designs/#implementation-for-locked-bumpallocator |
Maybe you can use https://github.com/rust-embedded/alloc-cortex-m? I'm not well versed in embedded dev so just throwing that in😄 Rolling your own ofc would also work. |
Alright, forgot about that one thanks! Okay I'll let you know then, thanks very much for the kind support |
No problem. Just letting you know that I don't know though whether I can look into the wasi problem atm as its been quite a bit since i properly worked on this crate myself + I only have a windows and a linux machine to test with so I cant even reproduce this problem. |
No worries, any help is appreciated 😄
Seems like it isn't able to use normal C functions, maybe bacause of the thumbv7em-none-eabi target. I'll investigate a bit |
That looks like its missing libc for linking. |
This could partially be caused by my buildscript though. It's not the best and it is definitely missing some things. |
Some progress again, although it may not help too much because AFAIK this crate doesn't use cmake. But being unable to compile it with bindgen, I resorted to trying to compile the original wasm3 and after some nasty issues with clang I was able to solve it: wasm3/wasm3#174 It's also compiled with WASI support, so the issue is something about bindgen or the buildscript, not wasm3 or clang I suppose. |
The buildscript is supposed to replace the cmake configuration, but as you might be able to tell as well, it's not complete. So it might be missing a flag required for your platform to work atm. |
#21 solved the issue for me. There is still an open question about how to deal with wasm3 compilation flags because compiling the C code for embedded and linking with Rust lld results in missing intrinsics, which could be avoided setting |
I can't get to compile to crate in any way. I've installed clang from brew and also MacOS Xcode devtools, but if I use the
build-bindgen
features I get the following error:Trying instead to compile it without the bindgen feature results in the following error:
I've also tried to just run
clang -v a.c
wherea.c
contains only an include of stdio.h and it works without issue, meaning it's able to find the header file. So the issue is in rust bindgen or something in this crate I suppose.The text was updated successfully, but these errors were encountered: