Skip to content

Files

Latest commit

9ed0aa1 · Mar 2, 2025

History

History

cc

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 5, 2024
Aug 24, 2024
Mar 2, 2025
Feb 17, 2025

Onramp Driver

This is the Onramp C compiler driver. It is a single stage written in Onramp Minimal C (omC).

The full command-line syntax is documented in the Usage Guide. This document describes the implementation and provides some notes on bootstrapping.

Phases of Translation

The cc tool can perform any or all of the following transformations. When performing multiple phases, temporary files are used to pass data along from one tool to the next.

Phase Tool Operation Command-line option
Preprocessing cpp .c -> .i -E
Compilation cci .i -> .os -S
Assembly as .os -> .oo -c
Linking ld .oo + .oa -> (exec.) none (default)

The output of linking is an Onramp bytecode executable, optionally wrapped for the user's platform, that can be run on the Onramp virtual machine.

Bootstrapping

By default, the compiler driver expects to use the final bootstrapped versions of the underlying tools and libc. During bootstrapping, these do not exist yet. The tools to use can be overridden using the following command-line options:

  • -with-cpp=<path/to/cpp.oe> -- Sets the path to the preprocessor
  • -with-cci=<path/to/cci.oe> -- Sets the path to the compiler
  • -with-as=<path/to/as.oe> -- Sets the path to the assembler
  • -with-ld=<path/to/ld.oe> -- Sets the path to the linker
  • -nostdlib -- Prevents automatically linking against the libc
  • -nostdinc -- Prevents automatically passing the libc headers to the preprocessor
  • -nostddef -- Prevents defining any default macros for the preprocessor

The bootstrapping scripts provide these options as needed to every invocation of the driver until the final tools are complete.

You can also use these options if you'd like to use an alternate tool for any of the phases of compilation. Note that they must be Onramp executables (not native executables) and they must be compatible with the command-line options that will be provided by the driver.