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

VERIFIED FIXED

Status

()

Core
General
VERIFIED FIXED
9 years ago
8 years ago

People

(Reporter: jmaher, Assigned: hiro)

Tracking

Trunk
ARM
Windows CE
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

9 years ago
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!
(Reporter)

Comment 2

9 years ago
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.
(Reporter)

Comment 3

9 years ago
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
Component: General → General
Product: Fennec → Core
QA Contact: general → general
(Reporter)

Updated

9 years ago
Blocks: 483654
(Assignee)

Comment 4

9 years ago
Created attachment 372766 [details] [diff] [review]
A patch

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
(Assignee)

Comment 5

9 years ago
Moreover, I don't know who this UniversalChardetTest.exe uses.
(Reporter)

Comment 6

9 years ago
I tested a build with this patch and the patch works good for building.
(Assignee)

Comment 7

9 years ago
(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)

Updated

9 years ago
Assignee: nobody → ikezoe
Status: NEW → ASSIGNED
(Assignee)

Updated

9 years ago
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.
(Assignee)

Comment 9

9 years ago
Created attachment 376612 [details] [diff] [review]
Remove UniversalChardetTest.cpp

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+
(Assignee)

Updated

9 years ago
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/b225f46f1638
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
(Reporter)

Comment 11

8 years ago
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.