More Mac OS X mods (native still doesn't work, but we're closer).

This commit is contained in:
Clifford Matthews 2009-06-07 17:49:06 -06:00
parent cc36e6e260
commit c4c3d51467
3 changed files with 20 additions and 15 deletions

8
README
View File

@ -36,10 +36,10 @@ glibc-devel.i386 and libgcc.i386) then try this hack
make
make install
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.
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 with native code.
./autogen.sh
CLEANUP='' ./configure

View File

@ -416,12 +416,24 @@ create_asmdata (const template_t *t, int num_operands)
new_code = !new_code;
}
/*
* Use local labels so we get smaller branches even on Mac OS X. The
* following note comes from the Mac OS X Assembler reference:
*
* Note: The Mac OS X assembler for Intel i386 processors always
* produces branch instructions that are long (32 bits) for non-local
* labels. This allows the link editor to do procedure ordering (see
* the description of the -sectorder option in the ld(1) man page).
*/
fprintf (fp,
" asm volatile (\"\\n\"\n"
" \"%scode_start_%d:\\n\\t\"\n"
" \"%s\\n\"\n"
" \"Lcode_end_%d:\\n\"\n"
" \"%scode_end_%d:\");\n",
symbol_prefix, current, code[new_code], symbol_prefix, current);
symbol_prefix, current, code[new_code], current,
symbol_prefix, current);
/* Try the next combination of operands. */
for (op = num_operands - 1; op >= 0; op--)

View File

@ -4,13 +4,6 @@
/* $Id: template.c 61 2004-12-21 23:44:50Z ctm $ */
#if defined(HAVE_SYMBOL_UNDERSCORE)
# define SYMBOL_PREFIX "_"
#else
# define SYMBOL_PREFIX ""
#endif
const template_t template[] =
{
#define BINARY_OP(op, dstio, memout) \
@ -633,7 +626,7 @@ const template_t template[] =
{ { SIZE_32, REGISTER, INOUT } } },
{ "i386_call_abs", "", "", "", "volatile", "v",
"call " SYMBOL_PREFIX "%P0",
"call L%P0",
{ "addr" },
{ { BROKEN_SIZE_32, CONSTANT, IN } } },
@ -716,7 +709,7 @@ const template_t template[] =
#define CONDL_BRANCH(op, flags) \
{ "i386_" op, flags, "", "", "volatile", "v", \
op " " SYMBOL_PREFIX "%P0", \
op " L%P0", \
{ "target" }, \
{ { BROKEN_SIZE_32, CONSTANT, IN } } }
@ -736,7 +729,7 @@ const template_t template[] =
CONDL_BRANCH ("js", "s"),
{ "i386_jmp", "", "", "", "volatile", "v",
"jmp " SYMBOL_PREFIX "%P0",
"jmp L%P0",
{ "target" },
{ { BROKEN_SIZE_32, CONSTANT, IN } } },
{ "i386_jmp_reg", "", "", "", "volatile", "-",