Compiling version 9.1 for i386-nextstep.3x

Aleksey Sudakov zander at ns1.relevantknowledge.com
Mon Jun 30 19:15:28 PDT 1997


Hi,

I tried to compile recent release on OpenStep 4.2 (Intel) and hit the wall  
at trampolines.c (What is it anyway?)

First of all mach assembler doesn't understand .global derective. It use  
.globl like solaris, that's why config/i386/nextstep3/jit-md.h needs

/* Define how we declare an assembly function */
#define	START_ASM_FUNC() ".text\n\t.align 4\n\t.globl "

Next, in order to follow ANSI-C one should add \n\ to the assembler code.  
That's why i386/trampolines.c should read

/*
 * i386/trampolines.c
 * i386 trampolines codes for various occasions.
 *
 * Copyright (c) 1996,97 T. J. Wilkinson & Associates, London, UK.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * Written by Richard Henderson <rth at tamu.edu>.
 * Modified by Tim Wilkinson <tim at tjwassoc.co.uk>
 */
#include "jit-md.h"

#if defined(TRAMPOLINE_FUNCTION)
/*
 * If we have an explit function defined then use that.
 */
TRAMPOLINE_FUNCTION()

#else
/*
 * Otherwise we'll try to construct one.
 */
#if !defined(START_ASM_FUNC)
#define	START_ASM_FUNC() ".text\n\t.align 4\n\t.global "
#endif
#if !defined(END_ASM_FUNC)
#define	END_ASM_FUNC() ""
#endif
#if defined(HAVE_UNDERSCORED_C_NAMES)
#define	C_FUNC_NAME(FUNC) "_" #FUNC
#else
#define	C_FUNC_NAME(FUNC) #FUNC
#endif

#if defined(NO_SHARED_LIBRARIES)

asm("                                 				\n\
	START_ASM_FUNC() C_FUNC_NAME(i386_do_fixup_trampoline)	\n\
C_FUNC_NAME(i386_do_fixup_trampoline) ":			\n\
	call	" C_FUNC_NAME(fixupTrampoline) "		\n\
	popl	%ecx						\n\
	jmp	*%eax						"\
);

#else /* NO_SHARED_LIBRARIES */

asm("                                 				\n\
	START_ASM_FUNC() C_FUNC_NAME(i386_do_fixup_trampoline) 	\n\
C_FUNC_NAME(i386_do_fixup_trampoline):				\n\
        call	C_FUNC_NAME(fixupTrampoline)			\n\
	call	i386_dft1 					\n\
i386_dft1:							\n\
	popl	%ebx						\n\
	addl	$_GLOBAL_OFFSET_TABLE_+[.-i386_dft1], %ebx	\n\
	call	fixupTrampoline @PLT				\n\
	popl	%ecx						\n\
	jmp	*%eax						"\
);

#endif /* NO_SHARED_LIBRARIES */

#endif

And finally, I didn't manage to get thru

	addl	$_GLOBAL_OFFSET_TABLE_+[.-i386_dft1], %ebx	\n\
	call	fixupTrampoline @PLT				\n\

for OpenStep assembler have hard time understanding '[' and '@' character  
(may be because of special use of '[' and '@' in Objective-C. So do I. I've  
got the following

moscow> as trampoline.asm
trampoline.asm:5:invalid character '[' in first operand
trampoline.asm:6:invalid character '@' in first operand

Is there anybody who went a little bit further and could possibly share results?

Regards,
Aleksey



More information about the kaffe mailing list