Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pipnss.lib

35 views
Skip to first unread message

Aditya Ivaturi

unread,
Aug 11, 2009, 10:34:30 PM8/11/09
to
I am trying to do a debug build on windows & pipnss.lib (./obj-ff-
debug/security/manager/ssl/src) file is not being generated
(pipnss.dll is present in always generated). Either that or may be it
is being deleted after the build process is completed. This is
my .mozconfig:

. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-ff-debug
ac_add_options --enable-debug
ac_add_options --disable-optimize
mk_add_options MOZ_MAKE_FLAGS="-s -j4"

Do I have to use some other options to keep all the lib files around?

Benjamin Smedberg

unread,
Aug 12, 2009, 12:11:48 PM8/12/09
to
On 8/11/09 10:34 PM, Aditya Ivaturi wrote:
> I am trying to do a debug build on windows & pipnss.lib (./obj-ff-
> debug/security/manager/ssl/src) file is not being generated
> (pipnss.dll is present in always generated). Either that or may be it
> is being deleted after the build process is completed. This is
> my .mozconfig:

pipnss.dll is an XPCOM component. What use would you have for an import
library? (XPCOM components are dynamically loaded and are never linked against).

--BDS

Aditya Ivaturi

unread,
Aug 12, 2009, 2:08:08 PM8/12/09
to

> pipnss.dll is an XPCOM component. What use would you have for an import
> library? (XPCOM components are dynamically loaded and are never linked against).

This thread over @mozilla.dev.security should give a good background
of what I am trying to do -
http://groups.google.com/group/mozilla.dev.security/browse_thread/thread/c1352bd98360cf24#.

In short, I am trying to get the 5th field in cert_override.txt as
described here https://developer.mozilla.org/En/Cert_override.txt.
This can be done via nsNSSCertificate object. So when I am trying to
instantiate that object: nsNSSCertificate *cert =
nsNSSCertificate::ConstructFromDER(derBuf, derLen); the linker on
windows throws this error:

"error LNK2019: unresolved external symbol "public: static class
nsNSSCertificate * __cdecl nsNSSCertificate::ConstructFromDER(char
*,int)" (?ConstructFromDER@nsNSSCertificate@@SAPAV1@PADH@Z) referenced
in function _main"

So the linker was not able to find the exported symbol & after a bit
of digging around make files, it seems the library (or dll in this
case) which exports all the NSS symbols are in pipnss. And to compile
my code I need the pipnss.lib to link against. I didn't know that
pipnss was a XPCOM dll & for that matter I have never worked with
XPCOM either. So when you compile a XPCOM dll, it doesnot generate an
interim lib file like you do in a normal dll? And if not then I guess
I have to load the pipnss.dll in my code to pretty much what I want to
do, right?

Benjamin Smedberg

unread,
Aug 12, 2009, 2:50:23 PM8/12/09
to
On 8/12/09 2:08 PM, Aditya Ivaturi wrote:

> In short, I am trying to get the 5th field in cert_override.txt as
> described here https://developer.mozilla.org/En/Cert_override.txt.
> This can be done via nsNSSCertificate object. So when I am trying to
> instantiate that object: nsNSSCertificate *cert =
> nsNSSCertificate::ConstructFromDER(derBuf, derLen); the linker on
> windows throws this error:
>
> "error LNK2019: unresolved external symbol "public: static class
> nsNSSCertificate * __cdecl nsNSSCertificate::ConstructFromDER(char
> *,int)" (?ConstructFromDER@nsNSSCertificate@@SAPAV1@PADH@Z) referenced
> in function _main"

You really aren't going to be able to use these objects in that way. First
of all, these symbols are not exported from the DLL: the only symbol that is
exported is NSGetModule. Secondly, all of that code depends on XPCOM being
initialized.

You'd be much better off using the XPCOM APIs from within a web browser
extension to get that information. I don't really know which APIs you need,
but you can see some of the important ones here:

http://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/public/

--BDS

Aditya Ivaturi

unread,
Aug 12, 2009, 4:16:16 PM8/12/09
to

> You really aren't going to be able to use these objects in that way. First
> of all, these symbols are not exported from the DLL: the only symbol that is
> exported is NSGetModule. Secondly, all of that code depends on XPCOM being
> initialized.

I was trying to compile against the mozilla source code itself (at
least that is how I did it in Linux). So I was assuming I could do the
same in windows too. So when the linker didn't find the required
symbol, I checked the make file for that directory (security/manager/
ssl/src) & the module it was referring to was pipnss, so I assumed it
was exporting it.


> You'd be much better off using the XPCOM APIs from within a web browser
> extension to get that information. I don't really know which APIs you need,
> but you can see some of the important ones here:
>

> http://mxr.mozilla.org/mozilla-central/source/security/manager/ssl/pu...
>

Thank you. If I can find the right method calls, this would be a much
cleaner (& reliable) approach than what I am currently doing.

0 new messages