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

Failed to execute llvm-box #27

Open
windowsair opened this issue Dec 24, 2023 · 1 comment
Open

Failed to execute llvm-box #27

windowsair opened this issue Dec 24, 2023 · 1 comment

Comments

@windowsair
Copy link
Contributor

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
Copy link
Contributor Author

Hmm, it seems that printf is used differently in llvm-box compared to a simple printf version of wasm. The TTY part of the JS code was not called throughout the process.

image

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

1 participant