diff --git a/README b/README index 301ea72..fce3ec2 100644 --- a/README +++ b/README @@ -36,9 +36,15 @@ glibc-devel.i386 and libgcc.i386) then try this hack make make install -Syn68k currently doesn't build under Mac OS X (tested under 10.5.7) -do to our unconditional use of "-z execstack" when linking as well as -the fact that i486-cleanup.pl essentially consumes all of syn68k.s. +To compile syn68k on Mac OS X (tested under 10.5.7), you currently have to +override the cleanup script, since the stock script (i486-cleanup.pl) will +consume all of syn68k.s. However, even if you do this, the resultant binary +will not work. + + ./autogen.sh + CLEANUP='' ./configure + make + make install To test syn68k, run test/syngentest and compare the output to test/output/10000. It should be the same. If you want to be @@ -48,7 +54,8 @@ results to other files, as described in test/output/README. Performance nit: The code in runtime/i486-cleanup.pl no longer gets rid of all the -cruft in the trailer. It's quite possible that the code in +cruft in the trailer (except under Mac OS X, where it gets rid of way +too much code). It's quite possible that the code in runtime/i486-optimize.pl doesn't do the right thing either. My email address is still , although ARDI itself is diff --git a/TODO b/TODO index eb4b97c..07543fe 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ Mac OS X fixes: - Don't link with -z execstack if that's going to fail - figure out why i486-cleanup.pl basically eats all of syn68k.s diff --git a/runtime/Makefile.am b/runtime/Makefile.am index 73c3980..74b2676 100644 --- a/runtime/Makefile.am +++ b/runtime/Makefile.am @@ -25,7 +25,7 @@ OBJS = block.o diagnostics.o hash.o rangetree.o translate.o alloc.o \ blockinfo.o trap.o destroyblock.o callback.o init.o interrupt.o \ profile.o dosinterrupts.o deathqueue.o checksum.o native.o \ backpatch.o recompile.o \ - mapindex.o mapinfo.o syn68k.o + mapindex.o mapinfo.o syn68k.o opcode_dummy.o mapinfo.o: $(host_native)/host-xlate.h diff --git a/runtime/opcode_dummy.c b/runtime/opcode_dummy.c new file mode 100644 index 0000000..bd1fd28 --- /dev/null +++ b/runtime/opcode_dummy.c @@ -0,0 +1,16 @@ +#include + +/* + * s68k_handle_opcode_dummy is used to detect portions of assembly in + * syn68k.s that are unreachable and should be removed via + * i486-cleanup.pl. The call to s68k_handle_opcode_dummy should never + * be made. It won't be reachable even if i486-cleanup.pl isn't run, + * but it will be assembled and linked in, so that's why we actually + * supply s68k_handle_opcode_dummy but expect it to never be called. + */ + +void s68k_handle_opcode_dummy (void) +{ + fprintf (stderr, "This function should never be called\n"); + abort (); +} diff --git a/runtime/syn68k_header.c b/runtime/syn68k_header.c index 2e6f527..85d830b 100644 --- a/runtime/syn68k_header.c +++ b/runtime/syn68k_header.c @@ -217,7 +217,7 @@ extern void s68k_handle_opcode_dummy (void); asm volatile ("movl %3,%0\n\t" \ "addl %4,%1\n\t" \ "jmp *%0\n" \ - "_S68K_DONE_WITH_THIS:" \ + "/* _S68K_DONE_WITH_THIS: */" \ : "=r" (next_code), "=r" (code) : "1" (code), \ "g" (*(void **)(code + (words_to_inc) - PTR_WORDS)), \ "g" (words_to_inc * sizeof (uint16))); \