Full VCExpress2008 patch and Notes

41 views
Skip to first unread message

Ryan Norton

unread,
Mar 15, 2011, 11:43:44 AM3/15/11
to Chromium-dev
Here's a relatively clean patch done against trunk (v12) rev78148 with
a couple additional steps for VCExpress2008 (and likely 2010 as well),
though I know it's not exactly a priority:
http://pastebin.com/2w4WmHxs

I'd create code reviews, but it makes small related changes across ~10
different repositories, and it would probably just create confusion.

With this you can build "right out of the box" similar to the full
versions. Here's a list of the changes (the patch is relatively :
1) Header order changes in 3 files to pull in the ATL headers to pull
in intsafe.h to avoid multiple INTXX_MIN/MAX def warnings which get
flagged as errors with the warnings as errors flag. May just be a fix
to deal with the newer WinSDKs in general; intsafe.h doesn't wrap it's
INTXX_MIN/MAX defs around ifndefs - note that windows.h _doesn't_ pull
intsafe.h in, the atl headers do, though intsafe.h is part of the base
WinSDK.
2) Wrap Native Client's port_win.h's version of the INTXX_MIN/MAX
around ifndefs to avoid conflicts with intsafe.h (probably should be
there in the first place since it's a third party lib).
3) Changes to .rc files to avoid pulling in afxres.h (an MFC header -
it's available in the WinDDK) and winres.h which VCExpress doesn't
have (it's available in a WinSDK sample, but that kind of the purpose
of it). The main Chromium .rc files are already structured this way, I
just changed the rest and changed the output of grit to do the same.
4) A bit of tidying of the MSVC library linking conditional in
mini_installer, and add a compiler #define flag if MSVC is in the
environment variables along with a corresponding change to
mini_installer.cc implement just memset for express versions to avoid
to pulling in the stdc libs and keep the size optimizations.
- NOTE: The header include changing may case lint errors. If you
_REALLY_ don't want those you can put
// pull in atl headers now to avoid preprocessor conflicts
// with WinSDK intsafe.h - INTXX_MAX et al.
#if defined(_WIN32) || defined(_WIN64)
#include <atlbase.h>
#include <atlwin.h>
#endif
in the respective places in the files, as OS_WIN may not be available
due to lint.
-----------------
The base developer instructions work fine afterwards with a couple
tweaks for express versions:
http://www.chromium.org/developers/how-tos/build-instructions-windows

Under "Additional (free) downloads" under step 2:
X) Note that some (Non-SP) KB Patches will not inform you that they do
not apply if you use the express version of Microsoft Visual Studio
2008, don't worry about this [likely already included in the original
express download].

Under "Additional (free) downloads" after step 5:
6A) Download the WinDDK for the atl headers and libs -
http://msdn.microsoft.com/en-us/windows/hardware/gg487463.aspx. It
works fine, but you do not need to install the whole DDK. In the WDK
directory just install headers.msi, libs_x86fre.msi, and
libs_x64fre.msi; just grab the atl headers and atl*.lib libs, right
click the installers and uninstall afterwards. Add the include and lib
paths to your global settings (amd64 in the lib directory for x64
native client).
6B) To build x64 targets (Native Client basically) download:
http://www.cppblog.com/Files/xcpp/VCE64BIT_WIN7SDK.zip

Follow the readme instructions.
Further information behind that and x64 target building with express:
- http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/
- http://www.cppblog.com/xcpp/archive/2009/09/09/vc2008express_64bit_win7sdk.html
----------------
After that it works just fine, and pretty easy for new devs.

Sort of a followup to: http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/c31deb5bf8355870

Don't worry, should be my last thread about this, since it's "solved"
in my opinion.

Mark Seaborn

unread,
Mar 15, 2011, 12:09:57 PM3/15/11
to rnor...@gmail.com, Chromium-dev
On 15 March 2011 08:43, Ryan Norton <rnor...@gmail.com> wrote:
Here's a relatively clean patch done against trunk (v12) rev78148 with
a couple additional steps for VCExpress2008 (and likely 2010 as well),
though I know it's not exactly a priority:
http://pastebin.com/2w4WmHxs

I'd create code reviews, but it makes small related changes across ~10
different repositories, and it would probably just create confusion.

With this you can build "right out of the box" similar to the full
versions. Here's a list of the changes (the patch is relatively :
1) Header order changes in 3 files to pull in the ATL headers to pull
in intsafe.h to avoid multiple INTXX_MIN/MAX def warnings which get
flagged as errors with the warnings as errors flag. May just be a fix
to deal with the newer WinSDKs in general; intsafe.h doesn't wrap it's
INTXX_MIN/MAX defs around ifndefs - note that windows.h _doesn't_ pull
intsafe.h in, the atl headers do, though intsafe.h is part of the base
WinSDK.
2) Wrap Native Client's port_win.h's version of the INTXX_MIN/MAX
around ifndefs to avoid conflicts with intsafe.h (probably should be
there in the first place since it's a third party lib).

Native Client should currently build against Visual Studio Express 2010 and the current Windows SDK (also based on MSVC 2010, I think).  (At least, the standalone NaCl build works but there's a chance that something is different inside the Chromium build.)

I'm not familiar with intsafe.h but NaCl and Chromium don't seem to use it directly.  Do you think this is something that has changed between VCExpress 2008 and 2010?

Cheers,
Mark

Paweł Hajdan, Jr.

unread,
Mar 15, 2011, 12:40:43 PM3/15/11
to rnor...@gmail.com, Chromium-dev
On Tue, Mar 15, 2011 at 16:43, Ryan Norton <rnor...@gmail.com> wrote:
Here's a relatively clean patch done against trunk (v12) rev78148 with
a couple additional steps for VCExpress2008 (and likely 2010 as well),
though I know it's not exactly a priority:
http://pastebin.com/2w4WmHxs

I'd create code reviews, but it makes small related changes across ~10
different repositories, and it would probably just create confusion.

No, why? It seems like that would be at most 5 repos, and I'm sure the reviewers can handle that (just submit one patch per repo + finally roll the DEPS). Let me know if you'd like me to explain more, but generally in my opinion if we can get this committed, let's do that.

Ryan Norton

unread,
Mar 15, 2011, 12:47:36 PM3/15/11
to Chromium-dev
I don't recall exactly - Native Client by itself probably built fine,
it may just be due to other chromium files that pull in port_win.h in
some fashion from native client - if it gets pulled in after the ICU
headers or any order with intsafe.h/atl you'll get the multiple
definition warnings/errors without this patch.

As for intsafe.h, that may be a change with the atl headers -
specifically whatever atlwin.h pulls in - in the 7.1 DDK (latest and
only one available currently AFAIK).

On Mar 15, 9:09 am, Mark Seaborn <mseab...@chromium.org> wrote:

Peter Kasting

unread,
Mar 15, 2011, 2:34:15 PM3/15/11
to rnor...@gmail.com, Chromium-dev
What Pawel said.  Go ahead and create code reviews.  It's OK if changes like this land piecemeal and we're certainly not opposed to making VCExpress 2008 build.

(I haven't looked at your actual patch so I can't say whether it is correct as-is.  Descriptions of changing #include order worry me, maybe it makes sense to use #undef instead for your problems.)

PK

Ryan Norton

unread,
Mar 23, 2011, 6:26:18 PM3/23/11
to Chromium-dev
Thanks for the push. WAY behind the times, but as a result of
http://codereview.chromium.org/6676030/ trunk should compile on both
VC2005 express and VC2008 express without any system header hacks and
related. Wanted to say the code review was an exhausting but great
experience. Anyway, time for details-

GYP NOTE: GYP doesn't autodetect express versions quite correctly yet
- there's a patch (http://codereview.chromium.org/6729005/) for that
too that may land some day in the future. So you'll need to make sure
you set your GYP_MSVS_VERSION environment variable to 2005e or 2008e
as desired.

WHERE:
VC2005SP1 can be downloaded at
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=7B0B0339-613A-46E6-AB4D-080D4D4A8C4E&displaylang=en
(or non-SP1 at http://download.microsoft.com/download/8/3/a/83aad8f9-38ba-4503-b3cd-ba28c360c27b/ENU/vcsetup.exe)

VC2008SP1 can be downloaded at
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F3FBB04E-92C2-4701-B4BA-92E26E408569&displaylang=en
currently.

DOCS:
The base developer instructions work fine afterwards with a couple
tweaks for express versions:
http://www.chromium.org/developers/how-tos/build-instructions-windows

Under "Additional (free) downloads" under step 2:
X) Only the first 3 Non-SP KB Patches are needed for VC2008 express
SP1.

Under "Additional (free) downloads" after step 5:
6A) Download the WinDDK for the atl headers and libs -
http://msdn.microsoft.com/en-us/windows/hardware/gg487463.aspx. It
works fine, but you do not need to install the whole DDK. In the WDK
directory just install headers.msi, libs_x86fre.msi, and
libs_x64fre.msi; just grab the atl headers and atl*.lib libs; right
click the installers and uninstall afterwards. Add the appropriate
include and lib paths to your global settings.
6B) To build x64 targets (x64 Native Client) on VC2008 express
On Mar 15, 11:34 am, Peter Kasting <pkast...@chromium.org> wrote:
> On Tue, Mar 15, 2011 at 9:40 AM, Paweł Hajdan, Jr.
> <phajdan...@chromium.org>wrote:

Peter Kasting

unread,
Mar 24, 2011, 3:32:09 PM3/24/11
to rnor...@gmail.com, Chromium-dev
On Wed, Mar 23, 2011 at 3:26 PM, Ryan Norton <rnor...@gmail.com> wrote:
Thanks for the push. WAY behind the times, but as a result of
http://codereview.chromium.org/6676030/ trunk should compile on both
VC2005 express and VC2008 express without any system header hacks and
related.

Awesome!

I tried to update the build instructions with your comments.  Please check that they're right.  Questions below.

Under "Additional (free) downloads" under step 2:
X) Only the first 3 Non-SP KB Patches are needed for VC2008 express
SP1.

Is KB958842 needed?  I marked it as needed for now.

In the WDK
directory just install headers.msi, libs_x86fre.msi, and
libs_x64fre.msi; just grab the atl headers and atl*.lib libs; right
click the installers and uninstall afterwards. Add the appropriate
include and lib paths to your global settings.

This is kind of vague.  By "grab" I assume you mean "copy to some include and lib directories somewhere" but I don't know where.  Detail?
 
6B) To build x64 targets (x64 Native Client) on VC2008 express

What about 2005 Express?

PK

John Abd-El-Malek

unread,
Mar 24, 2011, 4:01:16 PM3/24/11
to rnor...@gmail.com, Chromium-dev
I'll just second what Peter and Pawel said, thanks a lot for doing this.  It's very nice to for contributors to be able to build Chrome on Windows with free tools.  Feel free to send me reviews in the future for this.

--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Ryan Norton

unread,
Mar 24, 2011, 8:37:37 PM3/24/11
to Chromium-dev


On Mar 24, 12:32 pm, Peter Kasting <pkast...@chromium.org> wrote:
> I tried to update the build instructions with your comments.  Please check
> that they're right.  Questions below.
>
> Under "Additional (free) downloads" under step 2:
>
> > X) Only the first 3 Non-SP KB Patches are needed for VC2008 express
> > SP1.
>
> Is KB958842 needed?  I marked it as needed for now.

Nope - that's for the normal version actually. Just the first 3 - and
by needed I mean the rest literally won't even install.

Background: Microsoft decided that with VC2008 express and up hotfixes
for the normal version would generally not be allowed and they would
update the base distribution (i.e. initial download) instead.

> > directory just install headers.msi, libs_x86fre.msi, and
> > libs_x64fre.msi; just grab the atl headers and atl*.lib libs; right
> > click the installers and uninstall afterwards. Add the appropriate
> > include and lib paths to your global settings.
>
> This is kind of vague.  By "grab" I assume you mean "copy to some include
> and lib directories somewhere" but I don't know where.  Detail?

Yeah, just copy the include/lib directories someplace and put the
patch to them in your settings. However, since the instructions say to
install the full Windows SDK anyway, may as well leave that part out
and just mention to make sure the ATL include/lib directories are
correct.

> > 6B) To build x64 targets (x64 Native Client) on VC2008 express
>
> What about 2005 Express?

Just VC2008. Sort of implied about with the "Detail" note, but VC2005
express functions identically to the normal version in regards to bugs
and patches, so if VC2005 express is the only MSVC version on your
system when you install the WinSDK it'll put in the 64-bit compilers
normally.

Thanks for updating the docs!

Peter Kasting

unread,
Mar 24, 2011, 8:47:52 PM3/24/11
to rnor...@gmail.com, Chromium-dev
On Thu, Mar 24, 2011 at 5:37 PM, Ryan Norton <rnor...@gmail.com> wrote:
On Mar 24, 12:32 pm, Peter Kasting <pkast...@chromium.org> wrote:
> Is KB958842 needed?  I marked it as needed for now.

Nope - that's for the normal version actually. Just the first 3 - and
by needed I mean the rest literally won't even install.

Fixed.

Background: Microsoft decided that with VC2008 express and up hotfixes
for the normal version would generally not be allowed and they would
update the base distribution (i.e. initial download) instead.

I assume the 3 hotfixes listed first are ones they made exceptions for.

Yeah, just copy the include/lib directories someplace and put the
patch to them in your settings. However, since the instructions say to
install the full Windows SDK anyway, may as well leave that part out
and just mention to make sure the ATL include/lib directories are
correct.

I'm not totally clear on what the instructions should say here.  After you install the three WDK MSIs, precisely what should you do?  Copy some files somewhere and uninstall the MSIs?  Just do nothing, you're done?  Something else?

> > 6B) To build x64 targets (x64 Native Client) on VC2008 express
>
> What about 2005 Express?

Just VC2008.

OK.

PK 

Ryan Norton

unread,
Mar 24, 2011, 8:52:01 PM3/24/11
to Chromium-dev
Quick 2010 express note: I tried this as well, but obviously trunk
still doesn't support 2010 in general quite yet. Pretty much
everything compiled fine with a quick conditional to not define
'_HAS_TR1=0' in common.gypi for 2010. It was just the build events
that were generally broken (pre-build event with cygwin commands etc.).

Ryan Norton

unread,
Mar 27, 2011, 12:01:07 PM3/27/11
to Chromium-dev


On Mar 24, 5:47 pm, Peter Kasting <pkast...@chromium.org> wrote:
> Yeah, just copy the include/lib directories someplace and put the
>
> > patch to them in your settings. However, since the instructions say to
> > install the full Windows SDK anyway, may as well leave that part out
> > and just mention to make sure the ATL include/lib directories are
> > correct.
>
> I'm not totally clear on what the instructions should say here.  After you
> install the three WDK MSIs, precisely what should you do?  Copy some files
> somewhere and uninstall the MSIs?  Just do nothing, you're done?  Something
> else?

I mean it's probably better to just say to install the WDK normally
officially, then afterwards make sure the atl include/lib directories
are setup correctly - i.e.
1) [WinDDK]\include\atl71 for includes.
2) [WinDDK]\lib\Atl\i386 for 32-bit targets and [WinDDK]\lib\Atl\amd64
for 64-bit targets for libraries.
With the current linked WinDDK anyway.

Nit: "If you are not using Visual Studio 2008 Express, install
KB971092. Yes, that's a 365 MB update. :/" - I mentioned earlier, but
this is actually an update/security fix related to the "full
version's" built-in/bundled ATL and won't install on express.

Otherwise looks good, thanks again.

Peter Kasting

unread,
Mar 27, 2011, 3:08:12 PM3/27/11
to rnor...@gmail.com, Chromium-dev
On Sun, Mar 27, 2011 at 9:01 AM, Ryan Norton <rnor...@gmail.com> wrote:
I mean it's probably better to just say to install the WDK normally
officially, then afterwards make sure the atl include/lib directories
are setup correctly - i.e.
1) [WinDDK]\include\atl71 for includes.
2) [WinDDK]\lib\Atl\i386 for 32-bit targets and [WinDDK]\lib\Atl\amd64
for 64-bit targets for libraries.
With the current linked WinDDK anyway.

I changed it to just say to install the WDK.  Do people really need to check paths?  Shouldn't they be set up correctly by the install process?  If they need to check them I'm not even sure where to look.
 
Nit: "If you are not using Visual Studio 2008 Express, install
KB971092. Yes, that's a 365 MB update. :/" - I mentioned earlier, but
this is actually an update/security fix related to the "full
version's" built-in/bundled ATL and won't install on express.

I'm not sure what you want changed here.  The item already says not to install on VC2008 Express.

PK

Ryan Norton

unread,
Mar 27, 2011, 6:18:32 PM3/27/11
to Chromium-dev


On Mar 27, 12:08 pm, Peter Kasting <pkast...@chromium.org> wrote:
> On Sun, Mar 27, 2011 at 9:01 AM, Ryan Norton <rnorto...@gmail.com> wrote:
> > I mean it's probably better to just say to install the WDK normally
> > officially, then afterwards make sure the atl include/lib directories
> > are setup correctly - i.e.
> > 1) [WinDDK]\include\atl71 for includes.
> > 2) [WinDDK]\lib\Atl\i386 for 32-bit targets and [WinDDK]\lib\Atl\amd64
> > for 64-bit targets for libraries.
> > With the current linked WinDDK anyway.
>
> I changed it to just say to install the WDK.  Do people really need to check
> paths?  Shouldn't they be set up correctly by the install process?  If they
> need to check them I'm not even sure where to look.

Yeah, they should be set up by the WDK, but like the Windows SDK it
sometimes doesn't set it up correctly. They'll be in the WinDDK
installation path. Whats written there already should probably be
enough, but if it becomes a problem could always add a line similar to
the DirectX SDK - "Verify MSVC|Tools|Options|Projects and Solutions|VC+
+ Directories has Include: [WinDDK]\include\atl71 and Lib: [WinDDK]\lib
\Atl\i386". Again, probably fine for now.

>
> > Nit: "If you are not using Visual Studio 2008 Express, install
> > KB971092. Yes, that's a 365 MB update. :/" - I mentioned earlier, but
> > this is actually an update/security fix related to the "full
> > version's" built-in/bundled ATL and won't install on express.
>
> I'm not sure what you want changed here.  The item already says not to
> install on VC2008 Express.

Whoops, I'm sorry - completely misread that; thanks.

That only leaves one last thing then - the line under that says "If
you are not using Visual Studio 2008 Pro, install KB958842." - doesn't
apply to express.

Thanks for the responses and hanging in there!

Marc-Antoine Ruel

unread,
Mar 27, 2011, 7:32:41 PM3/27/11
to rnor...@gmail.com, Chromium-dev
Le 27 mars 2011 18:18, Ryan Norton <rnor...@gmail.com> a écrit :
That only leaves one last thing then - the line under that says "If
you are not using Visual Studio 2008 Pro, install KB958842." - doesn't
apply to express.

Done.

Peter Kasting

unread,
Mar 28, 2011, 2:16:39 PM3/28/11
to rnor...@gmail.com, Chromium-dev
On Sun, Mar 27, 2011 at 3:18 PM, Ryan Norton <rnor...@gmail.com> wrote:
On Mar 27, 12:08 pm, Peter Kasting <pkast...@chromium.org> wrote:
> On Sun, Mar 27, 2011 at 9:01 AM, Ryan Norton <rnorto...@gmail.com> wrote:
> > I mean it's probably better to just say to install the WDK normally
> > officially, then afterwards make sure the atl include/lib directories
> > are setup correctly - i.e.
> > 1) [WinDDK]\include\atl71 for includes.
> > 2) [WinDDK]\lib\Atl\i386 for 32-bit targets and [WinDDK]\lib\Atl\amd64
> > for 64-bit targets for libraries.
> > With the current linked WinDDK anyway.
>
> I changed it to just say to install the WDK.  Do people really need to check
> paths?  Shouldn't they be set up correctly by the install process?  If they
> need to check them I'm not even sure where to look.

Yeah, they should be set up by the WDK, but like the Windows SDK it
sometimes doesn't set it up correctly. They'll be in the WinDDK
installation path. Whats written there already should probably be
enough, but if it becomes a problem could always add a line similar to
the DirectX SDK - "Verify MSVC|Tools|Options|Projects and Solutions|VC+
+ Directories has Include: [WinDDK]\include\atl71 and Lib: [WinDDK]\lib
\Atl\i386". Again, probably fine for now.

Changed.

PK 
Reply all
Reply to author
Forward
0 new messages