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

freebsd build got error #4800

Open
runsys opened this issue Mar 12, 2025 · 1 comment
Open

freebsd build got error #4800

runsys opened this issue Mar 12, 2025 · 1 comment

Comments

@runsys
Copy link

runsys commented Mar 12, 2025

root@fbsdvp:/mnt/work/code/go/src/github.com/tinygo-org/tinygo # export CPPFLAGS=-I/usr/local/llvm18/include root@fbsdvp:/mnt/work/code/go/src/github.com/tinygo-org/tinygo # go build # tinygo.org/x/go-llvm /mnt/work/code/go/pkg/mod/tinygo.org/x/[email protected]/analysis.go:16:10: fatal error: 'llvm-c/Analysis.h' file not found 16 | #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. root@fbsdvp:/mnt/work/code/go/src/github.com/tinygo-org/tinygo #

@aykevl
Copy link
Member

aykevl commented Mar 13, 2025

Please take a look at how to set CGo variables in the docs. In particular:

When building, the CGO_CFLAGS, CGO_CPPFLAGS, CGO_CXXFLAGS, CGO_FFLAGS and CGO_LDFLAGS environment variables are added to the flags derived from these directives. Package-specific flags should be set using the directives, not the environment variables, so that builds work in unmodified environments. Flags obtained from environment variables are not subject to the security limitations described above.

I think you need to use CGO_CPPFLAGS instead.

Please note that FreeBSD isn't really supported at the moment. It might work, or it might not. But we don't test for it.

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

2 participants