Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
0a423b55
Commit
0a423b55
authored
24 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 2000-06-13 16:10:00 by simonmar]
forgot one file
parent
877aad48
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/driver/ghc-usage.txt
+66
-0
66 additions, 0 deletions
ghc/driver/ghc-usage.txt
with
66 additions
and
0 deletions
ghc/driver/ghc-usage.txt
0 → 100644
+
66
−
0
View file @
0a423b55
Use of the Glasgow Haskell Compiler driver:
$$ [command-line-options-and-input-files]
------------------------------------------------------------------------
This driver ($$) guides each input file through (some of the)
possible phases of a compilation:
- unlit: extract code from a "literate program"
- hscpp: run code through the C pre-processor (if -cpp flag given)
- hsc: run the Haskell compiler proper
- gcc: run the C compiler (if compiling via C)
- as: run the assembler
- ld: run the linker
For each input file, the phase to START with is determined by the
file's suffix:
- .lhs literate Haskell: unlit
- .hs illiterate Haskell: hsc
- .hc C from the Haskell compiler: gcc
- .c C not from the Haskell compiler: gcc
- .s assembly language: as
- other passed directly to the linker: ld
If no files are given on the command line, input is taken from
standard input, and processing is as for an .hs file. (All output is
to stdout or stderr, however).
The phase at which to STOP processing is determined by a command-line
option:
-E stop after generating preprocessed, de-litted Haskell
(used in conjunction with -cpp)
-C stop after generating C (.hc output)
-S stop after generating assembler (.s output)
-c stop after generating object files (.o output)
Other commonly-used options are:
-O An `optimising' package of compiler flags, for faster code
-prof Compile for cost-centre profiling
(add -auto for automagic cost-centres on top-level functions)
-fglasgow-exts Allow Glasgow extensions (unboxed types, etc.)
-H14m Increase compiler's heap size
-M Output the Makefile rules recording the
dependencies of a list of Haskell files.
(ghc driver script calls upon the help of a
compatible mkdependHS script to do the actual
processing)
The User's Guide has more information about GHC's *many* options.
Given the above, here are some TYPICAL invocations of $$:
# compile a Haskell module to a .o file, optimising:
% $$ -c -O Foo.hs
# link three .o files into an executable called "test":
% $$ -o test Foo.o Bar.o Baz.o
# compile a Haskell module to C (a .hc file), using a bigger heap:
% $$ -C -H16m Foo.hs
# compile Haskell-produced C (.hc) to assembly language:
% $$ -S Foo.hc
------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment