Interfacing with external code using libgccjit
Anselm Schüler
mail@anselmschueler.com
Thu Jun 15 19:59:01 GMT 2023
Hi, I’m very new to libgccjit and was hoping to use it to implement a
DSL that abstracts over some high-precision mathematics.
However, to do that, I need to interface with a high-precision library
such as GMP or MPFR.
I’m wondering if that’s possible. Can I use
gcc_jit_context_new_function with GCC_JIT_FUNCTION_IMPORTED to define
such functions from e.g. MPFR? If so, is the function retrieved from
the binary itself or does it need to be installed on the target
machine? Do I need to pass -lmpfr to libgccjit or does it suffice to
use it during the compilation of the host program?
Additionally, it seems to be necessary to redefine all the types
defined by the library in order to be able to pass and receive them. Is
there some facility for automating this? It seems rather laborious.
More information about the Jit
mailing list