Closed Bug 530093 Opened 11 years ago Closed 11 years ago

allow building with VC10 (VC 2010)


(Firefox Build System :: General, defect)

Windows XP
Not set


(Not tracked)



(Reporter: ted, Assigned: ted)




(2 files)

Visual C++ 2010 is in public beta, so we should make sure that everything compiles with it. Needs some simple configure changes, and maybe a few other things.
I already added a start-msvc10.bat to the mozilla-build repo:
Separate bug for jemalloc support?
Not sure, I'll see if I get around to it. If I --disable-activex the build completes with just two patches, I'll attach them shortly. The ActiveX bits will need more work, they're full of junk like this:

Which the headers that come with VC10 refuse to accept. (They want _WIN32_WINNT to be at least 0x401.)
VC10 complains about the usage of the bitset(0) constructor, saying it's ambiguous between bitset(char*) and bitset(int). The Microsoft docs (as well as other STL docs online) say that the empty bitset constructor initializes all bits to zero, so this should be functionally equivalent.
Attachment #413815 - Flags: review?(jdaggett)
The configure changes are straightforward. The build/win32 changes are mostly straightforward, but I also unwrapped a shell loop into a $(foreach) while there.

VC10 dropped support for -OPT:NOWIN98 as a linker option, so I've just unilaterally dropped it from From reading the docs it doesn't sound like it has ever done anything useful for us anyway.
Attachment #413862 - Flags: review?(benjamin)
Attachment #413862 - Flags: review?(benjamin) → review+
Attachment #413815 - Flags: review?(jdaggett) → review+
Could I also talk you into making the appropriate change at:
so that trace-malloc works?
Looks easy, I'll get that in a followup. (I still want to fix the ActiveX stuff too, and maybe jemalloc.)
> +            CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
I'm going to remove this. (see bug 508905.) Could you omit this from settings for new compilers?
Pushed those two patches to trunk:

Masatoshi: oops, I didn't remove that. Sorry! Feel free to remove it with r=me.
Depends on: 130372
(In reply to comment #5)
> VC10 dropped support for -OPT:NOWIN98 as a linker option, so I've just
> unilaterally dropped it from From reading the docs it doesn't sound
> like it has ever done anything useful for us anyway.

Is the latter confirmed?
From bug 130372 comment 33, I would say it doesn't hurt to keep it for non-VC10 builds.

Then, why not update the other occurrences too?
I don't care to support it, so it's gone. I didn't bother removing it from that other location probably because I just didn't notice it. Should probably remove that one too.
Attachment #413815 - Attachment description: fix std::bitset constructor usage in gfx → fix std::bitset constructor usage in gfx [Checkin: Comment 9]
Attachment #413862 - Attachment description: build system changes → build system changes [Checkin: Comment 9]
bug 559537 got filed on the ActiveX stuff in the meantime, so let's call this fixed enough.

Should still fix comment 6, and file a followup for jemalloc support.
Closed: 11 years ago
Resolution: --- → FIXED
comment 6 got spun off to bug 560969.
Filed bug 563316 about jemalloc support.
Ted Mielczarek [:ted, :luser]:

I did not try, but I guess the line 3 of the start-msvc10-x64.bat file is probably not right:

Should'n it be
Yes, Mitch pointed that out and I fixed it:

(I don't think that value is actually used anywhere anyway.)
Blocks: 585227
Bug 585227 has been filed (not by me) for mozilla-1.9.2, mozilla-1.9.1 support.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.