github.com/jwijenbergh/purego@v0.0.0-20240126093400-70ff3a61df13/internal/fakecgo/freebsd.go (about)

     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  
     5  //go:build freebsd && !cgo
     6  
     7  package fakecgo
     8  
     9  import _ "unsafe" // for go:linkname
    10  
    11  // Supply environ and __progname, because we don't
    12  // link against the standard FreeBSD crt0.o and the
    13  // libc dynamic library needs them.
    14  
    15  // Note: when building with cross-compiling or CGO_ENABLED=0, add
    16  // the following argument to `go` so that these symbols are defined by
    17  // making fakecgo the Cgo.
    18  //   -gcflags="github.com/jwijenbergh/purego/internal/fakecgo=-std"
    19  
    20  //go:linkname _environ environ
    21  //go:linkname _progname __progname
    22  
    23  //go:cgo_export_dynamic environ
    24  //go:cgo_export_dynamic __progname
    25  
    26  var _environ uintptr
    27  var _progname uintptr