Split TCC ELF-Loader from the actual compiler

Issue #1549 resolved
Giovanni Nanomad Condello created an issue


TCC has two components:

  • The ELF loader, needed by ML MODULES subsystem

  • The TCC compiler itself. It's used to compile .c files directly on the camera. Handy for user-contributed scripts.


Make the TCC compiler optional, load it as a module when you need to compile new scripts.


ML autoexec.bin size is reduced, thus allowing modules to work on more cameras (such as 1100D/60D)

Comments (7)

  1. Alex

    ""May I freely modify files in tcc directory, or should I make as less changes as possible? I'm thinking about putting all needed functions into one file to eliminate chances of having not used functions in binary."

    You can hack it as you wish. Maybe you can copy the existing implementation to modules folder (to be used as a scripting engine), and then strip down the old one to the minimum necessary for loading modules.

    I've tried to do that with dcraw (wanted to port it to the camera in order to read CR2's and show raw histograms), and I've found it helpful to print a call list, so I knew what functions were called in a particular situations (here, reading CR2's without any processing). This can be done with gcc instrumentation, see the end of this file: https://bitbucket.org/hudson/magic-lantern/src/tip/src/tcc-glue.c

  2. Log in to comment