xptcall port for Symbian

RESOLVED WONTFIX

Status

()

Core
XPCOM
RESOLVED WONTFIX
9 years ago
7 years ago

People

(Reporter: m_kato, Assigned: m_kato)

Tracking

Trunk
All
Symbian
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

9 years ago
Enable xptcall code for Symbain.

- Symbian emulator is x86 arch (work as Windows application).  This uses CodeWarrior for x86.
- Symbian ARM uses GCC or ARM RVCT.  But current code is for gcc only.
(Assignee)

Comment 1

9 years ago
Created attachment 386944 [details] [diff] [review]
patch v1 for winscw
(Assignee)

Comment 2

9 years ago
Comment on attachment 386944 [details] [diff] [review]
patch v1 for winscw

This is WINSCW (Symbian emulator) only
Attachment #386944 - Flags: review?(benjamin)

Comment 3

9 years ago
Was this code copied from an existing file? If so, why do we need a new copy of the file, instead of just building the existing copy? Does the x86 ABI for symbian differ from both the GCC and MSVC ABI?
(Assignee)

Comment 4

9 years ago
(In reply to comment #3)
> Was this code copied from an existing file? If so, why do we need a new copy of
> the file, instead of just building the existing copy? Does the x86 ABI for
> symbian differ from both the GCC and MSVC ABI?

This is copy and modified.  if I can add "#ifdef __SYMBIAN32__" to Linux ARM code and Windows code, I modify it.

Symbian emulator is same as Windows ABI.  Sybmian ARM is same of ARM EABI. (same as *nix).

Updated

9 years ago
Attachment #386944 - Flags: review?(benjamin)

Comment 5

9 years ago
Comment on attachment 386944 [details] [diff] [review]
patch v1 for winscw

I'd prefer that, yes. Re-request review on this patch if it's impractical.
(Assignee)

Comment 6

9 years ago
Created attachment 388011 [details] [diff] [review]
patch v2
Attachment #386944 - Attachment is obsolete: true
(Assignee)

Updated

9 years ago
Attachment #388011 - Flags: review?(benjamin)

Updated

9 years ago
Attachment #388011 - Flags: review?(benjamin) → review-

Comment 7

9 years ago
Comment on attachment 388011 [details] [diff] [review]
patch v2

I'm not convinced we really want a md/symbian directory. Could we just put the logic in md/unix?

>diff --git a/xpcom/reflect/xptcall/src/md/symbian/Makefile.in b/xpcom/reflect/xptcall/src/md/symbian/Makefile.in

>+ifeq ($(OS_TARGET),WINSCW)
>+CPPSRCS		= ../win32/xptcinvoke.cpp ../win32/xptcstubs.cpp
>+else
>+CPPSRCS		= ../unix/xptcinvoke_arm.cpp ../unix/xptcstubs_arm.cpp
>+endif

relative paths in CPPSRCS will confuse the dependency system. Instead do:

ifeq ($(OS_TARGET),WINSCW))
vpath %.cpp $(srcdir)/../win32
CPPSRCS += xptcinvoke.cpp xptcstubs.cpp
else
vpath %.cpp $(srcdir)/../unix
CPPSRCS += xptcinvoke_arm.cpp xptcstubs_arm.cpp
endif

>diff --git a/xpcom/reflect/xptcall/src/md/win32/xptcstubs.cpp b/xpcom/reflect/xptcall/src/md/win32/xptcstubs.cpp

> // these macros get expanded (many times) in the file #included below
>+#ifdef __SYMBIAN32__
>+#define STUB_ENTRY(n) \
>+nsresult nsXPTCStubBase::Stub##n() \
>+{ __asm mov ecx, n __asm jmp SharedStub }
>+#else
> #define STUB_ENTRY(n) \
> __declspec(naked) nsresult __stdcall nsXPTCStubBase::Stub##n() \
> { __asm mov ecx, n __asm jmp SharedStub }
>-
>+#endif /* __SYMBIAN32__ */
> #else

This duplication seems weird. Does your compiler really not support __declspec(naked)? If so, create a NAKED macro which expands to __declspec(naked) for win32 and nothing for symbian. Use NS_STDCALL for __stdcall expansion.

>+#ifdef __SYMBIAN32__
>+#define SENTINEL_ENTRY(n) \
>+nsresult nsXPTCStubBase::Sentinel##n() \
>+{ \
>+    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
>+    return NS_ERROR_NOT_IMPLEMENTED; \
>+}
>+#else
> #define SENTINEL_ENTRY(n) \
> nsresult __stdcall nsXPTCStubBase::Sentinel##n() \
> { \
>     NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
>     return NS_ERROR_NOT_IMPLEMENTED; \
> }
>+#endif /* __SYMBIAN32__ */

Use NS_STDCALL instead of a two-part block here as well.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.