freebsd.go 793 B

123456789101112131415161718192021222324252627
  1. // Copyright 2010 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build freebsd && !cgo
  5. package fakecgo
  6. import _ "unsafe" // for go:linkname
  7. // Supply environ and __progname, because we don't
  8. // link against the standard FreeBSD crt0.o and the
  9. // libc dynamic library needs them.
  10. // Note: when building with cross-compiling or CGO_ENABLED=0, add
  11. // the following argument to `go` so that these symbols are defined by
  12. // making fakecgo the Cgo.
  13. // -gcflags="github.com/ebitengine/purego/internal/fakecgo=-std"
  14. //go:linkname _environ environ
  15. //go:linkname _progname __progname
  16. //go:cgo_export_dynamic environ
  17. //go:cgo_export_dynamic __progname
  18. var _environ uintptr
  19. var _progname uintptr