RE: Building NSS with VS2008, Statically Linking the CRT

2012-07-13 Thread Sam Laidler
Can anyone please tell me where I can get hold of the Mozilla custom C runtime 
please?

Sam.

-Original Message-
From: dev-tech-crypto-bounces+sam.laidler=the-logic-group@lists.mozilla.org 
[mailto:dev-tech-crypto-bounces+sam.laidler=the-logic-group@lists.mozilla.org]
 On Behalf Of Robert Relyea
Sent: 12 July 2012 19:07
To: dev-tech-crypto@lists.mozilla.org
Subject: Re: Building NSS with VS2008, Statically Linking the CRT

On 07/12/2012 03:20 AM, Sam Laidler wrote:
 Hello, hope all is well.



 I want to distribute NSS without the MS redistribution package. When I read 
 the following, I got the impression that it should be theoretically possible:



 https://developer.mozilla.org/en/USE_STATIC_LIBS


USE_STATIC_LIBS don't affect how the nss shared libraries are build, only how 
the commands and tools are built. It statically links commands with libnss.a 
rather than libnss3.so (well, sort of, it's really a series of static 
libraries).

Even in this case, system shared libraries, and even some NSS shared libraries 
(like libfreebl) are still external dependencies.


 In both cases I got NSS to build but I found that nss3.dll had a dependency 
 on msvcr90.dll.



 I did some Googling and found:



 http://old.nabble.com/How-to-build-nspr%2Bnss-on-Windows-with-VS-2008-
 %28VC%2B%2B-9.0%29-td26081750.html



 Here, Wan-Teh seemed to suggest that using the redistribution package was 
 unavoidable, whereas Nelson said you can use mozcrt19.dll instead.

Actually both Nelson and WTC are in agreement. If you look at the bug Nelson 
points to, you will see that the default NSS does not have a way of avoiding 
redistribution of the given package, however that bug contains a patch Nelson 
uses to build NSS using mozcrt19.dll rather than msvcr90.dll. If you apply 
Nelson's (3 year old patch), you may have success in changing the dependency to 
the mozilla runtine.



 I'm sorry, guys, but I'm a bit confused here.



 * Am I doing something wrong when building NSS?

 * I thought static linking relieved the obligation to distribute a 
 separate DLL. Or is it loaded at runtime into some kind of address space 
 instead?
It only removes the dependencies on most of the standard nss libraries 
themselves. I believe you still need to dynamically link nspr, freebl and the 
system libraries.

 * If so, does that mean I should be able to simply drop the 
 msvcr90.dll into the working directory that contains a static build without 
 worrying too much about the side-by-side/manifest file stuff?
msvcr90.dll just needs to be in your path. If it's in the same directory as 
nss3.dll, that should be sufficient.

 * I also thought of trying to build NSPR/NSS with mozcrt19, but 
 struggled to find out how to do it. Would it help me to achieve what I want?

I believe if you just apply the patch Nelson has in the bug, it should work. 
You'll need to get a mozcrt19.a from somewhere as well.

bob

-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto


Building NSS with VS2008, Statically Linking the CRT

2012-07-12 Thread Sam Laidler
Hello, hope all is well.



I want to distribute NSS without the MS redistribution package. When I read the 
following, I got the impression that it should be theoretically possible:



https://developer.mozilla.org/en/USE_STATIC_LIBS



However, I had difficulty using these instructions verbatim for NSS. Maybe the 
above link only applies to building FireFox. Undeterred, I read the following:



https://developer.mozilla.org/en/NSS_reference/Building_and_installing_NSS/Build_instructions



From here, I tried the following from start-msvc9.bat:



export USE_STATIC_LIBS=1

make BUILD_OPT=1 NSDISTMODE='copy' nss_build_all



and also...



make BUILD_OPT=1 NSDISTMODE='copy' USE_STATIC_LIBS=1 nss_build_all



In both cases I got NSS to build but I found that nss3.dll had a dependency on 
msvcr90.dll.



I did some Googling and found:



http://old.nabble.com/How-to-build-nspr%2Bnss-on-Windows-with-VS-2008-%28VC%2B%2B-9.0%29-td26081750.html



Here, Wan-Teh seemed to suggest that using the redistribution package was 
unavoidable, whereas Nelson said you can use mozcrt19.dll instead.



I'm sorry, guys, but I'm a bit confused here.



* Am I doing something wrong when building NSS?

* I thought static linking relieved the obligation to distribute a 
separate DLL. Or is it loaded at runtime into some kind of address space 
instead?

* If so, does that mean I should be able to simply drop the msvcr90.dll 
into the working directory that contains a static build without worrying too 
much about the side-by-side/manifest file stuff?

* I also thought of trying to build NSPR/NSS with mozcrt19, but 
struggled to find out how to do it. Would it help me to achieve what I want?



As you can see, I'm a bit lost. Any assistance would be most gratefully 
received.



Many thanks and best regards,

Sam Laidler
Senior Software Engineer

direct +44 (0)1252 644 207
email 
samuel.laid...@the-logic-group.commailto:samuel.laid...@the-logic-group.com




The Logic Group
Enterprises Limited

[http://www.the-logic-group.com/UploadedImages/e41e3e9c-e72a-4079-b979-8b28a96e3294.jpg]
Logic House
Waterfront Business Park
Fleet, Hampshire
GU51 3SB
United Kingdom  
[http://www.the-logic-group.com/UploadedImages/e41e3e9c-e72a-4079-b979-8b28a96e3294.jpg]
phone
fax
email
web +44 1252 776 700
+44 1252 776 738
i...@the-logic-group.com
www.the-logic-group.com 
[http://www.the-logic-group.com/UploadedImages/e41e3e9c-e72a-4079-b979-8b28a96e3294.jpg]
Registered in England
Number 2609323  
[http://www.the-logic-group.com/UploadedImages/e41e3e9c-e72a-4079-b979-8b28a96e3294.jpg]
Join the conversation:  
[http://www.the-logic-group.com/UploadedImages/e41e3e9c-e72a-4079-b979-8b28a96e3294.jpg]

[http://www.the-logic-group.com/UploadedImages/34e428b6-82a8-46f4-999d-89403051ff3c.jpg]

[http://www.the-logic-group.com/UploadedImages/e41e3e9c-e72a-4079-b979-8b28a96e3294.jpg]
[http://www.the-logic-group.com/UploadedImages/85c2880b-e962-4adb-a79c-71acc07d157b.jpg]
 http://www.twitter.com/thelogicgroup   
[http://www.the-logic-group.com/UploadedImages/cbfc0030-b42b-491f-be87-e86de56628c4.jpg]
  http://www.linkedin.com/company/the-logic-group   
[http://www.the-logic-group.com/UploadedImages/059d17b1-4780-46b8-8e06-a0030b6c0fa2.jpg]
  http://www.youtube.com/user/customerinteractions



The Logic Group Enterprises Limited, Logic House, Waterfront Business Park, 
Fleet Road, Fleet,
Hampshire, GU51 3SB, United Kingdom. Registered in England. Registered No. 
2609323


The information in this email and any attachments are confidential and may be 
legally privileged and protected by law. It is for the intended recipient only. 
If you are not the intended recipient you may not use, disclose, copy, 
distribute, print or rely on the content of this email or its attachments. If 
this email has been received by you in error please advise the sender and 
delete the email from your system.


-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto


Re: Building NSS with VS2008, Statically Linking the CRT

2012-07-12 Thread Robert Relyea

On 07/12/2012 03:20 AM, Sam Laidler wrote:

Hello, hope all is well.



I want to distribute NSS without the MS redistribution package. When I read the 
following, I got the impression that it should be theoretically possible:



https://developer.mozilla.org/en/USE_STATIC_LIBS



USE_STATIC_LIBS don't affect how the nss shared libraries are build, 
only how the commands and tools are built. It statically links commands 
with libnss.a rather than libnss3.so (well, sort of, it's really a 
series of static libraries).


Even in this case, system shared libraries, and even some NSS shared 
libraries (like libfreebl) are still external dependencies.




In both cases I got NSS to build but I found that nss3.dll had a dependency on 
msvcr90.dll.



I did some Googling and found:



http://old.nabble.com/How-to-build-nspr%2Bnss-on-Windows-with-VS-2008-%28VC%2B%2B-9.0%29-td26081750.html



Here, Wan-Teh seemed to suggest that using the redistribution package was 
unavoidable, whereas Nelson said you can use mozcrt19.dll instead.


Actually both Nelson and WTC are in agreement. If you look at the bug 
Nelson points to, you will see that the default NSS does not have a way 
of avoiding redistribution of the given package, however that bug 
contains a patch Nelson uses to build NSS using mozcrt19.dll rather than 
msvcr90.dll. If you apply Nelson's (3 year old patch), you may have 
success in changing the dependency to the mozilla runtine.




I'm sorry, guys, but I'm a bit confused here.



* Am I doing something wrong when building NSS?

* I thought static linking relieved the obligation to distribute a 
separate DLL. Or is it loaded at runtime into some kind of address space 
instead?
It only removes the dependencies on most of the standard nss libraries 
themselves. I believe you still need to dynamically link nspr, freebl 
and the system libraries.


* If so, does that mean I should be able to simply drop the msvcr90.dll 
into the working directory that contains a static build without worrying too 
much about the side-by-side/manifest file stuff?
msvcr90.dll just needs to be in your path. If it's in the same directory 
as nss3.dll, that should be sufficient.


* I also thought of trying to build NSPR/NSS with mozcrt19, but 
struggled to find out how to do it. Would it help me to achieve what I want?

I believe if you just apply the patch Nelson has in the bug, it should 
work. You'll need to get a mozcrt19.a from somewhere as well.


bob

-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Re: Building NSS with VS2008, Statically Linking the CRT

2012-07-12 Thread Wan-Teh Chang
On Thu, Jul 12, 2012 at 3:20 AM, Sam Laidler
sam.laid...@the-logic-group.com wrote:

 I want to distribute NSS without the MS redistribution package. When I read 
 the following,
 I got the impression that it should be theoretically possible:

 https://developer.mozilla.org/en/USE_STATIC_LIBS

That page describes the USE_STATIC_LIBS variable for Mozilla's build system.
Unfortunately NSS's build system has a same-named variable that has a different
meaning.  Bob Relyea was talking about the USE_STATIC_LIBS variable in the
NSS build system in his reply.

There is an old patch for NSS that allows you to build NSS against msvcrt.dll,
which is present in Windows:
https://bugzilla.mozilla.org/show_bug.cgi?id=79

You can give that a try.  You need to be very familiar with build
systems though.

Wan-Teh
-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto