jahkeup / nachos

Nachos makes universal Mach-Os available elsewhere

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)

About

Nachos makes universal Mach-Os available elsewhere

License:GNU Lesser General Public License v2.1


Languages

Language:Go 93.3%Language:Makefile 5.8%Language:Shell 0.9%