Vexu / arocc

A C compiler written in Zig.
http://aro.vexu.eu/
MIT License
1.11k stars 57 forks source link

Compilation: Add driver/frontend support for pic/pie options #768

Closed ehaas closed 3 weeks ago

ehaas commented 3 weeks ago

Some time (real soon now™) I'd like to start writing a simple AST -> x86_64 assembly backend. No IR or optimizations or anything, just something that generates readable/debuggable assembly.

Is that something that you think should be part of aro? Or a separate project that uses aro as a dependency? If it's part of aro I'd want to put it behind a -fsimple-asm or similar type of flag.

ehaas commented 3 weeks ago

-S for assembly output makes sense; I was just thinking it would be nice if the toolchain could assemble and link the output; but I didn't want it to interfere with the existing Ir codepath. Maybe something like -O0 for it? So -O0 without -S would generate assembly to a temp file, invoke as, and then add the output to the link objects?

Vexu commented 3 weeks ago

Right, didn't think of that, using -O0 sounds good.