News for hackers. Stuff that matters.
Re:c4x86 - JIT compiler for x86 in 86 lines by userbinator on Sunday December 14, 2014 @12:55AM (#8747572)
Allowing it to call arbitrary functions using dlopen()/dlsym() would be the idea I have for fixing the first problem - it'd also increase its power substantially since it can then make use of any other library's functions instead of the currently hardcoded list. Supporting function pointers would be a bit harder and involve changing the parser/code generator.
Re:c4x86 - JIT compiler for x86 in 86 lines by hyc_symas on Sunday December 14, 2014 @02:50PM (#8749321)
How would you tell it which shared library to dlopen?

Was looking into changing the order of arguments to go the right way 'round. Also changing address refs to be PC-relative, to avoid the relocation phase. Seems pretty straightforward.

Re:c4x86 - JIT compiler for x86 in 86 lines by dmytrish on Sunday December 14, 2014 @03:57PM (#8749536)
I thought about `dlopen`, but did not know how to fetch it libc platform-independently (`dlopen(argv[0])` is fine on OS X, but not on Linux).

Now I see that the first argument can be NULL, that approach is feasible.