class Savi::Compiler::Binary

Overview

The purpose of the Binary pass is to produce a binary executable of the program, using LLVM and clang tooling and writing the result to disk.

This pass does not mutate the Program topology. This pass does not mutate the AST. This pass does not raise any compilation errors. This pass keeps temporary state (on the stack) at the program level. This pass produces no output state (aside from the side effect below). !! This pass has the side-effect of writing files to disk.

Defined in:

savi/compiler/binary.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.path_for(ctx) #

[View source]
def self.run(ctx) #

[View source]

Instance Method Detail

def dynamic_linker_for_linux_or_bsd(target) : String #

Get the path to the dynamic linker library for a Linux or FreeBSD target.


[View source]
def each_explicit_lib_path(ctx, &) #

[View source]
def each_sysroot_lib_glob(ctx, target, &) #

Yield each sysroot-based glob used to find paths that exist.


[View source]
def each_sysroot_lib_path(ctx, target, &) #

Yield each sysroot-based path in which to search for linkable libs/objs.


[View source]
def find_in_paths(paths, file_name) : String #

Given a prioritized list of search paths and a file name, find the file. Raises an error if the file couldn't be found in any of the paths


[View source]
def invoke_linker(flavor, link_args) #

[View source]
def link_for_linux_or_bsd(ctx, target, obj_path, bin_path) #

Link an ELF executable for a Linux or FreeBSD target.


[View source]
def link_for_macosx(ctx, target, obj_path, bin_path) #

Link a MachO executable for a MacOSX target.


[View source]
def link_for_windows(ctx, target, obj_path, bin_path) #

Link a EXE executable for a Windows target.


[View source]
def maybe_find_in_paths(paths, file_name) : String | Nil #

[View source]
def run(ctx) #

[View source]