Closed JoeDupuis closed 10 years ago
I take a look at this issue, i think the internal tool execution if different when using O4 vs O0, so it's not handled in both parts
Some information about how the compiler works: https://github.com/adobe-flash/crossbridge/blob/futures/overview_of_compiler_stages.md (Its for futures clang version but its helpful for gcc/master too)
I've checked and the following example produces the debug .as sources (you can check it in the makefile):
# Assembling BitCode Output (BC)
cd $(BUILD)/test_hello_c && $(SDK_CC) -c -g -O0 $(SRCROOT)/test/hello.c -emit-llvm -o hello.bc
# Assembling ABC Output (OBJ)
cd $(BUILD)/test_hello_c && $(SDK)/usr/bin/llc -jvm="$(JAVA)" hello.bc -o hello.abc -filetype=obj
# Assembling AS3 Output (ASM)
cd $(BUILD)/test_hello_c && $(SDK)/usr/bin/llc -jvm="$(JAVA)" hello.bc -o hello.as -filetype=asm
# Assembling SWF Output
cd $(BUILD)/test_hello_c && $(SDK_CC) -save-temps -emit-swf -swf-size=320x240 -O0 -g hello.abc -o hello.swf
By reading the blog I saw that there is a -S flag for gcc that allow the output of assembly code (in this case, the AS3 file I needed).
I am not sure if we should modify --save-temps to output assembly (AS3) on -o0, or just let it be and close the issue, since we can get the information needed anyway.
I'm closing this. I'll try to put some examples together using save-temps.
--save-temps successfully output the as3 code on -O4, but doesn't seem to do so on -O0. There is a --emit-as3 flag too, but it seems to be the counter part to --emit-llvm. It does not seem to output any as3. I can see as3 file being generated in /tmp. If I kill the compilation process mid way I can access those, else they get deleted.
I think the --save-temps should output the action script code that was use to generate the final action script bytecode since it is very valuable when debugging.