FlasCC sample 01 no output when add -O4 flag

399 Views Asked by At

I have only add -O4 -flto-api=exports.txt to Makefile script in Flascc SDK 1.0 sample 01_helloworld project

this is final Makefile content:

    "$(FLASCC)/usr/bin/gcc" $(BASE_CFLAGS) hello.c -O4 -flto-api=exports.txt -emit-swf -swf-size=200x200 -o hello.swf

exports.txt was copy from 09_Pthreads, here is the content:

# built in symbols that must always be preserved
_start1
malloc
free
memcpy
memmove
flascc_uiTickProc
_sync_synchronize

# symbols for C++ exception handling
_Unwind_SjLj_Register
_Unwind_SjLj_Resume
_Unwind_SjLj_Unregister
_Unwind_SjLj_RaiseException

when building complete, I opened it with flash debug APP 11.5, but nothing on it.

Where is my HelloWorld

Is there anything I can do to figure out the reason? Thanks for any suggestions.

2

There are 2 best solutions below

2
On

As paleozogt mentioned if you have a reference error for a symbol ater using an exports file it means your exports file isn't protecting enough symbols. Adding "_vglttyioctl" to your exports.txt file should do the trick.

Symbols are usually protected by default if LLVM can see code using the symbol. The exception is when the only reference comes from AS3 code which it can't see. In this case the default console implementation expects to be able to call the vglttyicotl function but it has been striped because it is not mentioned in the exports file or in the rest of the bitcode.

0
On

Use this - or only add in your export.txt: __muldi3 and vglttyioctl

_start1 malloc free memcpy memmove flascc_uiTickProc vglttyioctl __muldi3