kefir-cc1 - Man Page

C17 language compiler

Synopsis

kefir-cc1[options] [file]

Description

kefir-cc1 is a C17 language compiler (without a driver). If no input file is provided, stdin is used.

Options

--pp-timestamp timestamp

Override preprocessor timestamp

--json-errors

Print errors in JSON format to stderr

--tabular-errors

Print errors in tabular format to stderr

--target-profile profile

Generate code for specified target (see Target subsection)

--source-id identifier

Force use provided source file identifier

--quote-include-dir dir

Add directory to include search path exclusively for quoted includes

--system-include-dir dir

Add directory to include search path and mark it as a system include path (used for dependency output)

--debug-info

Include debug information into produced output

--dump-dependencies

Output a make rule describing the dependencies of source file.

--system-dependencies

Include dependencies from system include directories into the make rule (used with --dump-dependencies flag) [default: on].

--no-system-dependencies

Do not include dependencies from system include directories into the make rule (used with --dump-dependencies flag).

--add-phony-targets

Generate phony make targets for each dependency (used with --dump-dependencies flag) [default: off].

--no-add-phony-targets

Do not generate phony make targets for each dependency (used with --dump-dependencies

--dependency-target target

Override default make rule target (used with --dump-dependencies flag).

--dependency-output filename

Output make rule into specified file (used with --dump-dependencies flag).

--unsigned-char

Let the type char be unsigned. By default, it is target-specific.

--signed-char

Let the type char be signed. By default, it is target-specific.

--feature-[name]

Enable compiler feature (see Features subsection)

--no-feature-[name]

Disable compiler feature (see Features subsection)

--internal-[flag]

Enable compiler internal flag (see INTERNALS subsection)

--no-internal-[flag]

Disable compiler internal flag (see INTERNALS subsection)

--codegen-[option]

Enable option for code generator (see Codegen subsection)

--no-codegen-[option]

Disable option for code generator (see Codegen subsection)

--optimizer-pipeline spec

Optimizer pipeline specification (see Optimizer subsection)

--precise-bitfield-load-store

Load and store bitfields at byte boundaries [default: on]. Provides extra correctness for structures allocated close to a boundary with unmapped memory pages at the expense of less efficient bitfield handling. Does not change bitfield layout.

--no-precise-bitfield-load-store

Load and store bitfields at machine word boundaries [default: off]. May cause failures for structures allocated close to boundaries with unmapped memory pages. Does not change bitfield layout.

--declare-atomic-support

Declare support of atomics (requires explicit linking of software atomic library such as libatomic or libcompiler_rt). Default for Glibc and BSD targets.

--no-declare-atomic-support

Declare the absence of atomic support via defining __STDC_NO_ATOMICS__ macro. Default for musl target.

Features

Supported features (to be used with --feature-[feature-name] and --no-feature-[feature-name] flags) -- disabled by default:

fail-on-attributes

Fail if __attribute__((...)) is encountered

missing-function-return-type

Permit function definitions with missing return type

designated-init-colons

Permit "fieldname:" syntax in designated initializers

labels-as-values

Permit label-addressing with && operator

non-strict-qualifiers

Disable strict qualifier checks for pointers

signed-enums

Force all enums to have signed integral type

implicit-function-decl

Permit implicit funciton declarations at use-site

empty-structs

Permit empty structure/union definitions

ext-pointer-arithmetics

Permit pointer arithmetics with function and void pointers

missing-braces-subobj

Permit missing braces for subobject initialization with scalar

statement-expressions

Enable statement expressions

omitted-conditional-operand

Permit omission of the middle ternary expression operand

int-to-pointer

Permit any integral type conversion to pointer

permissive-pointer-conv

Permit conversions between any pointer types

named-macro-vararg

Permit named macro variable arguments

include-next

Permit include_next preprocessor directive

fail-on-assembly

Disable support of inline assembly

va-args-comma-concat

Enable special processing for ", ##__VA_ARGS" case in preprocessor

switch-case-ranges

Enable support for ranges in switch cases

designator-subscript-ranges

Enable support for ranges in designator subscripts

Codegen

Supported code geneator options (to be used with --codegen-[option] and --no-codegen-[option] flags):

emulated-tls

Use emulated TLS [disabled by default, enabled on openbsd platforms]

pic

Generate position-independent code

omit-frame-pointer

Omit frame pointer in leaf function that do not need it

no-omit-frame-pointer

Always use frame pointer in all functions

syntax=SYNTAX

Produce assembly output with specified syntax [x86_64-intel_noprefix, x86_64-intel_prefix, x86_64-att (default)]

details=DETAILS-SPEC

Augment assembly output with internal code generator details in comments. DETAILS-SPEC can be: vasm (virtual assembly), vasm+regs (virtual assembly and register allocations), devasm (devirtualized assembly).

pipeline=PIPELINE-SPEC

Code generator transformation pipeline specification (not supported for native-* targets) consists of comma separated names of pipeline passes:

noop

No-operation pass

amd64-drop-virtual

Non-functional virtual instruction elimination for amd64 targets

amd64-peephole

Peephole optimizations for amd64 targets

Optimizer

Optimizer pipeline specification consists of comma separated names of optimization pipeline passes:

noop

No-operation pass

phi-pull

Substitue phi nodes of SSA representation that unambiguously point to constant values

mem2reg

Pull function local variables into registers

op-simplify

General code simplification

constant-fold

Folding constant expressions

branch-removal

Eliminating branches with constant conditions

Target

Supported compilation targets:

amd64-sysv-gas

Produce optimized GNU As-compatible assembly adhering System-V AMD64 ABI [default]

Exit Status

Normally kefir-cc1 exits with 0 exit code. In case of any errors in any of compilation stages, all further compilation is aborted and non-zero exit code retruned.

Standards

kefir-cc1 implements C17 language standard as specified in its final draft.

Notes

The kefir-cc1 compiler is licensed under the terms of GNU GPLv3 license.

kefir-cc1 is developed and maintained by Jevgenijs Protopopovs

Please report bugs found in kefir-cc1 to jevgenij@protopopov.lv

kefir-cc1 is available online at https://sr.ht/~jprotopopov/kefir/ with read-only mirrors at https://git.protopopov.lv/kefir and https://codeberg.org/jprotopopov/kefir

Info

January 2025