Closed Bug 482558 Opened 15 years ago Closed 15 years ago

unable to build with tests for windows mobile as posix is not available for wince

Categories

(Core :: General, defect)

ARM
Windows CE
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: jmaher, Assigned: hiro)

References

Details

Attachments

(1 file, 1 obsolete file)

if you build without "ac_add_options --disable-tests", we run into this error at build time:
c:/mozilla/src/extensions/universalchardet/tests/UniversalChardetTest.cpp(102) :
 error C3861: 'read': identifier not found

we need to fix the test itself to make it follow ansi standards instead of posix standards.  

There will be other tests that fall into this problem and we will find them as we search or run into further build errors.
Are you going to use this as a tracking bug? If so, you should file a new bug on each particular test in the component the test is testing. If not, please move this bug to the appropriate component!
I have verified that this builds correctly if we change the read to a fread:
http://mxr.mozilla.org/mozilla-central/source/extensions/universalchardet/tests/UniversalChardetTest.cpp#102

sz = read(0, buf, bs);

changes to: 
sz = fread(buf, bs, bs, 0);


This might not be the fix needed and it might not run correctly, but the build works.
OK, my simple approach might have resolved the compile issue, but not the real issue.  We need to actually redo the test to take an argument in as a filename, then use fopen/fread/fclose on it.  Running on wince does not have a stdin, so we cannot just open a handle to that.

moving to core:general as the last time the file was changed, it was in bug 426271
Product: Fennec → Core
QA Contact: general → general
Blocks: 483654
Attached patch A patch (obsolete) — Splinter Review
Use fread instead of read and remove unused PRBool value.

I confirmed the patch works fine on Linux and can be compiled for WinCE.
But unfortunately for WinCE, there is another issue while linking like the following:

/c/cygwin/home/user/hg/mozilla-central/objdir-wm6-dbg/xulrunner/dist/sdk/bin/arm
-wince-link -nologo  -entry:main -out:UniversalChardetTest.exe UniversalChardetT
est.obj  -MANIFESTUAC:NO  -DEBUG -DEBUGTYPE:CV         ../src/base/universalchar
det_s.lib /c/cygwin/home/user/hg/mozilla-central/objdir-wm6-dbg/xulrunner/dist/l
ib/nspr4.lib /c/cygwin/home/user/hg/mozilla-central/objdir-wm6-dbg/xulrunner/dis
t/lib/plc4.lib /c/cygwin/home/user/hg/mozilla-central/objdir-wm6-dbg/xulrunner/d
ist/lib/plds4.lib
universalchardet_s.lib(nsEscSM.obj) : warning LNK4210: .CRT section exists; ther
e may be unhandled static initializers or terminators
universalchardet_s.lib(LangHebrewModel.obj) : warning LNK4210: .CRT section exis
ts; there may be unhandled static initializers or terminators
universalchardet_s.lib(LangBulgarianModel.obj) : warning LNK4210: .CRT section e
xists; there may be unhandled static initializers or terminators
universalchardet_s.lib(LangGreekModel.obj) : warning LNK4210: .CRT section exist
s; there may be unhandled static initializers or terminators
universalchardet_s.lib(LangCyrillicModel.obj) : warning LNK4210: .CRT section ex
ists; there may be unhandled static initializers or terminators
universalchardet_s.lib(nsMBCSSM.obj) : warning LNK4210: .CRT section exists; the
re may be unhandled static initializers or terminators
Moreover, I don't know who this UniversalChardetTest.exe uses.
I tested a build with this patch and the patch works good for building.
(In reply to comment #4)

> I confirmed the patch works fine on Linux and can be compiled for WinCE.
> But unfortunately for WinCE, there is another issue while linking like the
> following:
> 
> /c/cygwin/home/user/hg/mozilla-central/objdir-wm6-dbg/xulrunner/dist/sdk/bin/arm
> -wince-link -nologo  -entry:main -out:UniversalChardetTest.exe
> UniversalChardetT
> est.obj  -MANIFESTUAC:NO  -DEBUG -DEBUGTYPE:CV        
> ../src/base/universalchar
> det_s.lib
> /c/cygwin/home/user/hg/mozilla-central/objdir-wm6-dbg/xulrunner/dist/l
> ib/nspr4.lib
> /c/cygwin/home/user/hg/mozilla-central/objdir-wm6-dbg/xulrunner/dis
> t/lib/plc4.lib
> /c/cygwin/home/user/hg/mozilla-central/objdir-wm6-dbg/xulrunner/d
> ist/lib/plds4.lib
> universalchardet_s.lib(nsEscSM.obj) : warning LNK4210: .CRT section exists;
> ther
> e may be unhandled static initializers or terminators
> universalchardet_s.lib(LangHebrewModel.obj) : warning LNK4210: .CRT section
> exis
> ts; there may be unhandled static initializers or terminators
> universalchardet_s.lib(LangBulgarianModel.obj) : warning LNK4210: .CRT section
> e
> xists; there may be unhandled static initializers or terminators
> universalchardet_s.lib(LangGreekModel.obj) : warning LNK4210: .CRT section
> exist
> s; there may be unhandled static initializers or terminators
> universalchardet_s.lib(LangCyrillicModel.obj) : warning LNK4210: .CRT section
> ex
> ists; there may be unhandled static initializers or terminators
> universalchardet_s.lib(nsMBCSSM.obj) : warning LNK4210: .CRT section exists;
> the
> re may be unhandled static initializers or terminators

Attachment 376365 [details] [diff] in bug 491994 resolves this issue.
Assignee: nobody → ikezoe
Status: NEW → ASSIGNED
Attachment #372766 - Flags: review?(smontagu)
It's a shame nobody cc-ed me sooner... You can just remove this source file, we don't need it now that we have a bunch of mochitests in the same directory.
Thank you, Simon!!
Attachment #372766 - Attachment is obsolete: true
Attachment #376612 - Flags: review?(smontagu)
Attachment #372766 - Flags: review?(smontagu)
Attachment #376612 - Flags: review?(smontagu) → review+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/b225f46f1638
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
verified with 1.9.2 build and winmo alpha3
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: