r=dbradley
OS/2 GCC changes
This commit is contained in:
mkaply%us.ibm.com 2003-03-26 04:18:02 +00:00
Родитель 6f09fe803a
Коммит 4f6c56114b
4 изменённых файлов: 51 добавлений и 32 удалений

Просмотреть файл

@ -29,16 +29,23 @@ include $(DEPTH)/config/autoconf.mk
MODULE = xpcom
LIBRARY_NAME = xptcmd
ifeq ($(MOZ_OS2_TOOLS),EMX)
CPPSRCS = xptcinvoke_emx.cpp
endif
CPPSRCS += xptcstubs_os2.cpp
ifeq ($(MOZ_OS2_TOOLS),VACPP)
ifdef GNU_CXX
CPPSRCS = \
../unix/xptcinvoke_gcc_x86_unix.cpp \
../unix/xptcstubs_gcc_x86_unix.cpp \
$(NULL)
LOCAL_INCLUDES = -I$(srcdir)/../unix
DEFINES += -DMOZ_NEED_LEADING_UNDERSCORE
else
CPPSRCS = xptcstubs_os2.cpp
ASFILES = xptcinvoke_vacpp.asm xptcstubs_vacpp.asm
endif
# Force use of PIC
FORCE_USE_PIC = 1
include $(topsrcdir)/config/config.mk
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1

Просмотреть файл

@ -136,6 +136,9 @@
#elif defined(_WIN32)
#define THUNK_BASED_THIS_ADJUST
#elif defined(__EMX__)
#define THUNK_BASED_THIS_ADJUST
#else
#error "need a platform define if using unixish x86 code"
#endif

Просмотреть файл

@ -113,7 +113,11 @@ xptc_invoke_copy_to_stack_keeper (void)
__asm__ (
".text\n\t"
#ifdef __EMX__
".align 8\n\t"
#else
".align 16\n\t"
#endif
".globl " SYMBOL_UNDERSCORE "XPTC_InvokeByIndex\n\t"
".type " SYMBOL_UNDERSCORE "XPTC_InvokeByIndex,@function\n"
SYMBOL_UNDERSCORE "XPTC_InvokeByIndex:\n\t"

Просмотреть файл

@ -129,53 +129,53 @@ xptc_PrepareAndDispatch_keeper (void)
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
// gcc3 mangling tends to insert the length of the method name
#define STUB_ENTRY(n) \
asm(".section \".text\"\n\t" \
asm(".text\n\t" \
".align 2\n\t" \
".if " #n " < 10\n\t" \
".globl _ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
".type _ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \
"_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \
".globl " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
".type " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \
SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \
".elseif " #n " < 100\n\t" \
".globl _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
".type _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n" \
"_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \
".globl " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
".type " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n" \
SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \
".elseif " #n " < 1000\n\t" \
".globl _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
".type _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n" \
"_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \
".globl " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
".type " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n" \
SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \
".else\n\t" \
".err \"stub number " #n " >= 1000 not yet supported\"\n\t" \
".endif\n\t" \
"movl $" #n ", %eax\n\t" \
"jmp SharedStub\n\t" \
"jmp " SYMBOL_UNDERSCORE "SharedStub\n\t" \
".if " #n " < 10\n\t" \
".size _ZN14nsXPTCStubBase5Stub" #n "Ev,.-_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
".size " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev,.-" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
".elseif " #n " < 100\n\t" \
".size _ZN14nsXPTCStubBase6Stub" #n "Ev,.-_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
".size " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase6Stub" #n "Ev,.-" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
".else\n\t" \
".size _ZN14nsXPTCStubBase7Stub" #n "Ev,.-_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
".size " SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase7Stub" #n "Ev,.-" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
".endif");
#else
#define STUB_ENTRY(n) \
asm(".section \".text\"\n\t" \
asm(".text\n\t" \
".align 2\n\t" \
".globl Stub" #n "__14nsXPTCStubBase\n\t" \
".type Stub" #n "__14nsXPTCStubBase,@function\n" \
"Stub" #n "__14nsXPTCStubBase:\n\t" \
".globl " SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase\n\t" \
".type " SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase,@function\n" \
SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase:\n\t" \
"movl $" #n ", %eax\n\t" \
"jmp SharedStub\n\t" \
".size Stub" #n "__14nsXPTCStubBase,.-Stub" #n "__14nsXPTCStubBase");
"jmp " SYMBOL_UNDERSCORE "SharedStub\n\t" \
".size " SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase,.-" SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase");
#endif
// static nsresult SharedStub(PRUint32 methodIndex) __attribute__((regparm(1)))
asm(".section \".text\"\n\t"
asm(".text\n\t"
".align 2\n\t"
".type SharedStub,@function\n\t"
"SharedStub:\n\t"
".type " SYMBOL_UNDERSCORE "SharedStub,@function\n\t"
SYMBOL_UNDERSCORE "SharedStub:\n\t"
"leal 0x08(%esp), %ecx\n\t"
"movl 0x04(%esp), %edx\n\t"
"jmp PrepareAndDispatch\n\t"
".size SharedStub,.-SharedStub");
"jmp " SYMBOL_UNDERSCORE "PrepareAndDispatch\n\t"
".size " SYMBOL_UNDERSCORE "SharedStub,.-" SYMBOL_UNDERSCORE "SharedStub");
#define SENTINEL_ENTRY(n) \
nsresult nsXPTCStubBase::Sentinel##n() \
@ -186,6 +186,11 @@ nsresult nsXPTCStubBase::Sentinel##n() \
#include "xptcstubsdef.inc"
void
xptc_dummy()
{
}
#else
#error "can't find a compiler to use"
#endif /* __GNUC__ */