You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.5 KiB
1.5 KiB
Compile Commands
My preferred compile commands to quickly look up
Programming languages
- C -
gcc -std=gnu99 -Werror -Wfatal-errors -Wall -Wpedantic blub.c -o blub
- if necessary, remove
-Wpedantic
, since it warns for features definitely included by usinggnu99
as compiler gcc -c -std=gnu99 -Werror -Wfatal-errors -Wall -Wpedantic blub.c -o blub
the-c
to get object file only instead of binary
- if necessary, remove
- C++ -
g++ -pedantic -Wall -Wextra -Werror -c blob.cpp blub.cpp
-> object filesg++ -Wall -o blub blob.o blub.o
-> binariesblob.cpp
gets linked (blub.cpp would likely start with something like#include "blob.h"
)
- Assembly - (this is called assembling instead of compiling)
gcc -c blub.s
- on systems that aren't ARM:
aarch64-linux-gnu-gcc -c blub_asm.s
aarch64-linux-gnu-gcc -c blub_c.c
aarch64-linux-gnu-g++-10 -c blub.cpp
- linking:
aarch64-linux-gnu-g++-10 -o blub blob.o blub_asm.o blub_c.o
- running:
qemu-aarch64 ./blub
- assembling and disassembling single commands:
echo "adds x0, x0, #5" | llvm-mc -triple=aarch64 --show-encoding
echo "0x00 0x14 0x00 0xb1" | llvm-mc -triple=aarch64 -disassemble --show-encoding
- on systems that aren't ARM:
- System Verilog -
iverilog -Wall -g2012 1.sv 2.sv 3_tb.sv 3.sv -o 3_tb
<- tb for testbench simulation
cmake
- warnings not included on default!
Other languages
- LaTeX -
lualatex blub.tex