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

Run failed when set GOOS and GOARCH even cross-compile is ignored #553

Open
fuxiaohei opened this issue Jul 24, 2024 · 0 comments
Open

Run failed when set GOOS and GOARCH even cross-compile is ignored #553

fuxiaohei opened this issue Jul 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fuxiaohei
Copy link
Contributor

When I try to make support for llgo to build wasm file. It occurs errors but not only in wasm case:

  1. In my Mac M1, clone repo, run go build -v github.com/goplus/llgo/cmd/llgo && ./llgo build -o main-binary main.go, everything works fine.
  2. If I try GOOS=linux GOARCH=arm64 ./llgo build -o main-binary main.go (use other os and arch pair is same), It shows errors:
c/c_linux.go:25:11: undefined: FilePtr
c/c_linux.go:28:12: undefined: FilePtr
c/c_linux.go:31:12: undefined: FilePtr
...

all llgo/c packages show same type error with undefined type.

  1. I found the errors are generated from https://github.com/goplus/llgo/blob/main/internal/packages/load.go#L390

I think we can make it runnable, ignore GOOS and GOARCH to build local target binary; or provide error message to show cross-compile is not supported.

@xushiwei xushiwei added the bug Something isn't working label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants