Linker failure after compilation with "enable-crypto-mdebug"

Jan Just Keijser janjust at nikhef.nl
Thu Apr 29 07:20:51 UTC 2021


Hi,

On 28/04/21 21:22, Robert Smith wrote:
> Hi Jan,
>
> Thank you for your response.
> Obviously the file mem_dbg is not included and that is why I am having 
> this problem.
>
> The questions are:
> Whether the "enable-crypto-mdebug" flag supported in Windows at all?
>
> Whether this is known issue?
>
> What control do I have over Windows build (I mean how can I include or 
> exclude certain file)? My assumption was if I have to mess with 
> Windows build scripts, I am in the wrong direction. However I could be 
> I wrong ...
>
> Whether the file mem_dbg was excluded on purpose from Windows build?

there does not seem to be anything specific about mem_dbg ; I don't have 
Visual Studio but if I do a mingw64 build of openssl 1.1.1k with 
"enable-crypto-mdebug" set then it builds just fine.

How did you configure openssl ? what command did you run and what build 
environment are you using? msys?

It will also be interesting to see the output of
   perl configdata.pm --dump
after you've run  the Configure script - that should tell you whether 
mdebug is enabled or not:

     crypto-mdebug           [default] OPENSSL_NO_CRYPTO_MDEBUG

is the default.

HTH,

JJK


> On Wednesday, April 28, 2021, 06:51:36 AM EDT, Jan Just Keijser 
> <janjust at nikhef.nl> wrote:
>
>
> Hi,
>
> On 26/04/21 20:29, Robert Smith via openssl-users wrote:
> Hello everyone.
>
> I'm trying to recompile OpenSSL version 1.1.1k under Windows 10 with 
> the following configuration flag enable-crypto-mdebug
> and getting the following linker error:
>
>
>  Creating library apps\openssl.lib and object apps\openssl.exp
> openssl.obj : error LNK2019: unresolved external symbol 
> _CRYPTO_mem_leaks referenced in function _main
> apps\openssl.exe : fatal error LNK1120: 1 unresolved externals
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
> Studio 10.0\VC\BIN\link.EXE"' : return code '0x460'
> Stop.
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual 
> Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
> Stop.
>
> Wasted already a few hours trying to figure out the cause for this 
> failure.
>
>
> when building and linking with "enable-crypto-mdebug" set the file 
> "crypto/mem_dbg.o" needs to be included in the library libcrypto.a (or 
> crypto.lib); check that this file is indeed included when creating the 
> crypto library.
>
> For the record: a Linux build with "enable-crypto-mdebug" works fine.
>
> HTH,
>
> JJK
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20210429/f90d2ed9/attachment-0001.html>


More information about the openssl-users mailing list