nachos

package module
v0.0.0-...-1719607 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: LGPL-2.1 Imports: 7 Imported by: 0

README

nachos: a library to FAT-en Mach-O binaries

nachos is a library that provides a Mach-O FAT binary creation API.

The library creates a universal, or FAT, binary for a set of given Mach-O binaries, compiled for a number of platforms - currently ppc, x86_64 (or amd64), and arm64.

example

// Read Mach-O headers from files to be nachoed into a universal binary.
files := []fs.File{arm, amd}
exes := []nachos.Executable{}
for i := range files {
    exe, err := nachos.NewFileExe(files[i])
    if err != nil {
        panic(err)
    }
    exes = append(exes, exe)
}

// Build a universal binary from the individual binaries.
res, err := nachos.NewUniversalBinary(exes...)
if err != nil { /* TODO */ }

// Write to an output file, the universal binary file itself.
io.Copy(out, res)

Documentation

Overview

nachos provides helpers to create a universal Mach-O binary from a set of architecture specific constituent binaries (eg: for `x86_64` & `aarch64`).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileExe

func NewFileExe(f fs.File) (*fileExe, error)

NewFileExe reads a provided executable file to be built into a universal binary (from os.OpenFile or some io/fs file).

func NewUniversalBinary

func NewUniversalBinary(executables ...Executable) (io.ReadCloser, error)

NewUniversalBinary composes a set of executables into a single binary.

Types

type Executable

type Executable interface {
	// contains filtered or unexported methods
}

Executable provides data for making ooey gooey universal binaries.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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