About the Glib use.
You probably can take what you need and cross-compile it. So if you just need the thread package - just compile that and don't take everything.
I'm doing the same thing with the Python VM. PyMite fits on a microcontroller and doesn't use all the functionality.