New issue
Advanced search Search tips

Issue 775979 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 761475



Sign in to add a comment

libjpeg header and Windows headers define boolean differently - causing jumbo compilation errors

Project Member Reported by brat...@opera.com, Oct 18 2017

Issue description

libjpeg headers (jmorecfg.h):
typedef int boolean

Windows headers:
typedef unsigned char boolean

When the jpeg decoder and Windows headers are in the same translation units they will collide. 

libjpeg has a hook to predefine boolean, probably because of this, so that is probably the way to get out of this in jumbo builds.

Alternatively exclude the jpeg image decoder from jumbo.

Error message:

FAILED: obj/third_party/WebKit/Source/platform/platform/platform_jumbo_6.obj
ninja -t msvc -e environment.x64 -- "c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.11.25503\bin\hostx64\x64/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:\program files (x86)\windows kits\10\include\10.0.15063.0\shared\rpcndr.h(193): error C2371: 'boolean': redefinition; different basic types
l:\src\clean_chromium\src\third_party\libjpeg_turbo\jmorecfg.h(242): note: see declaration of 'boolean'
c:\program files (x86)\windows kits\10\include\10.0.15063.0\shared\wtypesbase.h(501): error C2371: 'BOOLEAN': redefinition; different basic types
c:\program files (x86)\windows kits\10\include\10.0.15063.0\um\winnt.h(1102): note: see declaration of 'BOOLEAN'
ninja: build stopped: subcommand failed.

In this particular case this was triggered by the combination of image-decoders/jpeg/JPEGImageDecoder.cpp and clipboard/ClipboardUtilitiesWin.cpp which are about 85 files apart in the file list so a smaller jumbo chunk size would hide this problem as well.


 

Comment 1 by brat...@opera.com, Oct 18 2017

Blockedon: 761475

Comment 2 by brat...@opera.com, Oct 18 2017

Blockedon: -761475
Blocking: 761475

Comment 3 by msarda@chromium.org, Oct 19 2017

Cc: msarda@chromium.org
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ea74dd59eafdbb1d684a63d74e98f2cdfd9e71fb

commit ea74dd59eafdbb1d684a63d74e98f2cdfd9e71fb
Author: Daniel Bratell <bratell@opera.com>
Date: Thu Oct 19 19:22:54 2017

Fix Windows jumbo compilation by excluding the jpeg decoder

The jpeg decoder uses libjpeg_turbo which uses a "boolean" type
defined to be int. At the same time Windows has "boolean" type
which is unsigned char. If those headers meet in a
translation unit you get compilation errors.

An alternative fix would be to redefine libjpeg_turbo to use
unsigned char for its boolean type.

Bug: 775979
Change-Id: I268e0890dfc2fae79d0abe54bbd7bf5c0c23226f
Reviewed-on: https://chromium-review.googlesource.com/727980
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#510155}
[modify] https://crrev.com/ea74dd59eafdbb1d684a63d74e98f2cdfd9e71fb/third_party/WebKit/Source/platform/BUILD.gn

Status: Assigned (was: Untriaged)

Sign in to add a comment