On Tue, Dec 3, 2019 at 11:02 AM Ulrich Schmidt <u.sch...@gmx.de> wrote: > > Thank you, Sean. I'l take a look. > > Your Idea of making tcc_relocate_ex() global is probably worth thinking > about. > > I wrote my own binding and ran into trouble like you did and i > understood not enouth about tcc internals. (TCC doc is not the best > source of information.) Hence i looked into the sources and figured out: > > If more than one app uses libtcc, the compilation processes interfere > with each other causing compilation faults. If you use libtcc only once > at a time, all is fine. > > From my point of view a lua module needs to usable multiple times parallel. > > Ulrich. >
For parallel it could be possible to optionally change global as _Thread_local variable, this will make tcc unable to compile itself if the option is enable, as it didn't support _Thread_local, but could be easier than making tcc reentrant, I don't know which approach is better but maybe it's worth thinking about this option too. about reentrantcy, I'm not a maintainer either, I'm not against this change, as it's a big change maybe it's possible to make this in an incremental way by first making small patchs that will move the global to TCCState. Also I like the idea of a freeze in order to release a 0.28 soon Matthias, > Am 03.12.2019 um 10:09 schrieb Sean Conner: > > It was thus said that the Great Ulrich Schmidt once stated: > >> Hi all. > >> > >> i try to write a lua binding for tcc. To work out propperly, the tcc lib > >> needs to be reentrant. > > I never had a problem with TCC not being reentrant when I made my Lua > > bindings for it (way back in 2012 [1]). But then again, I never really used > > this module for production work. If you are intersted: > > > > The C code wrapper: > > > > https://github.com/spc476/lua-conmanorg/blob/master/src/tcc.c > > > > The Lua module which uses the above module to load C-based Lua > > modules via source code: > > > > https://github.com/spc476/lua-conmanorg/blob/master/lua/cc.lua > > > > -spc (Hope it helps some ... ) > > > > [1] Here's the thread where I first bring it up: > > > > > > https://lists.nongnu.org/archive/html/tinycc-devel/2012-08/msg00001.html > > > > > > _______________________________________________ > > Tinycc-devel mailing list > > Tinycc-devel@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > _______________________________________________ > Tinycc-devel mailing list > Tinycc-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel