Build error on Windows 10: C2371: 'BOOLEAN': redefinition; different basic types

806 views
Skip to first unread message

Mihai Sardarescu

unread,
Oct 17, 2017, 9:58:46 AM10/17/17
to Chromium-dev, Bruce Dawson, bra...@opera.com
Hi,

This happened yesterday and then again today - when I build Chrome from command line and from VS 2017, I hit the following error:

C:\src\chromium\src>ninja -C out\Debug_2017 chrome
ninja: Entering directory `out\Debug_2017'
[106/572] CXX obj/third_party/WebKit/Source/platform/platform/platform_jumbo_6.obj
FAILED: obj/third_party/WebKit/Source/platform/platform/platform_jumbo_6.obj
ninja -t msvc -e environment.x86 -- "c:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\a9e1098bba66d2acccc377d5ee81265910f29272\vc\tools\msvc\14.11.25503\bin\hostx64\x86/cl.exe" /nologo /showIncludes  @obj/third_party/WebKit/Source/platform/platform/platform_jumbo_6.obj.rsp /c gen/third_party/WebKit/Source/platform/platform_jumbo_6.cc /Foobj/third_party/WebKit/Source/platform/platform/platform_jumbo_6.obj /Fd"obj/third_party/WebKit/Source/platform/platform_cc.pdb"
c:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\a9e1098bba66d2acccc377d5ee81265910f29272\win_sdk\bin\..\..\win_sdk\include\10.0.15063.0\shared\rpcndr.h(193): error C2371: 'boolean': redefinition; different basic types
c:\src\chromium\src\third_party\libjpeg_turbo\jmorecfg.h(242): note: see declaration of 'boolean'
c:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\a9e1098bba66d2acccc377d5ee81265910f29272\win_sdk\bin\..\..\win_sdk\include\10.0.15063.0\shared\wtypesbase.h(501): error C2371: 'BOOLEAN': redefinition; different basic types
c:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\a9e1098bba66d2acccc377d5ee81265910f29272\win_sdk\bin\..\..\win_sdk\include\10.0.15063.0\um\winnt.h(1102): note: see declaration of 'BOOLEAN'
[139/572] CXX obj/chrome/browser/ui/ui_1/browser.obj
ninja: build stopped: subcommand failed.

Is this something related to the JUMBO builds?

Thank you,
- Mihai 

Nico Weber

unread,
Oct 17, 2017, 12:17:29 PM10/17/17
to msa...@chromium.org, Chromium-dev, Bruce Dawson, Daniel Bratell
Does it repro in a non-jumbo build? Looks like the kind of thing that can happen in jumbo builds at least.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/99da100c-5bfe-4bf4-87a0-aeff1c1b921d%40chromium.org.

Nico Weber

unread,
Oct 17, 2017, 12:24:46 PM10/17/17
to msa...@chromium.org, Chromium-dev, Bruce Dawson, Daniel Bratell
The jumbo FYI bot is failing with the same error: https://build.chromium.org/p/chromium.fyi/builders/Jumbo%20Win%20x64/builds/1903

So yes, this is due to you using a jumbo build.

Bruce Dawson

unread,
Oct 17, 2017, 3:40:17 PM10/17/17
to Nico Weber, msa...@chromium.org, Chromium-dev, Daniel Bratell
The jumbo builds are now failing with a new error:

FAILED: obj/third_party/WebKit/Source/controller/webkit_unit_tests_sources/webkit_unit_tests_sources_jumbo_1.obj 
ninja -t msvc -e environment.x64 -- E:\b\c\goma_client/gomacc.exe "e:\b\c\win_toolchain\vs_files\a9e1098bba66d2acccc377d5ee81265910f29272\vc\tools\msvc\14.11.25503\bin\hostx64\x64/cl.exe" /nologo /showIncludes  @obj/third_party/WebKit/Source/controller/webkit_unit_tests_sources/webkit_unit_tests_sources_jumbo_1.obj.rsp /c gen/third_party/WebKit/Source/controller/tests/webkit_unit_tests_sources_jumbo_1.cc /Foobj/third_party/WebKit/Source/controller/webkit_unit_tests_sources/webkit_unit_tests_sources_jumbo_1.obj /Fd"obj/third_party/WebKit/Source/controller/webkit_unit_tests_sources_cc.pdb"
../../third_party/WebKit/Source\core/testing/Internals.h(408): error C2872: 'DictionaryTest': ambiguous symbol
../../third_party/WebKit/Source\core/testing/Internals.h(53): note: could be 'blink::DictionaryTest'
e:\b\c\builder\jumbo_win_x64\src\out\release_x64\gen\third_party\webkit\source\controller\tests\../../../../../../../../third_party/WebKit/Source/bindings/core/v8/DictionaryTest.cpp(18): note: or       'blink::`anonymous-namespace'::DictionaryTest'

I'll fix that one. I don't know if somebody fixed the boolean/BOOLEAN errors or if they are hidden or if they "went away" on their own.

Daniel Bratell

unread,
Oct 17, 2017, 5:57:06 PM10/17/17
to Chromium-dev, Mihai Sardarescu, Bruce Dawson
I imagine this is triggered by jumbo. It looks like jpeg_turbo/jmorecfg.h and windows headers define boolean to different types (int vs unsigned char) and that seems to be ok as long as they are not in the same translation unit. jumbo apparently puts them in the same translation unit and the compiler barfs.

The BOOLEAN error looks a bit stranger.

I'll try to take a look if nobody beats me to it, but (despite jumbo) it will take too long for me to finish it tonight (it's midnight!).

/Daniel
--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

Bruce Dawson

unread,
Oct 17, 2017, 7:18:37 PM10/17/17
to Daniel Bratell, Chromium-dev, Mihai Sardarescu
The BOOLEAN error is a side-effect of the boolean error. The Windows header files typedef BOOLEAN to boolean in one place and BYTE in another. The two different definitions are matching if boolean is unsigned char, but not if jmorecfg.h typedefs it to int.

I fixed the DictionaryTest errors but now the builds are failing with multiple instances of this:

FAILED: irt_x64/nacl_irt.nexe irt_x64/exe.unstripped/nacl_irt.nexe 
E:/b/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe "../../build/toolchain/gcc_link_wrapper.py" --output="irt_x64/nacl_irt.nexe" --strip="../../native_client/toolchain/win_x86/pnacl_newlib/bin/x86_64-nacl-strip.exe" --unstripped-file="irt_x64/exe.unstripped/nacl_irt.nexe" -- E:/b/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../native_client/build/link_irt.py --tls-edit=./tls_edit --link-cmd=../../native_client/toolchain/win_x86/pnacl_newlib/bin/x86_64-nacl-clang++.exe --readelf-cmd=../../native_client/toolchain/win_x86/pnacl_newlib/bin/x86_64-nacl-readelf.exe -Wl,--fatal-warnings -m64 -Werror -Wl,--gc-sections -o "irt_x64/exe.unstripped/nacl_irt.nexe" -Wl,--start-group @"irt_x64/nacl_irt.nexe.rsp"  -Wl,--end-group    
E:\b\c\builder\Jumbo_Win_x64\src\native_client\toolchain\win_x86\pnacl_newlib\bin/../x86_64-nacl/lib\libnacl.a(malloc.o): In function `_calloc_r':
/mnt/data/b/build/slave/nacl-toolchain/build/native_client/src/untrusted/nacl/malloc.c:37: multiple definition of `_calloc_r'
irt_x64/obj/native_client/src/untrusted/irt/libirt_core_lib.a(irt_malloc.o):../../native_client/src/untrusted/irt/irt_malloc.c:(.text._calloc_r+0x0): first defined here

I'm not sure what could be causing that. Did irt_malloc.c recently get jumbified?

Daniel Bratell

unread,
Oct 18, 2017, 3:02:25 AM10/18/17
to Chromium-dev, Mihai Sardarescu, Bruce Dawson
I would guess that is a side effect of jumbo for base being added. nacl does weird stuff with base and allocators.

(Weird as in "I don't understand it").

/Daniel

Daniel Bratell

unread,
Oct 18, 2017, 1:07:15 PM10/18/17
to Nico Weber, Bruce Dawson, msa...@chromium.org, Chromium-dev
Ended up with other compilation problems today (I jinxed it by bravely saying that it wasn't broken much) but now it's "only" the Windows boolean problem left.  https://bugs.chromium.org/p/chromium/issues/detail?id=77597 tracks it, and it's a little bit tricky to fix it without any kind of special casing anywhere.

Windows wants boolean to be unsigned char. libjpeg_turbo wants boolean to be int. 

Reducing the chunk size will fix it because the two files that end up clashing (ClipboardUtilitiesWin.cpp and image-decoders/jpeg/JPEGImageDecoder.cpp) are far apart in the file list so that is one temporary local hack
or a
jumbo_excluded_sources +=   [ "clipboard/ClipboardUtilitiesWin.cpp" ] next to sources += [ "clipboard/ClipboardUtilitiesWin.cpp" ] in third_party/WebKit/Sources/platform/BUILD.gn.

/Daniel 

Daniel Bratell

unread,
Oct 18, 2017, 2:55:23 PM10/18/17
to Nico Weber, Bruce Dawson, msa...@chromium.org, Chromium-dev
Reply all
Reply to author
Forward
0 new messages