Closed Bug 945582 Opened 6 years ago Closed 6 years ago

jemalloc failed to build on stdbool.h: "error C2628: 'BOOL' followed by 'bool' is illegal"

Categories

(Firefox Build System :: General, defect)

x86_64
Windows 8.1
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla32

People

(Reporter: xavier114fch, Assigned: glandium)

References

()

Details

Attachments

(3 files, 5 obsolete files)

Using VS 2013 Ultimate and got this error.

0:34.76 e:\mozilla-inbound\memory\jemalloc\src\include\msvc_compat\stdbool.h(8) : error C2628: 'BOOL' followed by 'bool' is illegal (did you forget a ';'?)
 0:34.76 Warning: C4091 in e:\mozilla-inbound\memory\jemalloc\src\include\msvc_compat\stdbool.h: 'typedef ' : ignored on left of 'int' when no variable is declared
 0:34.76 e:\mozilla-inbound\memory\jemalloc\src\include\msvc_compat\stdbool.h(8) : warning C4091: 'typedef ' : ignored on left of 'int' when no variable is declared
 0:34.77 Warning: C4146 in e:\mozilla-inbound\obj\memory\jemalloc\src\include\jemalloc\internal\jemalloc_internal.h: unary minus operator applied to unsigned type, result still unsigned
 0:34.77 e:\mozilla-inbound\obj\memory\jemalloc\src\include\jemalloc/internal/jemalloc_internal.h(636) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
 0:34.77 Warning: C4146 in e:\mozilla-inbound\obj\memory\jemalloc\src\include\jemalloc\internal\jemalloc_internal.h: unary minus operator applied to unsigned type, result still unsigned
 0:34.77 e:\mozilla-inbound\obj\memory\jemalloc\src\include\jemalloc/internal/jemalloc_internal.h(817) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
 0:34.79 
 0:34.81 In the directory  /e/mozilla-inbound/obj/memory/jemalloc
 0:34.81 The following command failed to execute properly:
 0:34.81 e:/mozilla-inbound/obj/_virtualenv/Scripts/python.exe -m mozbuild.action.cl cl -Foatomic.obj -c -DDLLEXPORT -Dabort=moz_abort -DNO_NSPR_10_SUPPORT -Ie:/mozilla-inbound/memory/jemalloc -I. -Ie:/mozilla-inbound/memory/jemalloc/src/include -Isrc/include -Ie:/mozilla-inbound/memory/jemalloc/src/include/msvc_compat -I../../dist/include -Ie:/mozilla-inbound/obj/dist/include/nspr -Ie:/mozilla-inbound/obj/dist/include/nss -MDd -FI ../../dist/include/mozilla-config.h -DMOZILLA_CLIENT -TC -nologo -W3 -Gy -Fdgenerated.pdb -FS -Gw -wd4244 -wd4819 -we4553 -DNDEBUG -DTRIMMED -Zi -Od -UDEBUG -DNDEBUG -Oy- e:/mozilla-inbound/memory/jemalloc/src/src/atomic.c
 0:34.83 e:/mozilla-inbound/config/rules.mk:997: recipe for target 'atomic.obj' failed
 0:34.83 mozmake.EXE[5]: *** [atomic.obj] Error 1
Component: jemalloc → Build Config
Version: unspecified → Trunk
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch fix-stdbool.patch (obsolete) — Splinter Review
Proposed fix as mentioned from issue #76 of jemalloc git repo.
https://github.com/jemalloc/jemalloc/issues/76
That's an awfully wrong fix that would break building with MSVC2010. Can you attach the full output from mach configure?
mach configure output with the patch.
mach configure output without the patch.
Can you try this instead?
Assignee: nobody → mh+mozilla
Status: NEW → ASSIGNED
Still got the same error with the latest patch.

 1:41.26 e:/mozilla-inbound/memory/jemalloc/src/include/msvc_compat\stdbool.h(9)
 : error C2628: 'BOOL' followed by 'bool' is illegal (did you forget a ';'?)
 1:41.26 Warning: C4091 in e:\mozilla-inbound\memory\jemalloc\src\include\msvc_compat\stdbool.h: 'typedef ' : ignored on left of 'int' when no variable is declared
New attempt.
Attachment #8429727 - Attachment is obsolete: true
Still producing the same error.

14:48.94 atomic.c
14:49.04 e:/mozilla-inbound/memory/jemalloc/src/include/msvc_compat\stdbool.h(9)
 : error C2628: 'BOOL' followed by 'bool' is illegal (did you forget a ';'?)
14:49.15 Warning: C4091 in e:\mozilla-inbound\memory\jemalloc\src\include\msvc_c
ompat\stdbool.h: 'typedef ' : ignored on left of 'int' when no variable is decla
red
14:49.23 e:/mozilla-inbound/memory/jemalloc/src/include/msvc_compat\stdbool.h(9)
 : warning C4091: 'typedef ' : ignored on left of 'int' when no variable is decl
ared
14:49.27 src/include\jemalloc/internal/jemalloc_internal.h(636) : warning C4146:
 unary minus operator applied to unsigned type, result still unsigned
14:49.30 src/include\jemalloc/internal/jemalloc_internal.h(821) : warning C4146:
 unary minus operator applied to unsigned type, result still unsigned
14:49.34
14:49.39 In the directory  /e/mozilla-inbound/obj/memory/jemalloc
14:49.42 The following command failed to execute properly:
14:49.44 e:/mozilla-inbound/obj/_virtualenv/Scripts/python.exe -m mozbuild.actio
n.cl cl -Foatomic.obj -c -DDLLEXPORT -Dabort=moz_abort -DNO_NSPR_10_SUPPORT -Ie:
/mozilla-inbound/memory/jemalloc -I. -Ie:/mozilla-inbound/memory/jemalloc/src/in
clude/msvc_compat -Ie:/mozilla-inbound/memory/jemalloc/src/include -Isrc/include
 -I../../dist/include -Ie:/mozilla-inbound/obj/dist/include/nspr -Ie:/mozilla-in
bound/obj/dist/include/nss -I/e/mozilla-inbound/obj/dist/include -I/e/mozilla-in
bound/modules/zlib/src -MD -FI ../../dist/include/mozilla-config.h -DMOZILLA_CLI
ENT -TC -nologo -W3 -Gy -FS -Gw -wd4244 -wd4819 -we4553 -DNDEBUG -DTRIMMED -O2 -
Ot -Oi -Ob2 -GT -Gy -GF -Gw -FS -arch:SSE2 -Oy- -Fdgenerated.pdb e:/mozilla-inbo
und/memory/jemalloc/src/src/atomic.c
14:49.64 e:/mozilla-inbound/config/rules.mk:969: recipe for target 'atomic.obj'
failed
14:49.82 mozmake.EXE[5]: *** [atomic.obj] Error 1
I'm starting to see this now on my local VS2013 builds. I didn't get this error before. Did something change in our use of jemalloc?
Blocks: VC12
(In reply to David Major [:dmajor] (UTC+12) from comment #9)
> I'm starting to see this now on my local VS2013 builds. I didn't get this
> error before. Did something change in our use of jemalloc?

before,jemalloc is not built by default.
(In reply to zhoubcfan from comment #10)
> (In reply to David Major [:dmajor] (UTC+12) from comment #9)
> > I'm starting to see this now on my local VS2013 builds. I didn't get this
> > error before. Did something change in our use of jemalloc?
> 
> before,jemalloc is not built by default.

I have --enable-jemalloc in my mozconfig for months and this error came up (again) a few days ago.
Specifically, jemalloc3 was not built by default before, it is now. (Although it's not directly used)

You can work around the problem with --disable-replace-malloc, but I'd like to find a working fix.
Attachment #8429779 - Attachment is obsolete: true
How about this? This patch worked for me.
Attachment #8430640 - Flags: feedback?(xavier114fch)
Comment on attachment 8430640 [details] [diff] [review]
Use built-in _Bool for MSVC 2013 or later

Ah, mid-aired.
Attachment #8430640 - Flags: feedback?(xavier114fch)
Attachment #8430640 - Attachment is obsolete: true
I can confirm that the new patch fixes the issue.
Attachment #8429100 - Attachment is obsolete: true
Attachment #8430615 - Attachment is obsolete: true
Attachment #8431174 - Flags: review?(mshal) → review+
Comment on attachment 8431174 [details] [diff] [review]
Don't use jemalloc3 C99 headers with MSVC versions that have (some) C99 support

This fixes by VS2013-based build for me too.
Attachment #8431174 - Flags: feedback+
https://hg.mozilla.org/mozilla-central/rev/16c8da443faa
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Blocks: winclang
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.