[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Runtime library ambiguities for Subversion on Windows/Debug

From: Alexander Mueller <XelaRellum_at_web.de>
Date: 2006-02-03 17:00:23 CET

Some of the dependant libraries of subversion seem to implicitely
include MSVCRT.lib even for the debug configuration. This leads to the
linker warning LNK4098 which tells you there are conflicts with the
standard library.

This can give unexpected result while debugging Subversion on Windows.
In my configuration _stddup was used from MSVCRT.lib while free was used
from MSVCRTD.lib...

What to do next? Shall I create an issue appending the patch?

Xela

Here is the proposed commit log message entry for the patch:

Changed the generator script for MSVC dsp files so all the libs (even
standard runtim libs) are mentioned explicitely. This is because some
of the libs subversion uses lead to an implicit linkage against
MSVCRT.lib when build in debug configuration. The result is linkage
against MSVCRT.lib and MSVCRTD.lib.

* build/generator/msvc_dsp.ezt: Added the linker option to use
      no default libs (only for EXE)

* build/generator/gen_win.py: add "oldnames.lib",
    "kernel32.lib" and "msvcrtd.lib"/"msvcrt.lib" to the list
    of libs to be linked against (only for EXE)

Index: build/generator/msvc_dsp.ezt
===================================================================
--- build/generator/msvc_dsp.ezt (revision 18322)
+++ build/generator/msvc_dsp.ezt (working copy)
@@ -38,6 +38,7 @@
 # PROP Target_File "[rootpath]\[target.output_dir]\[is configs.name "Debug"][target.debug][else][target.release][end]"
 # PROP Target_Dir "[rootpath]\[target.output_dir]"
 [else]# PROP Output_Dir "[rootpath]\[configs.name]\[target.output_dir]"
+[if-any is_exe]# PROP Ignore_Export_Lib 0[end]
 # PROP Intermediate_Dir "[rootpath]\[configs.name]\[target.intermediate_dir]"
 # PROP Target_Dir ""
 [if-any is_utility][else]LIB32=link.exe -lib
@@ -46,7 +47,7 @@
 # ADD RSC /l [if-any is_exe]0x409[else]0x424[end][is configs.name "Debug"] /d "_DEBUG"[end][for includes] /I "[includes]"[end]
 BSC32=bscmake.exe
 LINK32=link.exe
-[if-any is_exe is_dll]# ADD LINK32 /nologo[if-any is_exe] /subsystem:console[end][if-any is_dll] /dll[end] /debug /machine:IX86[for configs.libs] [configs.libs][end][for configs.libdirs] /libpath:"[configs.libdirs]"[end] /out:"[rootpath]\[configs.name]\[target.output_dir]\[target.output_name]"[if-any instrument_purify_quantify] /fixed:no[end]
+[if-any is_exe is_dll]# ADD LINK32 /nologo[if-any is_exe] /subsystem:console[end][if-any is_dll] /dll[end] /debug /machine:IX86[if-any is_exe] /nodefaultlib[end][for configs.libs] [configs.libs][end][for configs.libdirs] /libpath:"[configs.libdirs]"[end] /out:"[rootpath]\[configs.name]\[target.output_dir]\[target.output_name]"[if-any instrument_purify_quantify] /fixed:no[end]
 [end][end][end][end][end]
 !ENDIF
 
Index: build/generator/gen_win.py
===================================================================
--- build/generator/gen_win.py (revision 18322)
+++ build/generator/gen_win.py (working copy)
@@ -664,6 +664,9 @@
         nondeplibs.append('intl3_svn.lib')
 
     if isinstance(target, gen_base.TargetExe):
+ nondeplibs.append(cfg == 'Debug' and 'msvcrtd.lib' or 'msvcrt.lib')
+ nondeplibs.append('oldnames.lib')
+ nondeplibs.append('kernel32.lib')
       nondeplibs.append('setargv.obj')
 
     if ((isinstance(target, gen_base.TargetSWIG)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 3 17:02:28 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.