clang

package
v0.0.0-...-992ed75 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package clang implements a simple wrapper for invoking clang to compile C to eBPF

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(source []byte, name string, opts Opts) ([]byte, error)

Compile compiles a C source string into an ELF

Types

type Opts

type Opts struct {
	// clang binary to use
	Clang string

	// Header directories to include
	Include []string

	// Destination directory for compiled programs.
	// Uses a temporary directory if empty.
	Output string

	// Emit DWARF debug info in the XDP elf.
	// Required for BTF.
	EmitDebug bool
}

CompileOpts configure how an XDP program is compiled / built

Jump to

Keyboard shortcuts

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