git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] msvc: Fix an "unrecognized option" linker warning
@ 2010-01-20 19:25 Ramsay Jones
  2010-01-23  0:06 ` Sebastian Schuberth
  0 siblings, 1 reply; 2+ messages in thread
From: Ramsay Jones @ 2010-01-20 19:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Sixt, GIT Mailing-list


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>
---
 compat/vcbuild/scripts/clink.pl |    1 +
 contrib/buildsystems/engine.pl  |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
index 8a2112f..4374771 100644
--- a/compat/vcbuild/scripts/clink.pl
+++ b/compat/vcbuild/scripts/clink.pl
@@ -31,6 +31,7 @@ while (@ARGV) {
 		push(@args, "iconv.lib");
 	} elsif ("$arg" eq "-lcrypto") {
 		push(@args, "libeay32.lib");
+	} elsif ("$arg" eq "-lssl") {
 		push(@args, "ssleay32.lib");
 	} elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
 		$arg =~ s/^-L/-LIBPATH:/;
diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl
index 245af73..ce4eb1e 100644
--- a/contrib/buildsystems/engine.pl
+++ b/contrib/buildsystems/engine.pl
@@ -322,6 +322,7 @@ sub handleLinkLine
             push(@libs, "zlib.lib");
 	} elsif ("$part" eq "-lcrypto") {
             push(@libs, "libeay32.lib");
+        } elsif ("$part" eq "-lssl") {
             push(@libs, "ssleay32.lib");
         } elsif ($part =~ /^-/) {
             push(@lflags, $part);
-- 
1.6.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/4] msvc: Fix an "unrecognized option" linker warning
  2010-01-20 19:25 [PATCH 2/4] msvc: Fix an "unrecognized option" linker warning Ramsay Jones
@ 2010-01-23  0:06 ` Sebastian Schuberth
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Schuberth @ 2010-01-23  0:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Johannes Sixt

On 20.01.2010 20:25, Ramsay Jones wrote:

> 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>

-- 
Sebastian Schuberth

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-23  0:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20 19:25 [PATCH 2/4] msvc: Fix an "unrecognized option" linker warning Ramsay Jones
2010-01-23  0:06 ` Sebastian Schuberth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).