Skip to content

Commit

Permalink
Add "-c" arg in README.md and tools/StaticMain.cpp when expecting llv…
Browse files Browse the repository at this point in the history
…m bitcode output

If there isn't "-c" argument, clang will generate an error "clang-12: error: -emit-llvm cannot be used when linking".
  • Loading branch information
FantasqueX authored and banach-space committed Aug 21, 2021
1 parent 068eb4f commit e7b8f3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export LLVM_DIR=<installation/dir/of/llvm/12>
# Textual form
$LLVM_DIR/bin/clang -O1 -emit-llvm input.c -S -o out.ll
# Binary/bit-code form
$LLVM_DIR/bin/clang -O1 -emit-llvm input.c -o out.bc
$LLVM_DIR/bin/clang -O1 -emit-llvm input.c -c -o out.bc
```
It doesn't matter whether you choose the binary, `*.bc` (default), or textual
(`.ll`, requires the `-S` flag) form, but obviously the latter is more
Expand Down
2 changes: 1 addition & 1 deletion tools/StaticMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
// USAGE:
// # First, generate an LLVM file:
// clang -emit-llvm <input-file> -o <output-llvm-file>
// clang -emit-llvm <input-file> -c -o <output-llvm-file>
// # Now you can run this tool as follows:
// <BUILD/DIR>/bin/static <output-llvm-file>
//
Expand Down

0 comments on commit e7b8f3e

Please sign in to comment.