compilation - Produce both assembly and object file with gcc/clang: Possible? How? -
is possible produce both object file , source file in once command gcc/g++/clang/clang++ ? how?
i need pass lot of other options, avoid duplicating them in 2 separate commands:
gcc -s test.cc # produce assembly gcc -c test.cc # produce object file
you can give -save-temps option gcc: leave temporary files (including .s files) in current directory (works clang):
gcc -c --save-temps test.cc or use -wa,-aln=test.s option:
gcc -c -wa,-aln=test.s test.c from gcc documentation:
-wa,optionpass
optionoption assembler. if option contains commas, split multiple options @ commas.
from as documentation:
-a[cdghlmns]turn on listings, in of variety of ways:
-alinclude assembly-anomit forms processing[...]
you may combine these options; example, use
-alnassembly listing without forms processing.
clang has integrated assembler should switched off (how switch off llvm's integrated assembler?):
clang++ -c -no-integrated-as -wa,-aln=test.s test.c
Comments
Post a Comment