Re: [nodejs] How to recompile openssl dependency

295 views
Skip to first unread message

Ben Noordhuis

unread,
Oct 4, 2012, 10:32:33 PM10/4/12
to nod...@googlegroups.com
On Fri, Oct 5, 2012 at 4:13 AM, Justin Meltzer <jus...@airtimehq.com> wrote:
> There's a small bug with respect to an Internet Explorer corner case in the
> openssl dependency package. I'd like to modify one of the openssl C files
> but I'm at a loss as to how to recompile this package so that node can use
> my updates. Any help would be greatly appreciated!

I assume that you mean the bundled version that lives in deps/openssl?
It should be trivial, just edit the file and run make, gyp (the build
system) will pick up the changes and recompile the required files.

Justin Meltzer

unread,
Oct 5, 2012, 12:10:01 AM10/5/12
to nod...@googlegroups.com
Yeah exactly, the bundled version in deps/openssl.

Thanks! Do I need to run ./configure? or just make? what about make install?

Ben Noordhuis

unread,
Oct 5, 2012, 7:51:43 AM10/5/12
to nod...@googlegroups.com
On Fri, Oct 5, 2012 at 6:10 AM, Justin Meltzer <jus...@airtimehq.com> wrote:
> Yeah exactly, the bundled version in deps/openssl.
>
> Thanks! Do I need to run ./configure? or just make? what about make install?

Right, I assumed you had already built node. You don't have to
reinstall it on every compile, the binary is quite self-contained.
Here, try this:

$ export JOBS=<num-cpus> # speed up build
$ ./configure
$ make BUILDTYPE=Release
$ out/Release/node # starts the REPL

If you want debug builds, repeat the last two steps with s/Release/Debug/

Justin Meltzer

unread,
Oct 5, 2012, 12:44:57 PM10/5/12
to nod...@googlegroups.com
Actually yes, node is already built. I'm just looking to recompile the openssl dependency inside node/deps/openssl.

I tried running make inside node/deps/openssl/openssl but unfortunately it threw an error related to the linker (there was some undefined reference or something). I then noticed that each openssl sub-package (ssl, crytpo etc.) has its own Makefile. Since I only updated a fie inside the ssl package of openssl, I ran

make clean all

inside that directory and it seemed to finish with no errors.

So the main thing I'd like to understand is which packages can I recompile so that node will pick up these openssl modifications? Is recompiling just the ssl package of the openssl package sufficient? Or do I have to recompile the entire openssl package? Will recompiling node as a whole also dynamically recompile the openssl package and pick up those changes?

Thanks!

Ben Noordhuis

unread,
Oct 5, 2012, 4:07:26 PM10/5/12
to nod...@googlegroups.com
On Fri, Oct 5, 2012 at 6:44 PM, Justin Meltzer <jus...@airtimehq.com> wrote:
> Actually yes, node is already built. I'm just looking to recompile the
> openssl dependency inside node/deps/openssl.
>
> I tried running make inside node/deps/openssl/openssl but unfortunately it
> threw an error related to the linker (there was some undefined reference or
> something). I then noticed that each openssl sub-package (ssl, crytpo etc.)
> has its own Makefile. Since I only updated a fie inside the ssl package of
> openssl, I ran
>
> make clean all
>
> inside that directory and it seemed to finish with no errors.
>
> So the main thing I'd like to understand is which packages can I recompile
> so that node will pick up these openssl modifications? Is recompiling just
> the ssl package of the openssl package sufficient? Or do I have to recompile
> the entire openssl package? Will recompiling node as a whole also
> dynamically recompile the openssl package and pick up those changes?

Are you working with 0.6 or 0.8?

If you get a linker error with 0.8, you either had an error somewhere
in your code or you need to add the missing dependencies or defines to
deps/openssl/openssl.gyp and run configure again. In any case, you
shouldn't use any of the Makefiles in deps/openssl - node doesn't and
won't pick up your changes.

The story is different for 0.6 but you shouldn't be using that anyway. :-)

Justin Meltzer

unread,
Oct 5, 2012, 4:18:44 PM10/5/12
to nod...@googlegroups.com
yeah I actually am using 0.6...

Justin Meltzer

unread,
Oct 5, 2012, 4:29:00 PM10/5/12
to nod...@googlegroups.com
I suppose you highly recommend upgrading to v. 0.8 then haha

Just to be clear, in v. 0.8 any time I run 

$ make && sudo make install

for node, any changes to the deps/openssl dependency package will be picked up?

Ben Noordhuis

unread,
Oct 5, 2012, 4:35:39 PM10/5/12
to nod...@googlegroups.com
On Fri, Oct 5, 2012 at 10:29 PM, Justin Meltzer <jus...@airtimehq.com> wrote:
> I suppose you highly recommend upgrading to v. 0.8 then haha
>
> Just to be clear, in v. 0.8 any time I run
>
> $ make && sudo make install
>
> for node, any changes to the deps/openssl dependency package will be picked
> up?

Yep, that's correct.

Justin Meltzer

unread,
Oct 5, 2012, 4:45:24 PM10/5/12
to nod...@googlegroups.com
Cool. 

Btw, node.js packages for Fedora systems (http://nodejs.tchol.org/) are out of date. Thought I'd give you a heads up. Looks like I'll have to install from source now.

Nathan Rajlich

unread,
Oct 5, 2012, 4:53:11 PM10/5/12
to nod...@googlegroups.com
Those Fedora rpms are maintained by someone else, but it seems like
they're not maintaining them any longer:
http://lists.tchol.org/pipermail/nodejs-tchol.org/
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

Justin Meltzer

unread,
Oct 5, 2012, 5:29:13 PM10/5/12
to nod...@googlegroups.com
Ok and although you don't recommend it, what about with 0.6?

Btw, thanks so much for all of this help :)

Justin Meltzer

unread,
Oct 5, 2012, 5:29:52 PM10/5/12
to nod...@googlegroups.com
Got it... that's a shame :/

Ben Noordhuis

unread,
Oct 5, 2012, 5:51:06 PM10/5/12
to nod...@googlegroups.com
On Fri, Oct 5, 2012 at 11:29 PM, Justin Meltzer <jus...@airtimehq.com> wrote:
> Ok and although you don't recommend it, what about with 0.6?

Well, for one it doesn't use the bundled openssl. :-)

You'd have to build openssl yourself, then pass include and library
paths to the configure script. `./configure --help | grep openssl`
shows an overview.
Reply all
Reply to author
Forward
0 new messages