Does libgccjit.so end up getting linked with -static-libstdc++ -static-libgcc? If so, that could be problematic (are static libstdc++ and libgcc necessarily built as PIC so it's even possible to embed them into a shared library?). It's certainly not clear that the -static-libstdc++ -static-libgcc default for building the compiler executables is the right one for building libgccjit.so.
The dump file handling appears to have no I/O error checking (no checking for error on fopen, nothing obvious to prevent fwrite to a NULL m_file if fopen did have an error, no checking for error on fclose (or fwrite)). -- Joseph S. Myers jos...@codesourcery.com