Please excuse me for cross-posting this message with mozilla-macosx. I figure this is kind of a PKCS#11 issue, too, so ...
Thanks for your help, I guess I know what my problem is, now; the browser's in CFM, but my PKCS#11 module was in Mach-O.
So: I downloaded MPW and compiled the PKCS#11 code with it. I added a "#pragma export list C_*" line for each function to the code. I chose "shared library", target "PowerPC Only", PowerPC Model "Carbon" in CreateMake Options.
Sadly, I got the same result. My module doesn't seem to be called at all.
Any advice, please? Did I use wrong options in CreateMake? Do I have to do alignment and things like that?
The compilation/link commands I used are as follows:
MrC pkcs11.c -o :pkcs11.c.x -sym off -d TARGET_API_MAC_CARBON=1
MrC C Compiler 4.1.0f1c1
Copyright (C) 1994-1999 by Apple Computer, Inc.
PPCLink -o pkcs11 ":pkcs11.c.x" "Macintosh HD:MPW-GM:MPW-GM:MPW::Interfaces&Libraries:Libraries:SharedLibraries:CarbonLib" "Macintosh HD:MPW-GM:MPW-GM:MPW::Interfaces&Libraries:Libraries:SharedLibraries:StdCLib" "Macintosh HD:MPW-GM:MPW-GM:MPW::Interfaces&Libraries:Libraries:PPCLibraries:StdCRuntime.o" "Macintosh HD:MPW-GM:MPW-GM:MPW::Interfaces&Libraries:Libraries:PPCLibraries:PPCCRuntime.o" "Macintosh HD:MPW-GM:MPW-GM:MPW::Interfaces&Libraries:Libraries:PPCLibraries:PPCToolLibs.o" -sym off -mf -d -t 'shlb' -c '????' -xm s
Thank you so much for your help.
> -----Original Message-----
> From: Steve Dagley [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 19, 2002 2:19 PM
> To: [EMAIL PROTECTED]
> Subject: Re: PKCS#11 module loading problem in Mozila 0.9.9?
>
>
> Have you tried one of the mach-o Mozilla builds to see it
> will load your module?
> The 0.9.9 build you reference is a CFM build (built with
> Code Warrior Pro 7)
> while you've built a mach-o library. Mixing the two
> environments for libs is
> not something Mozilla supports (yet).
>
> Naomaru Itoi wrote:
> > Hello, folks,
> >
> > First of all, thank you for the hard work.
> >
> > I am having difficulty loading my PKCS#11 module on
> Mozilla-0.9.9 / Mac
> > OS X. I tried Netscape-6.2, too, but got the same result. I will
> > really appreciate it if you could give me a hint.
> >
> > I wrote just enough (C_GetFunctionList, C_Initialize, etc.)
> methods to
> > be able to be loaded to the browser.
> >
> > I tested the code on Netscape-4.7* on Solaris. The browser
> loads it fine.
> > Now I brought it to Mac OS X-1.3, compiled and linked as follows.
> >
> > [localhost:~/mycode/acpkcs11] apple% make
> > cc -c -o ac_macx_pkcs11.o ac_macx_pkcs11.c
> > cc -dynamiclib -o libac_macx_pkcs11.dylib
> ac_macx_pkcs11.o -lc -lm -ldl
> > [localhost:~/mycode/acpkcs11] apple%
> >
> > - In Mozilla-0.99 (binary downloaded from
> >
http://download.mozilla.org/pub/mozilla/releases/mozilla0.9.9/mozilla-macosX-0.9.9.smi.bin),
>
> - I go Mozilla->Preferences->Privacy & Security->Certificates->Manage
> Security Devices->Load and put in the libac_macx_pkcs11.dylib.
>
> - Mozilla says "Unable to add module", and does not load the module.
>
> Now what's worse is that, even though my code will write a log file in
> /tmp/ as soon as it is called, I do not get any log. So I have to
> assume that my code is not loaded at all to Mozilla.
>
> I wonder if this is because the way I am compiling ... What do you
> think? I use cc -dylib, but is there any other way? Does Mozilla
> expect a bundle instead of a dynamic library? Is there any way to get
> an error log from Mozilla to see what's going wrong?
>
> Any advice will be welcome.
>
> Thank you.
--
Steve Dagley
Member of the Technical Staff, Netscape Communications
Macintosh Perfusionist
(All opinions expressed are my own yada yada yada...)
