Skip to content

Add goto-cc man page #6945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/man/goto-cc.1

This file was deleted.

119 changes: 119 additions & 0 deletions doc/man/goto-cc.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
.TH GOTO-CC "1" "June 2022" "goto-cc-5.59.0" "User Commands"
.SH NAME
goto\-cc \- C/C++ to goto compiler
.SH SYNOPSIS
.B goto-cc [options]

.B goto-gcc [options]

.B goto-ld [options]

.B goto-as [options]

.B goto-bcc [options]

.B goto-armcc [options]

.B goto-cw [options]

.SH DESCRIPTION
.B goto\-cc
reads source code, and generates a goto-binary. Its
command-line interface is designed to mimic that of
.BR gcc (1).
Note in particular that \fBgoto-cc\fR distinguishes between compiling
and linking phases, just as \fBgcc\fR(1) does. \fBcbmc\fR(1) expects a goto-binary
for which linking has been completed.
.PP
The basename of the file that is used to invoke \fBgoto-cc\fR controls which
behavior will be emulated. This is typically accomplished by using symbolic
links.
.IP
\fBgoto-cc\fR: invokes the default system compiler as preprocessor and just
builds a goto-binary.
.IP
\fBgoto-gcc\fR: invokes \fBgcc\fR(1) as preprocessor and builds an \fBelf\fR(5)
object file including an additional \fIgoto-cc\fR section that holds the goto
binary.
.IP
\fBgoto-ld\fR: only performs linking, and also builds an \fBelf\fR(5) object as
above.
.IP
\fBgoto-as\fR: invokes the system assembler \fBas\fR(1) and includes the
original assembly source as a string in the output file.
.IP
\fBgoto-bcc\fR: invokes \fBbcc\fR(1) as preprocessor.
.IP
\fBgoto-armcc\fR: invokes \fBarmcc\fR as preprocessor and enables support for
the ARM's C dialect and command-line options.
.IP
\fBgoto-cw\fR: invokes \fBmwcceppc\fR as preprocessor and enables support for
CodeWarrior's C dialect and command-line options.
.SH OPTIONS
.B goto\-cc
understands the options of \fBgcc\fR(1) plus the following.
.TP
\fB\-\-verbosity\fR \fIN\fR
Set verbosity level to \fIN\fR, which defaults to 1 (only errors are printed). A
verbosity of 0 disables all output. Using a verbosity of 2 or greater, or using
\fB\-Wall\fR enables warnings. Verbosity levels 4, 6, 8, 9, or 10 add increasing
amounts of debug information.
.TP
\fB\-\-function\fR \fIname\fR
Set entry point to \fIname\fR.
.TP
\fB\-\-native\-compiler\fR \fIcmd\fR
Invoke \fIcmd\fR as preprocessor or compiler.
.TP
\fB\-\-native\-linker\fR \fIcmd\fR
Invoke \fIcmd\fR as linker.
.TP
\fB\-\-native\-assembler\fR \fIcmd\fR
Invoke \fIcmd\fR as assembler (\fBgoto\-as\fR only).
.TP
\fB\-\-export\-file\-local\-symbols\fR
Name-mangle and export file-local (aka \fBstatic\fR) functions. Name mangling
prefixes each symbol name by \fB__CPROVER_file_local\fR and the basename of the
file. For example,

.EX
.in +4n
\fB// foo.c\fP
\fBstatic\fP int \fBbar\fP();
.in
.EE

yields a globally visible \fI__CPROVER_file_local_foo_c_bar\fR function.
Note that this approach mangles all functions contained in a translation unit.
We recommend using \fBcrangler\fR(1) as a more configurable alternative.
.TP
\fB\-\-mangle\-suffix \fIsuffix\fR
Append \fIsuffix\fR to exported file-local symbols. Use this option together
with \fB\-\-export\-file\-local\-symbols\fR when multiple files of the same base
name contain a \fBstatic\fR function of the same name. If so, use a unique
suffix in at least one of the \fBgoto\-cc\fR invocations used in compiling those
files.
.TP
\fB\-\-print\-rejected\-preprocessed\-source\fR \fIfile\fR
Copy failing (preprocessed) source to \fIfile\fR.
.TP
\fB\-\-object\-bits\fR \fIN\fR
Configure the number of bits used for object numbering in CBMC's pointer encoding.
.SH ENVIRONMENT
All tools honor the TMPDIR environment variable when generating temporary
files and directories.
.B goto\-cc
aims to accept all environment variables that \fBgcc\fR(1) does.
.SH BUGS
If you encounter a problem please create an issue at
.B https://github.com/diffblue/cbmc/issues
.SH SEE ALSO
.BR as (1),
.BR bcc (1),
.BR cbmc (1),
.BR crangler (1),
.BR elf (5),
.BR gcc (1),
.BR ld (1)
.SH COPYRIGHT
2006\-2018, Daniel Kroening, Michael Tautschnig, Christoph Wintersteiger
2 changes: 1 addition & 1 deletion doc/man/goto-gcc.1
2 changes: 1 addition & 1 deletion doc/man/goto-ld.1
3 changes: 3 additions & 0 deletions src/goto-cc/goto_cc_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ void goto_cc_modet::help()
" --native-compiler cmd command to invoke as preprocessor/compiler\n"
" --native-linker cmd command to invoke as linker\n"
" --native-assembler cmd command to invoke as assembler (goto-as only)\n"
" --export-file-local-symbols\n"
" name-mangle and export file-local symbols\n"
" --mangle-suffix suffix append suffix to exported file-local symbols\n"
" --print-rejected-preprocessed-source file\n"
" copy failing (preprocessed) source to file\n"
" --object-bits number of bits used for object addresses\n"
Expand Down