From: Earnie B. <ea...@us...> - 2013-05-17 21:25:07
Attachments:
msvcrt_version
|
I'm doing some research into determining at configure time what version of MSVCRT.DLL is actually available on a system. I've created a small shell script for you to run that is attached. What I need is some input from you as to whether or not this method could be used to create a m4 script for configure to use to set a MSVCRT_VERSION variable in config.h. The issue I'm trying to overcome is the system on XP doesn't have some functions and data structures in MSVCRT that Vista/Win7/Win8 etc have such as the stat structure being defined in stat.h. It is quite maddening. So if we can set MSVCRT_VERSION reliably based on data from MSVCRT.DLL itself we can overcome some of the harrowing issues. The value I get on my XP SP3 is 710. The value I get on my Win7 laptop is 900. The values are (MajorLinkerVersion * 100) + MinorLinkerVersion where LinkerVersion refers to the version of MSVC that was used to create MSVCRT.DLL that exists on your system. -- Earnie -- https://sites.google.com/site/earnieboyd |
From: Eli Z. <el...@gn...> - 2013-05-18 08:06:55
|
> Date: Fri, 17 May 2013 17:25:00 -0400 > From: Earnie Boyd <ea...@us...> > > The issue I'm trying to overcome is the system on XP doesn't have some > functions and data structures in MSVCRT that Vista/Win7/Win8 etc have > such as the stat structure being defined in stat.h. It is quite > maddening. Can you tell the details, like what functions and data structures are involved? > The values are (MajorLinkerVersion * 100) + MinorLinkerVersion where > LinkerVersion refers to the version of MSVC that was used to create > MSVCRT.DLL that exists on your system. Beware: old versions of objdump don't show MajorLinkerVersion and MinorLinkerVersion, so your script should probably test the version of objdump as well, and fall back on 710 if the version is too old. My limited testing indicates that Binutils 2.17 didn't support that, while 2.22 does. So the cutoff version is somewhere in between. Anyway, I get 710 on XPSP3 and 900 on 2 different Windows 7 machines. (Note that on a 64-bit Windows 7, we are likely getting msvcrt.dll from syswow64, not from system32, assuming that objdump being used is a 32-bit executable.) |
From: Earnie B. <ea...@us...> - 2013-05-18 17:48:43
|
On Sat, May 18, 2013 at 4:06 AM, Eli Zaretskii wrote: >> Date: Fri, 17 May 2013 17:25:00 -0400 >> From: Earnie Boyd >> >> The issue I'm trying to overcome is the system on XP doesn't have some >> functions and data structures in MSVCRT that Vista/Win7/Win8 etc have >> such as the stat structure being defined in stat.h. It is quite >> maddening. > > Can you tell the details, like what functions and data structures are > involved? > The one I know off hand are the stat structures and depending on the MSVCRT whether or not certain data types such as 32bit time_t. >> The values are (MajorLinkerVersion * 100) + MinorLinkerVersion where >> LinkerVersion refers to the version of MSVC that was used to create >> MSVCRT.DLL that exists on your system. > > Beware: old versions of objdump don't show MajorLinkerVersion and > MinorLinkerVersion, so your script should probably test the version of > objdump as well, and fall back on 710 if the version is too old. My > limited testing indicates that Binutils 2.17 didn't support that, > while 2.22 does. So the cutoff version is somewhere in between. > Thanks for that bit of information. It sounds as if 710 would be a safe default. Those with less can define MSVCRT_VERSION before the configure script executes. > Anyway, I get 710 on XPSP3 and 900 on 2 different Windows 7 machines. > (Note that on a 64-bit Windows 7, we are likely getting msvcrt.dll > from syswow64, not from system32, assuming that objdump being used is > a 32-bit executable.) I just checked that and they are the same. Do you think times 100 is enough for the major version or should I go for 1000? -- Earnie -- https://sites.google.com/site/earnieboyd |
From: KHMan <kei...@gm...> - 2013-05-18 08:13:53
|
On 5/18/2013 5:25 AM, Earnie Boyd wrote: > I'm doing some research into determining at configure time what > version of MSVCRT.DLL is actually available on a system. I've created > a small shell script for you to run that is attached. What I need is > some input from you as to whether or not this method could be used to > create a m4 script for configure to use to set a MSVCRT_VERSION > variable in config.h. > > The issue I'm trying to overcome is the system on XP doesn't have some > functions and data structures in MSVCRT that Vista/Win7/Win8 etc have > such as the stat structure being defined in stat.h. It is quite > maddening. So if we can set MSVCRT_VERSION reliably based on data > from MSVCRT.DLL itself we can overcome some of the harrowing issues. > > The value I get on my XP SP3 is 710. The value I get on my Win7 laptop is 900. > > The values are (MajorLinkerVersion * 100) + MinorLinkerVersion where > LinkerVersion refers to the version of MSVC that was used to create > MSVCRT.DLL that exists on your system. Windows XP SP2: 710 Windows XP SP3: 710 Plus one abomination: Windows ME[1]: 600 [1] WinME on Virtual PC 2007 SP1, with KernelEx using rxvt (mintty failed), msvcrt.dll was in SYSTEM -- Cheers, Kein-Hong Man (esq.) Kuala Lumpur, Malaysia |
From: Earnie B. <ea...@us...> - 2013-05-18 17:49:42
|
Thanks for everyone's input. I think I have enough information. -- Earnie -- https://sites.google.com/site/earnieboyd |
From: Eli Z. <el...@gn...> - 2013-05-18 18:08:10
|
> Date: Sat, 18 May 2013 13:48:37 -0400 > From: Earnie Boyd <ea...@us...> > > Do you think times 100 is enough for the major version or should I > go for 1000? I think 100 is enough. We never saw the minor version that is more than 10. |
From: Earnie B. <ea...@us...> - 2013-05-19 15:51:02
|
On Sat, May 18, 2013 at 1:49 PM, Earnie Boyd wrote: > Thanks for everyone's input. I think I have enough information. > Actually I need someone to give me the value for Vista. ~~~~~ #!/bin/sh MSVCRT=`echo $WINDIR | sed -e 's.\\\\./.g'`/system32/msvcrt.dll MAJ=`objdump -x $MSVCRT | grep MajorLinkerVersion | awk '{print ($2 * 100)}'` MIN=`objdump -x $MSVCRT | grep MinorLinkerVersion | awk '{print $2}'` echo $MAJ' '$MIN | awk '{print $1 + $2}' ~~~~~ -- Earnie -- https://sites.google.com/site/earnieboyd |
From: Lee <le...@gm...> - 2013-05-19 16:18:28
|
On 5/19/13, Earnie Boyd <ea...@us...> wrote: > On Sat, May 18, 2013 at 1:49 PM, Earnie Boyd wrote: >> Thanks for everyone's input. I think I have enough information. >> > > Actually I need someone to give me the value for Vista. $MSVCRT=`echo $WINDIR | sed -e 's.\\\\./.g'`/system32/msvcrt.dll $MAJ=`objdump -x $MSVCRT | grep MajorLinkerVersion | awk '{print ($2 * 100)}'` $MIN=`objdump -x $MSVCRT | grep MinorLinkerVersion | awk '{print $2}'` $echo $MAJ' '$MIN | awk '{print $1 + $2}' 800 $uname -a MINGW32_NT-6.0 TWINKY 1.0.18(0.48/3/2) 2012-11-21 22:34 i686 Msys $ |
From: Earnie B. <ea...@us...> - 2013-05-19 20:01:54
|
On Sun, May 19, 2013 at 12:18 PM, Lee wrote: > On 5/19/13, Earnie Boyd <ea...@us...> wrote: >> On Sat, May 18, 2013 at 1:49 PM, Earnie Boyd wrote: >>> Thanks for everyone's input. I think I have enough information. >>> >> >> Actually I need someone to give me the value for Vista. > > $MSVCRT=`echo $WINDIR | sed -e 's.\\\\./.g'`/system32/msvcrt.dll > $MAJ=`objdump -x $MSVCRT | grep MajorLinkerVersion | awk '{print ($2 * 100)}'` > $MIN=`objdump -x $MSVCRT | grep MinorLinkerVersion | awk '{print $2}'` > $echo $MAJ' '$MIN | awk '{print $1 + $2}' > 800 Thanks for the information. That is what I thought it would be but wanted to be sure. -- Earnie -- https://sites.google.com/site/earnieboyd |