bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MSVC runtime lib issue


From: Eli Zaretskii
Subject: Re: MSVC runtime lib issue
Date: Fri, 29 Nov 2013 16:43:19 +0200

> From: "Gisle Vanem" <address@hidden>
> Date: Fri, 29 Nov 2013 14:01:46 +0100
> 
> This project file doesn't specify any runtime lib to link with. Hence the 
> default is to use 
> LIBCMT.LIB as if '-MT' was used. I would like to build using '-MD' (or 
> '-MDd') which 
> pulls in msvcrt[d].dll (most MSVC software seems to be using this CRT these 
> days).

Why is that a good idea?  "If it ain't broken, don't fix it."

> But then the linker fails at pulling in 'tmpfile' in 'w32/compat/posixfcn.c':
> 
>   MSVCRT.lib(MSVCR100.dll) : error LNK2005: _tmpfile already defined in 
> posixfcn.obj
> 
> Presumably because 'tmpfile' is needed elsewhere in MSVCRT.lib. So can you 
> please
> rename 'tmpfile' to 'gmake_tmpfile' like so:

Yuck!  I don't want such ugliness without a very good reason.  So this
goes back to the question I asked above: what is the problem with the
original build method?  (And why use MSVC at all, when MinGW is widely
available, and is Free Software?)

> Using '-MD' also caused an issue with 'environ'. Hence that had to go too:
> 
>   g:\mingw32\src\gnu\gnu-make\makeint.h(587) : warning C4273: '_environ' : 
> inconsistent dll linkage
>           g:\vc_2010\VC\include\stdlib.h(299) : see previous definition of 
> '_environ'

What does stdlib.h say about 'environ'?

> I've tested my patch against MingW too with no problems.

Look, in a year or two no one will remember why this ugliness is
there.  And then the poor future maintainers will be at a dilemma:
should they nuke the code they don't understand, and risk breaking
someone's precious build, or should they leave alone any cruft they
don't understand?

I'd like to make Make sources cleaner, not less so.

So please reconsider whether you really need this, and if so, please
come up with a good explanation why.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]