Closed Bug 443234 Opened 16 years ago Closed 12 years ago

New xptcall API refactoring for IRIX

Categories

(Core :: XPCOM, defect)

SGI
IRIX
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jimis, Unassigned)

References

Details

Attachments

(3 files, 3 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061712 Fedora/3.0-1.fc9 Firefox/3.0
Build Identifier: firefox 3.0 rc1 

Here is my try to fix the most important obstacle for running firefox3 on SGI Irix. The attached patch makes xptcall compilation correct, and fixes some runtime issues with unresolved symbols. Please keep in mind that even with this patch firefox3 doesn't run succesfully on Irix. There are many other problems but I submit this patch so that you help me surpass the most difficult one. 

I am pretty sure it needs many corrections, and the way I did some things can certainly be improved. For example the fix in xptcstubs_asm_irix.s for the new GCC C++ ABI was done by including a completely new file, xptcstubsdef2.inc, because I don't have a clue of Irix assembler and couldn't fix it otherwise. 

Moreover I probably need some mentoring with the xptcall ABI changes, even though my patch compiles correctly I doubt it fixes everything that bug 349002 needs. I just created it by more or less mixing the patches for the other platforms in that bug. 

Reproducible: Always
Attached patch first patch (obsolete) — Splinter Review
Component: General → XPCOM
Product: Firefox → Core
QA Contact: general → xpcom
Depends on: 349002, 360796
OS: Other → IRIX
Hardware: Other → SGI
Attachment #327838 - Flags: review?(benjamin)
I finally managed to build a debug build for firefox, but unfortunately it fails with the following message. What does this message exactly means? Could it be because of my patch? Unfortunately my debuggers are all failing to get a backtrace, so I can't provide more information yet. I'm looking into it. 

WARNING: XPConnect was passed aJSContext from a foreign JSRuntime!: file /tmp/firefox-3.0rc1/mozilla/js/src/xpconnect/src/nsXPConnect.cpp, line 328
pure virtual method called


I would appreciate any comments on my patch. Is there something obvious missing?

You should know that I get crashes when trying the TestXPTCInvoke program. I don't know if this program is supposed to work, but it certainly doesn't work on me. Gdb is unable to get a proper backtrace, it loses the stack frame once the XPTCall invoke is done. The only thing I can do is set a breakpoint right before the invoke, and step one processor instruction at a time... Anyway I need some help on this, but first of all I need someone to review my patch. 


$ ./run-mozilla.sh ../../xpcom/reflect/xptcall/tests/TestXPTCInvoke
WARNING: XPCOM objects created/destroyed from static ctor/dtor: 'gActivityTLS != BAD_TLS_INDEX && NS_PTR_TO_INT32(PR_GetThreadPrivate(gActivityTLS)) == 0', file /tmp/firefox-3.0rc1/mozilla/xpcom/base/nsTraceRefcntImpl.cpp, line 910
calling direct:
        1 + 1 = 2
        1L + 1L = 2
        2 * 2 = 4
        2L * 2L = 4
        1 + 2 = 3.000000f
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.000000f
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 +1 15 + 16 + 17 + 18 + 19 + 20 = 210.000000f
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55
        1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = 66.000000
        moo cow = milk
calling via invoke:
moz_run_program[36]: 19066 Bus error(coredump)
Attachment #328449 - Attachment mime type: application/octet-stream → text/plain
I figured out that the xptcall test program doesn't work well in my case, because I use gcc > 3.2, so I'm using the new C++ ABI. These assembly files were written with gcc 2.9x in mind, and with the SGI compiler. 

By experimentation I managed to improve my patch, so please see the attached file. This time it involves only the xtpcinvoke_asm_irix.s file. See also the attached testrun results. I would appreciate any help on the C++ ABI. 

timeless: Do you run that program from a debug build? If so, don't you get any assertion warnings like I do?
Attached patch xptcinvoke_asm_irix.s.patch (obsolete) — Splinter Review
Attached file testrun results (obsolete) —
Comment on attachment 328450 [details] [diff] [review]
xptcinvoke_asm_irix.s.patch

I would unconditionally update to gcc 3.x... gcc 2.x is an unsupported compiler and won't build mozilla any more.
Comment on attachment 327838 [details] [diff] [review]
first patch

Once you have a working patch, feel free to request review. Since you're one of the few people compiling on IRIX, you get to be the maintainer, and I'll pretty much rubber-stamp whatever patch you come up with.
Attachment #327838 - Flags: review?(benjamin)
With the following patch the TestXPTCInvoke test program works. However as you can see from the testrun output that I'll attach, I get a lot of times the following warning:

WARNING: XPCOM objects created/destroyed from static ctor/dtor: 'gActivityTLS != BAD_TLS_INDEX && NS_PTR_TO_INT32(PR_GetThreadPrivate(gActivityTLS)) == 0', file /tmp/firefox-3.0rc1/mozilla/xpcom/base/nsTraceRefcntImpl.cpp, line 910

It's up to you to decide whether it's important or not, I don't even know what it means or whether it's found on other platforms too.

I should also note that the browser still doesn't run, but that's probably because of other issues.
Attached patch second trySplinter Review
Attachment #327838 - Attachment is obsolete: true
Attachment #328450 - Attachment is obsolete: true
Attached file new testrun results
Attachment #328451 - Attachment is obsolete: true
I can confirm that this patch works under MIPSPro 7.4.4m and IRIX 6.5.30 when compiling either Seamonkey 2.0, Firefox 3.0.x or Firefox 3.5.x
IRIX build support got removed with bug 680792
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: