Closed Bug 361542 Opened 18 years ago Closed 18 years ago

[BeOS] Linking fails in toolkit/components

Categories

(Toolkit Graveyard :: Security, defect)

x86
BeOS
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: doug, Assigned: dveditz)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.9a1) Gecko/20061106 Minefield/3.0a1
Build Identifier: Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.9a1) Gecko/20061106 Minefield/3.0a1

Sometime between 2006-11-11 and 2006-11-22, linking broke in toolkit/components.  Text of failure is
c++  -frtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-multichar -Wno-long-long -pedantic -pipe  -DNDEBUG -DTRIMMED -O2 -nostart -Wl,-h,libtoolkitcomps.so -o libtoolkitcomps.so  nsToolkitCompsModule.o       -Wl,--whole-archive ../startup/src/libappstartup_s.a  ../downloads/src/libdownload_s.a ../../../dist/lib/liburlclassifier_s.a ../../../dist/lib/libfeed_s.a ../typeaheadfind/src/libfastfind_s.a -Wl,--no-whole-archive -L../../../dist/bin -L../../../dist/lib -lgkgfx ../../../dist/lib/libunicharutil_s.a -L../../../dist/bin -lxpcom -lxpcom_core -L../../../dist/bin -L../../../dist/lib -lplds4 -lplc4 -lnspr4 -lbind -lsocket -L../../../dist/bin -lmozjs   -lsocket  -lbe -lbind -lzeta   
../../../dist/lib/liburlclassifier_s.a(nsUrlClassifierDBService.o)(.nsUrlClassifierDBService::gnu.linkonce.t.GetIID(void)+0x12): Infunction `nsUrlClassifierDBService::GetIID(void)':
: undefined reference to `nsUrlClassifierDBService::COMTypeInfo<int>::kIID'
collect2: ld returned 1 exit status
 

Reproducible: Always
Component: General → Widget
Product: Firefox → Core
Version: unspecified → Trunk
Component: Widget → Phishing Protection
Product: Core → Firefox
Not sure if this is the right classification but seems to be related to this function.
Looks like this might be a regression caused by bug 356355.
Depends on: 356355
Can't be bug 356355, that change only has to do with javascript.  Might be caused by bug 343033, but that seems unlikely because nsUrlClassifierDBService hasn't changed much in a long time.
No longer depends on: 356355
(In reply to comment #3)
> Can't be bug 356355, that change only has to do with javascript.  Might be
> caused by bug 343033, but that seems unlikely because nsUrlClassifierDBService
> hasn't changed much in a long time.
> 
Agreed - sorry for the false alarm.
This is a regression from bug 310309 and may not be fixable because of BeOS's use of very old (2.95.3) gcc.  Leaving this bug open as a possible place to put BeOS workarounds for this regression.
What's the appropriate component?
changing to "core/xpcom" since that's where the cause of this issue lies.
Component: Phishing Protection → XPCOM
Product: Firefox → Core
QA Contact: general → xpcom
(In reply to comment #6)
> What's the appropriate component?
> 
To my untrained eye, it looks like the cause is here http://lxr.mozilla.org/seamonkey/source/xpcom/glue/nsISupportsImpl.h#430.  I'm hoping we can find a way to simply use older versions of this code in BeOS builds without having to completely branch away from all trunk development.  

Are there any other ports stuck with gcc2.X? In that case it's not just a BeOS-bug.
probably not... I don't think any other OSes use C++ for their system API.
I've come to suspect that all that is needed to fix this is a 

NS_DEFINE_STATIC_IID_ACCESSOR(nsUrlClassifierDBService, NS_URLCLASSIFIERDBSERVICE_CID)

in nsUrlClassifierDBService.h

Maybe newer gcc's are to smart when people miss to define static variables correctly?

Hopefully the build I'm doing now will succeed.
Attached patch Suggested fixSplinter Review
this patch fixes the build by defining space for the static var. Dunno why newer gcc's get past it.
Changing back to toolkit component, as no need to change anything in xpcom (and it ain't broken).
Assignee: nobody → jag
Component: XPCOM → XP Toolkit/Widgets
QA Contact: xpcom → xptoolkit.widgets
Comment on attachment 249748 [details] [diff] [review]
Suggested fix

r?

Defining IID for nsUrlClassifierDBService seems to be the only stopping point for gcc2.95.3 as talked about in bug 313309. As I understand it, it is a bug in the code and not a problem with gcc2.95, although newer compilers seem to forgive this.

Need help commiting on review..
Attachment #249748 - Flags: review?(benjamin)
Confirming, tqh's fix allows the trunk to build here and fixes the bug as reported.
Assignee: jag → dveditz
Component: XP Toolkit/Widgets → Security
Flags: review?(benjamin)
Product: Core → Toolkit
QA Contact: xptoolkit.widgets → toolkit
Attachment #249748 - Flags: first-review?(benjamin)
Attachment #249748 - Flags: first-review?(benjamin) → first-review+
Flags: blocking1.9?
Comment on attachment 249748 [details] [diff] [review]
Suggested fix

Requesting 2nd review - not sure if it's necessary but trying to be safe.
Attachment #249748 - Flags: second-review?(dveditz)
Comment on attachment 249748 [details] [diff] [review]
Suggested fix

second review requested.  not sure if necessary but want to be safe since this is outside BeOS-only code.
Attachment #249748 - Flags: second-review?(dveditz) → second-review?(gavin.sharp)
Comment on attachment 249748 [details] [diff] [review]
Suggested fix

Second review isn't needed, go ahead and land this.
Attachment #249748 - Flags: second-review?(gavin.sharp)
Checking in mozilla/toolkit/components/url-classifier/src/nsUrlClassifierDBService.h;
/cvsroot/mozilla/toolkit/components/url-classifier/src/nsUrlClassifierDBService.h,v  <--  nsUrlClassifierDBService.h
new revision: 1.3; previous revision: 1.2
done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: blocking1.9? → in-testsuite?
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: