emception icon indicating copy to clipboard operation
emception copied to clipboard

Failed to execute llvm-box

Open windowsair opened this issue 6 months ago • 1 comments

Hi, thanks for the very cool work you do!

I'm having some problems with the llvm-box. I noticed that the llvm-box did not have any console output at runtime, and the exit code was always 1. So I modified the llvm-box wrapper like this :

int main(int argc, const char ** argv) {
    printf("hello,world"); // add this
    if (argc < 1) return 2; // change this

    const char * argv0 = argv[0];

    --argc;
    ++argv;

    #include "llvm-box-entry-gen.hpp"

    fprintf(stderr, "LLVM command \"%s\" not found", argv0);

    return 1;
}

It can be sure that argv is set, but the exit code is still 1 and printf("hello,word") doesn't output anything. Testing with my own wasm hello world program outputs it correctly.

I'm not an expert on wasm, am I doing something wrong? Thank you.

windowsair avatar Dec 24 '23 05:12 windowsair