Subject: Re: [PATCH] imap-send: link against libcrypto for HMAC and others

From: Anders Kaseorg <[email-masked]>
Date: Mon, 06 Dec 2010 00:28:24 -0500

On Wed, 2010-11-24 at 21:03 +0100, Diego Elio Pettenò wrote:
> When using stricter linkers, such as GNU gold or Darwin ld, transitive
> dependencies are not counted towards symbol resolution. If we don't
> link imap-send to libcrypto, we'll have undefined references to the
> HMAC_*, EVP_* and ERR_* functions families.
> […]
>  git-imap-send$X: imap-send.o $(GITLIBS)
>  	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
> -		$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
> +		$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)

This broke the build with NO_OPENSSL=1, so Debian will need to revert
it:

    CC imap-send.o
    LINK git-imap-send
/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
make[1]: *** [git-imap-send] Error 1

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?

Anders