Skip to content

Commit 38743b7

Browse files
Ramsay Jonesgitster
authored andcommitted
msvc: Fix an "unrecognized option" linker warning
Having recently added support for building git-imap-send on Windows, we now link against OpenSSL libraries, and the linker issues the following warning: warning LNK4044: unrecognized option '/lssl'; ignored In order to suppress the warning, we change the msvc linker script to translate an '-lssl' parameter to the ssleay32.lib library. Note that the linker script was already including ssleay32.lib (along with libeay32.lib) as part of the translation of the '-lcrypto' library parameter. However, libeay32.dll does not depend on ssleay32.dll and can be used stand-alone, so we remove ssleay32.lib from the '-lcrypto' translation. The dependence of ssleay32.dll on libeay32.dll is represented in the Makefile by the NEEDS_CRYPTO_WITH_SSL build variable. Also, add the corresponding change to the buildsystem generator. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 459a188 commit 38743b7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

compat/vcbuild/scripts/clink.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
push(@args, "iconv.lib");
3232
} elsif ("$arg" eq "-lcrypto") {
3333
push(@args, "libeay32.lib");
34+
} elsif ("$arg" eq "-lssl") {
3435
push(@args, "ssleay32.lib");
3536
} elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
3637
$arg =~ s/^-L/-LIBPATH:/;

contrib/buildsystems/engine.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ sub handleLinkLine
319319
push(@libs, "zlib.lib");
320320
} elsif ("$part" eq "-lcrypto") {
321321
push(@libs, "libeay32.lib");
322+
} elsif ("$part" eq "-lssl") {
322323
push(@libs, "ssleay32.lib");
323324
} elsif ($part =~ /^-/) {
324325
push(@lflags, $part);

0 commit comments

Comments
 (0)