Bug #5289 Wrong naming in linker Settings of source distribution
Submitted: 30 Aug 2004 11:14 Modified: 7 Sep 2004 11:00
Reporter: Jonathan Hoser Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.0.20a\4.0.21 BK source OS:Windows (Windows 2000)
Assigned to: Lenz Grimmer CPU Architecture:Any

[30 Aug 2004 11:14] Jonathan Hoser
Description:
Found in the big (9.3Mb) Windows-Zip Source of Version 4.0.20a - 
while trying to compile the Sub-Project "libmysqld"

--------------------Konfiguration: libmysqld - Win32 Release--------------------
Linker-Vorgang läuft...
LINK : fatal error LNK1181: Eingabedatei "..\lib_release\myisam_tls.lib" kann nicht geoeffnet werden
Fehler beim Ausführen von link.exe.

Translation - thought meaning should be obvious:
LINK : fatal error LNK1181: File "..\lib_release\myisam_tls.lib" cannot be opened
Failure Executing link.exe

How to repeat:
Download the 4.0.20a big windows source package (9.3mb, MD5: 6398bfee4f2f4a82efff7a156c8782a2 )

unpack - open mysql.dsw with VC6;
Set "libmysqld" as active project an do a complete build of libmysqld.dll

once it reached the linker-Stage, the error occurs...

Suggested fix:
Under Settings -> tab "linker" -> object/library modules are given
(at the end of the list) following entrys:

..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib

only that those libs with the _tls.lib ending are not created - 
instead the files without _tls are made - so the correct linkersettings should be
like

..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib
[31 Aug 2004 6:55] MySQL Verification Team
Thank you for the bug report.I was able to repeat with Windows source built
from latest BK tree:

unireg.cpp
Generating Code...
Linking...
LINK : fatal error LNK1181: cannot open input file "..\lib_release\myisam_tls.lib"
Error executing link.exe.

libmysqld.dll - 1 error(s), 2 warning(s)

Additional Info:
Currently the work-around is to build before the missed libraries
with the Batch Build selection option.
[6 Sep 2004 21:42] Lenz Grimmer
Not sure yet if simply removing the lines referring to the *_tls.lib files is the correct approach.

These libraries do exist, when the compile is performed a second time. To me this looks like a wrong build dependency instead - the linker should not attempt to link against libraries that have not been built at that point. Still investigating...
[6 Sep 2004 23:24] Lenz Grimmer
It seems like this modification (to link the libmysqld release library against the "TLS" versions of these other libs) was done on purpose by Monty - I am waiting for feedback from him about the rationale for this change. You proposed fix looks correct to me, I just want to verify that there is not a special reason for this. As a workaround, you can simply build these TLS libs before building the libmysqld project.
[7 Sep 2004 11:00] Lenz Grimmer
According to Monty, it is actually intended to link mysqld against the _tls.lib files, otherwise the resulting binary would not work. The main problem is that the VC++ compiler can only create dependencies for projects within the same configuration. libmysqld and mysys_tls are in different configurations and can thus not be made dependable. So he currently does not see a way to work around this restriction in how the Microsoft compiler works.

I will resolve this bug as "Won't fix" for the time being - there is no workaround for this available at the present time.