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

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

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

go build -gccgoflags=-mllvm=XXX hello.go

@wyw900807
Copy link
Author

It works. Thank you very much !

@golang golang locked and limited conversation to collaborators Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants