Skip to content

Commit

Permalink
Document the -cc compile-time option
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewFluet committed Mar 15, 2024
1 parent 5041fb4 commit f048bcc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/guide/src/CompileTimeOptions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ The default varies depending on architecture.
Pass _option_ to `cc` when compiling assembler code. If you wish to
pass an option to the assembler, you must use `cc`’s `-Wa,` syntax.

* ``-cc __cc__``
+
Specify the executable for the C compiler. The C compiler is also invoked to
compile assembly (`.s` files) to object code (`.o` files) and to link object
code into an executable.

* ``-cc-opt __option__``
+
Pass _option_ to `cc` when compiling C code.
Expand Down
6 changes: 6 additions & 0 deletions man/mlton.1
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Pass \fIoption\fP to \fBgcc\fP when compiling assembler code. If you
wish to pass an option to the assembler, you must use \fBgcc\fP's
\fB\-Wa,\fP syntax.

.TP
\fB\-cc \fIcc\fP\fR
Specify the executable for the C compiler. The C compiler is also invoked to
compile assembly (\fB.s\fP files) to object code (\fB.o\fP files) and to link
object code into an executable.

.TP
\fB\-cc\-opt \fIoption\fP\fR
Pass \fIoption\fP to \fBgcc\fP when compiling C code.
Expand Down
2 changes: 1 addition & 1 deletion mlton/main/main.fun
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ fun makeOptions {usage} =
(Expert, "bounce-rssa-usage-cutoff", "<n>",
"Maximum variable use count to consider",
Int (fn i => bounceRssaUsageCutoff := (if i < 0 then NONE else SOME i))),
(Expert, "cc", " <cc>", "set C compiler",
(Normal, "cc", " <cc>", "executable for C compiler",
SpaceString
(fn s => cc := String.tokens (s, Char.isSpace))),
(Normal, "cc-opt", " <opt>", "pass option to C compiler",
Expand Down

0 comments on commit f048bcc

Please sign in to comment.