Builds (but doesn't run) on Mac OS X

This commit is contained in:
Clifford Matthews 2009-06-06 14:23:16 -06:00
parent 9939d92e91
commit cc36e6e260
5 changed files with 29 additions and 8 deletions

15
README
View File

@ -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 <ctm@ardi.com>, although ARDI itself is

2
TODO
View File

@ -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

View File

@ -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

16
runtime/opcode_dummy.c Normal file
View File

@ -0,0 +1,16 @@
#include <stdio.h>
/*
* 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 ();
}

View File

@ -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))); \