Closed Bug 299780 Opened 19 years ago Closed 16 years ago

Make NSS build on WinCE.


(NSS :: Build, defect)

Windows Mobile 6 Standard
Not set


(Not tracked)



(Reporter: dougt, Unassigned)



(3 files)

Attached patch WINCE5.1.mkSplinter Review simply points to
this, along with patch 188393, allows NSS to be built for WinCE.
Attached patch Code changesSplinter Review
The patches presented here are not as general as they could be and are intended
to simply make NSS build when building Minimo not when building NSS standalone.
 I know this is a very low priority for the NSS engineers.  I would like to land
these patches on the main CLIENT branch some time.  In the meantime, i created a
branch to keep these changes on:  NSS_WINCE_CLIENT_TAG

Comment on attachment 188393 [details] [diff] [review]

Doug: you can avoid such trivial files by
adding WINCE to the TARGET_OSES list in
mozilla/security/coreconf/  OSes on that list
only need a single <OS>.mk file, as opposed to one for
each version of the OS.
Attachment #188393 - Attachment is patch: true
Attachment #188393 - Flags: review-
Comment on attachment 188395 [details] [diff] [review]
patch to

The comment in your version of seems to imply
that it is based on rather than the current version
of  I need to know how you arrived at the file
to help me review it.

There are some white space changes (spaces to tabs), which
may have been caused by the editor you used.  In particular
the patch for coreconf/ is all whitespace changes
and should be removed.

In coreconf/, you have:

> 	rm -f $@
>+ifeq (,$(filter-out WINCE%,$(OS_TARGET)))
>+	$(AR) $(OBJS) -OUT:$@
> ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
> 	$(AR) $(subst /,\\,$(OBJS))
> else
> 	$(AR) $(OBJS)
> endif

You should make -OUT:$@ part of AR so you don't need a
special case for WINCE here.  You don't define AR in, so you are obviously passing that in on the
command line from mozilla/security/manager/

I believe your other changes to coreconf/ can also
be improved.
Doug, I think there's some background information missing here.
I had NSS building and working with WinCE (Pocket PC 2002) in 2002.
There were a LOT more changes than this needed to get it to build
and work.  So, if the attached patches are really all that are now 
needed, then I gather that either
a) the WinCE SDK has changed *radically* since 2002, or 
b) you're not using it, but are instead using something else. (cygwin CE? :)

What about WinCE on ARM CPUs?  Previously, MS's compiler for ARM was
named clarm.exe.  Does "cl" now build for ARM CPUs too?

PPC2002's SDK used only unicode (UCS2) not ASCII, in things like filenames,
So there were lots of changes needed in places where filenames are used,
such as in NSS_Init, and the handling of filenames strings for secmod.db.

The SDK's headers didn't support most libc functions, and didn't offer "errno".
I developed a BIG mod to dbm to get it to use NSPR for all file IO instead
of libc file IO methods (which didn't exist on WinCE).  It also used NSPR
error codes rather then "errno", which also didn't exist.  I also developed
an implementation of errno (in NSS headers, IIRC) that used NSPR to provide 
the function that returns the address of errno in thread local storage.  
I don't see anything like that in these patches.  Is there another patch
somewhere, that implements lots of missing libc features, on which this 
patch depends?  If so, pls provide info about that.

Other comments:
a) the patch that reformats comments in (but makes no other
changes) seems unnecessary.
b) do you really want to change the block comment in to say this
is a makefile for NT and Win95?  Or is the sense of this patch backwards?

Finally, these changes, if accepted, need to land on the trunk, not merely
on some browser branch.  
Comment on attachment 188400 [details] [diff] [review]
Code changes

These changes look okay.  Can you describe what they are?
For example, "XXX header is available on current versions
of WinCE" or "XXX feature in libSSL can be implemented on
current versions of WinCE".
cygwin ce -- not really, but close :->

These changes require mozilla/build/wince/shunt/ -- it is a library which
implements many of the missing APIs that Win32 has but WinCE doesn't.  For
example, CreateMutexA is implemented in terms of CreateMutexW.  I do think that
errno is broken as it doesn't use tls.

As far as the compiler goes, when building mozilla minimo, i explictly set CXX,
LD, AR, etc.  So, no doubt the changes to ignore clarm aren't general.

Maybe these changes are not needed if NSS already builds for WINCE.  I couldn't
get it to work out of the box.  
Doug, there have been numerous attempts to build NSS and NSPR on WinCE 
in the past.  At least one of them was succesful.  Here are some relevant
branch tags:
QA Contact: wtchang → build
not actively working on this, feel free to help yourself.
Assignee: doug.turner → nobody
OS: Windows XP → Windows Mobile 6 Standard
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.