Closed Bug 984155 Opened 10 years ago Closed 10 years ago

Build Thunderbird with frozen linkage / external API - Windows fixes

Categories

(Thunderbird :: General, defect)

All
Windows 7
defect
Not set
normal

Tracking

(thunderbird31 fixed)

RESOLVED FIXED
Thunderbird 31.0
Tracking Status
thunderbird31 --- fixed

People

(Reporter: philip.chee, Assigned: philip.chee)

References

Details

Attachments

(1 file, 2 obsolete files)

Windows fixes only since I'm on Windows 7
This patch *almost* works but fails during linking. Obviously I'm doing something wrong, but what?

   Creating library fake.lib and object fake.exp
nsMailWinIntegration.obj : error LNK2019: unresolved external symbol "int __cdecl CaseInsensitiveCompare(wchar
_t const *,wchar_t const *,unsigned int)" (?CaseInsensitiveCompare@@YAHPB_W0I@Z) referenced in function "prote
cted: bool __thiscall nsWindowsShellService::TestForDefault(struct SETTING * const,int)" (?TestForDefault@nsWi
ndowsShellService@@IAE_NQAUSETTING@@H@Z)
mailcomps.dll : fatal error LNK1120: 1 unresolved externals
c:/t1/hg/comm-central/config/rules.mk:862: recipe for target 'mailcomps.dll' failed

I tried including nsMsgUtils.h but then I get a different error in the Windows 8 SDK kit.

nsMailWinIntegration.cpp
C:\Program Files (x86)\Windows Kits\8.0\Include\um\shobjidl.h(9332) : error C2059: syntax error : '('
C:\Program Files (x86)\Windows Kits\8.0\Include\um\shobjidl.h(9332) : error C2238: unexpected token(s) preceding ';'
c:/t1/hg/comm-central/config/rules.mk:960: recipe for target 'nsMailWinIntegration.obj' failed
mozmake[1]: *** [nsMailWinIntegration.obj] Error 2
mozmake[1]: Leaving directory 'c:/t1/hg/objdir-tb/mail/components/shell'
c:/t1/hg/comm-central/config/rules.mk:512: recipe for target 'all' failed
mozmake: *** [all] Error 2
mozmake: Leaving directory 'c:/t1/hg/objdir-tb/mail/components/shell'

ShObjIdl.h line 6332:

>         virtual HRESULT STDMETHODCALLTYPE Compare( 
>             /* [in] */ __RPC__in_opt IShellItem *psi,
>             /* [in] */ SICHINTF hint,
>             /* [out] */ __RPC__out int *piOrder) = 0;
This patch *almost* works but fails during linking. Obviously I'm doing something wrong, but what?

   Creating library fake.lib and object fake.exp
nsMailWinIntegration.obj : error LNK2019: unresolved external symbol "int __cdecl CaseInsensitiveCompare(wchar
_t const *,wchar_t const *,unsigned int)" (?CaseInsensitiveCompare@@YAHPB_W0I@Z) referenced in function "prote
cted: bool __thiscall nsWindowsShellService::TestForDefault(struct SETTING * const,int)" (?TestForDefault@nsWi
ndowsShellService@@IAE_NQAUSETTING@@H@Z)
mailcomps.dll : fatal error LNK1120: 1 unresolved externals
c:/t1/hg/comm-central/config/rules.mk:862: recipe for target 'mailcomps.dll' failed

I tried including nsMsgUtils.h but then I get a different error in the Windows 8 SDK kit.

nsMailWinIntegration.cpp
C:\Program Files (x86)\Windows Kits\8.0\Include\um\shobjidl.h(9332) : error C2059: syntax error : '('
C:\Program Files (x86)\Windows Kits\8.0\Include\um\shobjidl.h(9332) : error C2238: unexpected token(s) preceding ';'
c:/t1/hg/comm-central/config/rules.mk:960: recipe for target 'nsMailWinIntegration.obj' failed
mozmake[1]: *** [nsMailWinIntegration.obj] Error 2
mozmake[1]: Leaving directory 'c:/t1/hg/objdir-tb/mail/components/shell'
c:/t1/hg/comm-central/config/rules.mk:512: recipe for target 'all' failed
mozmake: *** [all] Error 2
mozmake: Leaving directory 'c:/t1/hg/objdir-tb/mail/components/shell'

ShObjIdl.h line 6332:

>         virtual HRESULT STDMETHODCALLTYPE Compare( 
>             /* [in] */ __RPC__in_opt IShellItem *psi,
>             /* [in] */ SICHINTF hint,
>             /* [out] */ __RPC__out int *piOrder) = 0;
Attachment #8391933 - Flags: feedback?(neil)
Sorry forgot STR:
1. Apply mkmelin patch from:
https://bugzilla.mozilla.org/show_bug.cgi?id=953102#attach_8384253
2. Apply patch from:
https://bugzilla.mozilla.org/show_bug.cgi?id=980356#attach_8388436
3. Apply patch in this bug.
4. Try to compile.
5. Get error: error LNK2019: unresolved external symbol "int __cdecl CaseInsensitiveCompare(...
Comment on attachment 8391933 [details] [diff] [review]
Patch v1.0 fixes for migration and shellservice

(In reply to Philip Chee from comment #1)
> This patch *almost* works but fails during linking. Obviously I'm doing
> something wrong, but what?
> 
>    Creating library fake.lib and object fake.exp
> nsMailWinIntegration.obj : error LNK2019: unresolved external symbol "int
> __cdecl CaseInsensitiveCompare(wchar
> _t const *,wchar_t const *,unsigned int)"
> (?CaseInsensitiveCompare@@YAHPB_W0I@Z) referenced in function "prote
> cted: bool __thiscall nsWindowsShellService::TestForDefault(struct SETTING *
> const,int)" (?TestForDefault@nsWi
> ndowsShellService@@IAE_NQAUSETTING@@H@Z)
> mailcomps.dll : fatal error LNK1120: 1 unresolved externals
> c:/t1/hg/comm-central/config/rules.mk:862: recipe for target 'mailcomps.dll'
> failed
> 
> I tried including nsMsgUtils.h but then I get a different error in the
> Windows 8 SDK kit.

It looks like you're already getting nsMsgUtils.h because TestForDefault normally uses nsCaseInsensitiveStringComparator() but your link error is against CaseInsensitiveCompare.

Now CaseInsensitiveCompare lives in unicharutils so you'll need to ensure that it gets linked in by the appropriate Makefile (c.f. suite/build/Makefile.in).
Attachment #8391933 - Flags: feedback?(neil)
Attached patch Patch v1.1 link in unicharutils (obsolete) — Splinter Review
> Now CaseInsensitiveCompare lives in unicharutils so you'll need to ensure that 
> it gets linked in by the appropriate Makefile (c.f. suite/build/Makefile.in).
This works. Thanks!

The Makefile.in change needs to be applied on top of patch from Bug 953102.
You probably need the patch from Bug 980356 as well.
Attachment #8391933 - Attachment is obsolete: true
Attachment #8392112 - Flags: review?(standard8)
Attachment #8392112 - Flags: review?(standard8) → review+
I broke internal api builds in the previous patch. I've tested this attached patch on both internal and external api builds.

I tried including msgUtils.h but that pulled in a lot of baggage that caused other build failures which I don't understand. I finally ended up with:

> +#ifndef MOZILLA_INTERNAL_API
> +/**
> + * The external API expects CaseInsensitiveCompare. Redefine
> + * nsCaseInsensitiveStringComparator() so that Equals works.
> + */
> +#define nsCaseInsensitiveStringComparator() CaseInsensitiveCompare
> +#endif

This is rather hacky so what's a better fix?
Attachment #8392112 - Attachment is obsolete: true
Attachment #8394339 - Flags: review?(neil)
Comment on attachment 8394339 [details] [diff] [review]
Patch v1.2 redefine nsCaseInsensitiveStringComparator for external api. r=Standard8

The changes look reasonable to me but I don't have review powers in mail/ so I can only give you an f+.
Attachment #8394339 - Flags: review?(neil) → feedback+
Comment on attachment 8394339 [details] [diff] [review]
Patch v1.2 redefine nsCaseInsensitiveStringComparator for external api. r=Standard8

[Approval Request Comment]
Approval Request for CLOSED TREE on comm-central
Attachment #8394339 - Flags: approval-comm-aurora?
Attachment #8394339 - Flags: approval-comm-aurora?
Pushed to comm-central
http://hg.mozilla.org/comm-central/rev/9f14b4a8e7e7
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 31.0
Attachment #8394339 - Attachment description: Patch v1.2 redefine nsCaseInsensitiveStringComparator for external api → Patch v1.2 redefine nsCaseInsensitiveStringComparator for external api. r=Standard8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: