Add a conditional define for wasm target.
Compiling for wasm needed a conditional define in order to properly define the entropy function. I created a PR, its a small change, I'm not sure WASM is the right name, it has been some years since I have worked in C.
Compiling for wasm needed a conditional define in order to properly define the entropy function. I created a PR, its a small change, I'm not sure WASM is the right name, it has been some years since I have worked in C.
As I already wrote in my review of your PR I'm not against adding support for WebAssembly in principle. However, according to this StackOverflow post there doesn't exist a common C preprocessor symbol for WebAssembly support. So, defining the symbol __WASM__ will probably only work if the symbol is explicitly defined by the developer on invoking the compiler.
I had already fixed those issues, and it looked pretty much like your changes. I had several changes I was trying to squash into one change, it looks like I merged them instead. I will get that pushed up.
I tried to research what would be common, the article you cited and this one https://reviews.llvm.org/D57155 for wasi were pretty much all I found. Wasi is the sysroot I compile against. But I imagine wasi may have many flavors.
Actually I need to look at my local changes, getentropy has to be extern if wasm.
I had already fixed those issues, and it looked pretty much like your changes. I had several changes I was trying to squash into one change, it looks like I merged them instead. I will get that pushed up.
Ok, I will then review your PR again.
I tried to research what would be common, the article you cited and this one https://reviews.llvm.org/D57155 for wasi were pretty much all I found. Wasi is the sysroot I compile against. But I imagine wasi may have many flavors.
Well, for now I'm fine with the symbol __WASM__. It can be changed later on, if someone comes up with a better reliable approach.
Thank you for getting this merged. I have a pretty solid wasm browser implementation working. I'll post details when I have a bit more time. I read several older/closed issues where people were having trouble compiling on ARM with NEON, I've kept pretty good notes on building with clang and gcc for quite a few platforms. I'll try to put them into a readable form, it might be useful for others.
Thank you for getting this merged.
You are welcome.
I have a pretty solid wasm browser implementation working. I'll post details when I have a bit more time.
Great. For sure, this will be of interest for other developers.
I read several older/closed issues where people were having trouble compiling on ARM with NEON, I've kept pretty good notes on building with clang and gcc for quite a few platforms. I'll try to put them into a readable form, it might be useful for others.
TIA. (I added GitHub CI jobs for testing to build the project on ARM and ARM64 architectures in February, but I don't have own ARM hardware at hand for testing.)
Closing this issue, because the requested conditional was introduced more than a year ago, and no further information regarding compilation for ARM architectures was given.