compilation

package
v1.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CgoEnabled = true

CgoEnabled is set to true if CGO is enabled.

View Source
var MinicoreEnabled = true

MinicoreEnabled is set to true by default. Build with -tags minicore_disabled to disable minicore at compile time. This is useful when building statically linked binaries, as minicore requires dynamic library loading (dlopen) which is incompatible with static linking.

Example: go build -tags minicore_disabled ./...

Functions

This section is empty.

Types

type LinkingMode added in v1.19.1

type LinkingMode int

LinkingMode describes what linking mode was detected for the current binary.

const (
	// StaticLinking means the static linking.
	StaticLinking LinkingMode = iota
	// DynamicLinking means the dynamic linking.
	DynamicLinking
	// UnknownLinking means driver couldn't determine linking or it is not relevant (it is relevant on Linux only).
	UnknownLinking
)

func CheckDynamicLinking added in v1.19.1

func CheckDynamicLinking() (LinkingMode, error)

CheckDynamicLinking checks whether the current binary has a dynamic linker (PT_INTERP). A statically linked glibc binary will crash with SIGFPE if dlopen is called, so this check allows us to skip minicore loading gracefully. The result is cached so the ELF parsing only happens once.

func (*LinkingMode) String added in v1.19.1

func (lm *LinkingMode) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL