Re: MSVC is broken for x86 builds on x64 hosts

Gary Oberbrunner <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAFChFyjn_qOFpSL3TrUNDLk-+WBsQ=B3bE_1NzpH4Vh39w9uVw@mail.gmail.com>
I'm guessing the link is running in a different Environment somehow. Can
you show the full SConstruct/SConscript?

-- Gary

On Wed, May 22, 2019 at 12:15 PM Mats Wichmann <[email protected]> wrote:

> On 5/22/19 9:26 AM, Michael Hartmann wrote:
> > Actually it’s even worse:
> >
> >
> >
> > While the correct cl.exe is used for compilation, the INCLUDE and LIB
> > paths are set for a VS 2017 runtime.
> >
> >
> >
> > *Von:* Scons-users <[email protected]> *Im Auftrag von
> > *Michael Hartmann
> > *Gesendet:* Mittwoch, 22. Mai 2019 16:34
> > *An:* SCons users mailing list <[email protected]>
> > *Betreff:* Re: [Scons-users] MSVC is broken for x86 builds on x64 hosts
> >
> >
> >
> > There still is an issue that is preventing me from building my target
> > with Visual Studio 9.0 Express. The SConstruct looks kind of like this:
> >
> >
> >
> > some_environment = Environment(
> >
> >     LINKFLAGS = '/MANIFEST /INCREMENTAL:NO /DEBUG',
> >
> >     CFLAGS = '/Od /MD /EHsc /MP /Zi /Zl /Zp8',
> >
> >     MSVC_VERSION = '9.0Exp',
> >
> >     MSVC_BATCH = True,
> >
> >     HOST_ARCH = 'x86',
> >
> >     TARGET_ARCH = 'x86'
> >
> > )
> >
> >
> >
> > some_environment.SharedLibrary('output.dll', ["test1.c", "test2.c"])
> >
> >
> >
> > The sources are compiled using the correct cl.exe. After the compile
> > step and before the link step the environment gets reset, so the wrong
> > linker is invoked and the wrong standard library is linked (Both from
> > Visual Studio 2017 for amd64).
>
> So it looks like things are fine through line 152, with scons doing the
> compilation to objects just after saying:
>
> vc.py:msvc_setup_env() env:LIBPATH -> ['C:\\Program Files
> (x86)\\Microsoft Visual Studio 9.0\\VC\\LIB']
>
> and then it goes wrong when the mslink tool initializes, as it says:
>
> msvc_setup_env_once CALLED FROM mslink.py
> msvc_setup_env()
> get_default_version()
> get_default_version(): msvc_version:None msvs_version:None
> installed_vcs:['14.1', '14.0', '12.0', '12.0Exp', '10.0', '10.0Exp',
> '9.0Exp']
> msvc_setup_env: using default installed MSVC version '14.1'
>
>
> It shouldn't be doing what it's doing, the earlier calls to
> msvc_setup_env_once should have caused MSVC_SETUP_RUN to be set in the
> environment, and so the function should just return, not go on and call
> msvc_setup_env and come up with new answers. So presumably it must be
> using a new environment?
>
> What a mess that stuff all is.  I can't figure why the mslink tool is
> being initialized a second time, as it already ran to do the first batch
> of setup, the time it knew about MSVC_VERSION - line 86 of your paste.
>
> Needs one of the wizards to explain, I guess.
> _______________________________________________
> Scons-users mailing list
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>


-- 
Gary

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.