On Thu, 2026-10-08 at 18:51 -0500, Segher Boessenkool wrote: > On Thu, Oct 08, 2026 at 09:36:35PM +0200, Basile STARYNKEVITCH wrote: > > Hello > > > > Is anyone developing a translator from a subset of C (those in > > simple > > header files) to the C calls of libgccjit starting them? > > What does "in simple header files mean"? Stuff that is valid C (and > with the same meaning!) when concatenated with pretty much any other > code? >
So assume you have some (user space) open source library $LIBX on Linux. It could be libgccjit itself, but it could be some other one like GTK3 (on https://www.gtk.org/ ...) or FLTK toolkit (https://www.fltk.org/ ...) or Jemmalloc (https://jemalloc.net/ ...); the source code of $LIBX is on your Linux computer. Assume also that you did compile that library with the same GCC that provides libgccjit and that you also did compile that GCC compiler from it source code. Assume also that you do use $LIBX in some open source software (developed by you and colleagues) $SOFT loading plugins (in particular those generated by gcc_jit_context_compile_to_file or obtained from gcc_jit_compile and gcc_jit_context_new_global. then it is certainly possible (in principle) to: 1. compile $LIBX from its source code, and do so with both -g -O GCC compiler options (and many other ones required by $LIBX) 2. write some GCC plugin (see https://arxiv.org/abs/1109.0779 ...) which fills some database or files $DATA describing each and every documented function or variable or type of $LIBX (with description of returned type and of every argument and its type). So at step 1 above some Linux files (or databases) describing $LIBX are created in $DATA 3. have (or develop) some open source software library which reads the $DATA and use libgccjit to construct an in-memory representation of it as an abstract set of [sub-instances] of gcc_jit_object pointers. 4. code in $SOFT something generating code with libgccjit, in particular code fitted to some concrete data (and using partial evaluation techniques). My question is then simply to find some open source code which helps in doing steps 1, 2, 3 or 4 or some non empty combination of them. Maybe someone know about an open source code which loads GCC precompiled headers (some *gch file) and constructs in memory the abstract set of gcc_jit_object-s related to it. I am working on refpersys.org and it is the context (an open source inference engine project) I am asking the question. Sorry for my bad English, I am French. Thanks for reading -- Basile STARYNKEVITCH <[email protected]> 8 rue de la Faïencerie http://starynkevitch.net/Basile/ 92340 Bourg-la-Reine https://github.com/bstarynk France https://github.com/RefPerSys/RefPerSys https://orcid.org/0000-0003-0908-5250
