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

gollvm: how to compile go source with using -mllvm XXX #42286

Closed
wyw900807 opened this issue Oct 30, 2020 · 2 comments
Closed

gollvm: how to compile go source with using -mllvm XXX #42286

wyw900807 opened this issue Oct 30, 2020 · 2 comments

Comments

@wyw900807
Copy link

@wyw900807 wyw900807 commented Oct 30, 2020

I want to use gollvm to compile go source file and use -mllvm XXX to transfer the additional arguments to LLVM. There is a go source file,

//"hello.go"
package main
import "fmt"
func main() {
fmt.Println("Hello world")
}

But when I input llvm-goc -mllvm XXX -c hello.go, the console outputs "error: import file 'fmt' not found". However, when I input
go build -mllvm XXX hello.go , the console outputs "flag provided but not defined".

Thank you!

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 30, 2020

I don't know what the -mllvm option does, but try

go build -gccgoflags=-mllvm=XXX hello.go
@wyw900807
Copy link
Author

@wyw900807 wyw900807 commented Oct 30, 2020

It works. Thank you very much !

@wyw900807 wyw900807 closed this Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.