tinygo-org/go-llvm

Build broken on macOS for llvm v16

willfaught opened this issue · 3 comments

$ brew install llvm # v16
$ cat main.go
package main

import (
	"fmt"

	"tinygo.org/x/go-llvm"
)

func main() {
	_ = llvm.FlagAppleBlock
	fmt.Println("hello")
}
$ go run main.go
# tinygo.org/x/go-llvm
../../Library/Application Support/go/pkg/mod/tinygo.org/x/go-llvm@v0.0.0-20230505123812-8e7ec80422a4/analysis.go:16:10: fatal error: 'llvm-c/Analysis.h' file not found
#include "llvm-c/Analysis.h" // If you are getting an error here you need to build or install LLVM, see https://tinygo.org/docs/guides/build/
         ^~~~~~~~~~~~~~~~~~~
1 error generated.

Installing v15 instead works:

$ brew install llvm@15
$ go run main.go
hello
aykevl commented

That's right, this is not yet supported. Here is the PR to add LLVM 16 support: tinygo-org/tinygo#3741

@aykevl Then shouldn't the documentation be updated to say that for Homebrew on macOS, you should do brew install llvm@15?

aykevl commented

I guess, or I can merge #47 which switches to LLVM 16 by default. This should happen soonish (within a few weeks).