From: Jonathan Nieder <jrnieder@gmail.com>
To: "Diego Elio Pettenò" <flameeyes@gmail.com>
Cc: Anders Kaseorg <andersk@MIT.EDU>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org,
Brian Gernhardt <brian@gernhardtsoftware.com>
Subject: Re: [PATCH] imap-send: link against libcrypto for HMAC and others
Date: Mon, 6 Dec 2010 00:06:28 -0600 [thread overview]
Message-ID: <20101206060628.GA30188@burratino> (raw)
In-Reply-To: <1291613978.4756.157.camel@yamato.local>
Diego Elio Pettenò wrote:
> Il giorno lun, 06/12/2010 alle 00.28 -0500, Anders Kaseorg ha scritto:
>> Also, the Makefile already has a NEEDS_CRYPTO_WITH_SSL flag that’s
>> automatically set on Darwin, Windows, and MinGW. We shouldn’t have two
>> mechanisms for addressing the same problem; maybe we just need to enable
>> the existing flag on more (or all) platforms?
>
> No, these should be different issues
Are you sure? The change description for v1.6.5-rc1~23 (Makefile: Add
NEEDS_CRYPTO_WITH_SSL, 2009-10-08) says:
The Makefile comment for NEEDS_SSL_WITH_CRYPTO says to define it "if
you need -lcrypto with -lssl (Darwin)." However, what it actually
does is add -lssl when you use -lcrypto and not the other way around.
However, libcrypto contains a majority of the ERR_* functions from
OpenSSL (at least on OS X) so we need it both ways.
and grepping that version reveals the same hit I think your patch
deals with:
$ git grep -F -e ERR_ v1.6.5-rc1~23
v1.6.5-rc1~23:imap-send.c: fprintf(stderr, "%s: %s\n", func, ERR_error_string(ERR_get_error(), NULL));
I am guessing the reality is closer to:
Previously we relied on -lssl pulling in libcrypto on most
platforms. That has at least three problems:
(1) it is not resiliant against future changes in libssl.
The DT_NEEDED entries in a library are generally
considered an implementation detail that is allowed to
change.
(2) it does not work on all platforms; for example, ld on
Mac OS X and ld --no-copy-dt-needed-entries on Linux
do not permit that trick.
(3) it is tricky. A simple rule is "explicitly link to
all libraries whos symbols you use directly".
To fix this, eliminate the NEEDS_CRYPTO_WITH_SSL knob and
always treat it as true. NEEDS_SSL_WITH_CRYPTO can stay
because there really are differences between platforms
for that one.
Warning: I could be totally wrong. :) I have not verified any
of these claims.
next prev parent reply other threads:[~2010-12-06 6:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-24 13:55 [PATCH] imap-send: link against libcrypto for HMAC and others Diego Elio Pettenò
2010-11-24 20:01 ` Junio C Hamano
2010-11-24 20:03 ` Diego Elio Pettenò
2010-12-06 5:28 ` Anders Kaseorg
2010-12-06 5:39 ` Diego Elio Pettenò
2010-12-06 6:06 ` Jonathan Nieder [this message]
2010-12-06 6:11 ` Junio C Hamano
2010-12-08 1:51 ` Jared Hance
2010-12-08 2:12 ` Junio C Hamano
2010-12-08 4:53 ` Anders Kaseorg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101206060628.GA30188@burratino \
--to=jrnieder@gmail.com \
--cc=andersk@MIT.EDU \
--cc=brian@gernhardtsoftware.com \
--cc=flameeyes@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.