Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 828442 - www-client/chromium-97.0.4692.36: ../../third_party/icu/source/i18n/unicode/msgfmt.h:432:19: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool')
Summary: www-client/chromium-97.0.4692.36: ../../third_party/icu/source/i18n/unicode/m...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-06 01:49 UTC by Alex Xu (Hello71)
Modified: 2022-10-01 13:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info chromium (emerge-info-chromium,20.42 KB, text/plain)
2021-12-07 17:14 UTC, Alex Xu (Hello71)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Xu (Hello71) 2021-12-06 01:49:37 UTC
In file included from ../../base/i18n/message_formatter.cc:14:
../../third_party/icu/source/i18n/unicode/msgfmt.h:432:19: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool')
    virtual UBool operator==(const Format& other) const;
            ~~~~~ ^
/usr/include/unicode/format.h:114:18: note: overridden virtual function is here
    virtual bool operator==(const Format& other) const = 0;
            ~~~~ ^
In file included from ../../base/i18n/message_formatter.cc:14:
../../third_party/icu/source/i18n/unicode/msgfmt.h:1091:23: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool')
        virtual UBool operator==(const Format&) const;
                ~~~~~ ^
/usr/include/unicode/format.h:114:18: note: overridden virtual function is here
    virtual bool operator==(const Format& other) const = 0;
            ~~~~ ^
2 errors generated.

seems to compile and run ok with:

--- a/www-client/chromium/chromium-97.0.4692.36.ebuild
+++ b/www-client/chromium/chromium-97.0.4692.36.ebuild
@@ -499,7 +499,7 @@ src_prepare() {
                keeplibs+=( third_party/libxslt )
                keeplibs+=( third_party/openh264 )
                keeplibs+=( third_party/re2 )
-               if use system-icu; then
+               if ! use system-icu; then
                        keeplibs+=( third_party/icu )
                fi
        fi
Comment 1 Stephan Hartmann (RETIRED) gentoo-dev 2021-12-06 08:29:31 UTC
Please attach emerge --info and full build.log to this bug. What version of ICU is installed on your system?
Comment 2 Alex Xu (Hello71) 2021-12-07 17:14:45 UTC
Created attachment 757637 [details]
emerge --info chromium

I don't have the failed build log anymore. emerge --info chromium attached. icu:

[binary   R    ] dev-libs/icu-70.1-1:0/70.1::gentoo  USE="-debug -doc -examples -static-libs" ABI_X86="32 (64) (-x32)" 0 KiB

what is the logic for the reversal of this USE (if use system, then keep icu), if not a typo?
Comment 3 Stephan Hartmann (RETIRED) gentoo-dev 2021-12-07 17:55:03 UTC
Is it possible that you edited the ebuild locally, because it is ! use system-icu in the tree:
https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/chromium-97.0.4692.36.ebuild#n486
Comment 4 Stephan Hartmann (RETIRED) gentoo-dev 2021-12-07 17:56:09 UTC
Scratch that. You have set CHROMIUM_FORCE_LIBCXX=yes?
Comment 5 Alex Xu (Hello71) 2021-12-07 18:07:31 UTC
(In reply to Stephan Hartmann from comment #4)
> Scratch that. You have set CHROMIUM_FORCE_LIBCXX=yes?

yes, it is in the emerge --info. I assume it works ok with CHROMIUM_FORCE_LIBCXX=no, on the basis that nobody else seems to have complained, but I haven't tested it. I guess it would probably be broken again if CHROMIUM_FORCE_LIBCXX=yes is set as default in future, and the user had incompatible icu installed.
Comment 6 Stephan Hartmann (RETIRED) gentoo-dev 2021-12-07 18:19:18 UTC
The logic in the ebuild is correct. With libcxx you cannot link against system ICU, because that might link against libstc++ from GCC. The unbundling script has problems if you specify library pathes twice. So we only add icu to keeplibs in case USE=system-icu.
The problem here seems to be that the bundled ICU includes headers from system ICU. We need the compiler command to debug the issue further.
Comment 7 Alex Xu (Hello71) 2021-12-07 20:42:47 UTC
ah, i see, it's backwards because it was potentially already kept previously; it has the function of [[ " ${keeplibs[*]} " == *" third_party/icu "* ]] || keeplibs+=( third_party/icu ). shouldn't https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/chromium-97.0.4692.36.ebuild#n603 be moved inside the following if block then?
Comment 8 Krzysztof Nowicki 2022-01-23 20:14:39 UTC
(In reply to Stephan Hartmann from comment #6)
> We need the compiler command to debug the issue further.

# clang++ -v -MMD -MF obj/base/i18n/time_formatting.o.d -DBASE_I18N_IMPLEMENTATION -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SO
URCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=79a2e924d96e2fc1e4b937c42efd08898fa472d7 -DNDEBUG -DNV
ALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DU_IMPORT=U_EXPORT -I../.. -Igen -I../../buildtools/third_party/libc++ -Igen/shim_headers/icui18n_shim -Igen/shim_headers/i
cuuc_shim -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -Igen/shim_headers/zlib_shim -I../../third_party/ced/src -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Igen/protoc_out -fno-delete-null-pointer
-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -flto=thin -fsplit-lto-unit -fwhole-program-vtables -fcomplete-member-pointers -no-canonical-prefixes -Wimplicit-fallthrough -
Wunreachable-code-aggressive -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -fno-omit-frame-pointer -ftrivial-auto-var-init=pattern -fprofile-instr-use=../../chrome
/build/pgo_profiles/chrome-linux-4692-1640701189-f21838a98aa9a4bd13520a4261d2d77cbab9c3f3.profdata -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -I/usr/include/glib-2.0 -I
/usr/lib64/glib-2.0/include -I/usr/lib64/libffi/include -DPROTOBUF_ALLOW_DEPRECATED=1 -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -O2 -p
ipe -march=haswell -fno-ident -msse4.2 -mavx -fno-semantic-interposition -falign-functions=32 -flto=thin -stdlib=libc++ -Wno-unknown-warning-option -c ../../base/i18n/time_formatting.cc -o obj/base/i18n/time_formatting.o
clang version 13.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/13/bin
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
clang++: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
 (in-process)
 "/usr/lib/llvm/13/bin/clang++" -cc1 -triple x86_64-pc-linux-gnu -emit-llvm-bc -flto=thin -flto-unit -disable-free -disable-llvm-verifier -discard-value-names -main-file-name time_formatting.cc -function-alignment 5 -mrelocation-model pic -pic-level 2 -fmerge-all-constants -fno-delete-null-pointer-checks -mframe-poin
ter=all -relaxed-aliasing -fmath-errno -fno-rounding-math -mconstructor-aliases -target-cpu haswell -target-feature +sse4.2 -target-feature +avx -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fprofile-instrument-use-path=../../chrome/build/pgo_profiles/chrome-linux-4692-1640701189-f21838a98aa9
a4bd13520a4261d2d77cbab9c3f3.profdata -fcoverage-compilation-dir=/var/tmp/portage/www-client/chromium-97.0.4692.71-r1/work/chromium-97.0.4692.71/out/Release -nostdinc++ -resource-dir /usr/lib/llvm/13/bin/../../../../lib/clang/13.0.0 -dependency-file obj/base/i18n/time_formatting.o.d -MT obj/base/i18n/time_formatting.
o -isystem ../../buildtools/third_party/libc++/trunk/include -isystem ../../buildtools/third_party/libc++abi/trunk/include -D BASE_I18N_IMPLEMENTATION -D USE_UDEV -D USE_AURA=1 -D USE_GLIB=1 -D USE_NSS_CERTS=1 -D USE_OZONE=1 -D USE_X11=1 -D OFFICIAL_BUILD -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D _LARGEFILE64_S
OURCE -D NO_UNWIND_TABLES -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D _LIBCPP_ABI_UNSTABLE -D _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D _LIBCPP_ENABLE_NODISCARD -D CR_LIBCXX_REVISION=79a2e924d96e2fc1e4b937c42efd08898fa472d7 -D NDEBUG -D NVALGRIND -D
 DYNAMIC_ANNOTATIONS_ENABLED=0 -D GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -D GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -D USING_SYSTEM_ICU=1 -D ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -D U_IMPORT=U_EXPORT -I ../.. -I gen -I ../../buildtools/third_party/libc++ -I gen/shim_headers/icui18n_shim -I gen/shim_headers/
icuuc_shim -I ../../third_party/perfetto/include -I gen/third_party/perfetto/build_config -I gen/third_party/perfetto -I gen/shim_headers/zlib_shim -I ../../third_party/ced/src -I ../../third_party/abseil-cpp -I ../../third_party/boringssl/src/include -I ../../third_party/protobuf/src -I gen/protoc_out -I /usr/includ
e/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/lib64/libffi/include -D PROTOBUF_ALLOW_DEPRECATED=1 -internal-isystem /usr/lib/llvm/13/bin/../../../../lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/include -inte
rnal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wimplicit-fallthrough -Wunreachable-code-aggressive -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unneeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-
optimize -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date -Wno-backend-plugin -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wexit-time-destructors -Wno-trigraphs -Wno-unknown-warning-option -std=c++14 -fno-trigraphs -fdeprecated-macro -fdebug-compilation-dir=/var/tmp/portage/www-cli
ent/chromium-97.0.4692.71-r1/work/chromium-97.0.4692.71/out/Release -ferror-limit 19 -fvisibility hidden -fvisibility-inlines-hidden -pthread -stack-protector 1 -stack-protector-buffer-size 4 -ftrivial-auto-var-init=pattern -fno-rtti -fgnuc-version=4.2.1 -Qn -fcolor-diagnostics -vectorize-loops -vectorize-slp -fwhole
-program-vtables -fsplit-lto-unit -fcomplete-member-pointers -o obj/base/i18n/time_formatting.o -x c++ ../../base/i18n/time_formatting.cc
clang -cc1 version 13.0.0 based upon LLVM 13.0.0 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "gen/protoc_out"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 ../..
 gen
 ../../buildtools/third_party/libc++
 gen/shim_headers/icui18n_shim
 gen/shim_headers/icuuc_shim
 ../../third_party/perfetto/include
 gen/third_party/perfetto/build_config
 gen/third_party/perfetto
 gen/shim_headers/zlib_shim
 ../../third_party/ced/src
 ../../third_party/abseil-cpp
 ../../third_party/boringssl/src/include
 ../../third_party/protobuf/src
 /usr/include/glib-2.0
 /usr/lib64/glib-2.0/include
 /usr/lib64/libffi/include
 ../../buildtools/third_party/libc++/trunk/include
 ../../buildtools/third_party/libc++abi/trunk/include
 /usr/lib/llvm/13/bin/../../../../lib/clang/13.0.0/include
 /usr/include
End of search list.
In file included from ../../base/i18n/time_formatting.cc:19:
../../third_party/icu/source/i18n/unicode/datefmt.h:238:19: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool')
    virtual UBool operator==(const Format&) const;
            ~~~~~ ^
/usr/include/unicode/format.h:114:18: note: overridden virtual function is here
    virtual bool operator==(const Format& other) const = 0;
            ~~~~ ^
In file included from ../../base/i18n/time_formatting.cc:20:
In file included from ../../third_party/icu/source/i18n/unicode/dtitvfmt.h:29:
/usr/include/unicode/smpdtfmt.h:879:18: error: virtual function 'operator==' has a different return type ('bool') than the function it overrides (which has return type 'UBool' (aka 'signed char'))
    virtual bool operator==(const Format& other) const override;
            ~~~~ ^
../../third_party/icu/source/i18n/unicode/datefmt.h:238:19: note: overridden virtual function is here
    virtual UBool operator==(const Format&) const;
            ~~~~~ ^
In file included from ../../base/i18n/time_formatting.cc:20:
../../third_party/icu/source/i18n/unicode/dtitvfmt.h:446:19: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool')
    virtual UBool operator==(const Format& other) const;
            ~~~~~ ^
/usr/include/unicode/format.h:114:18: note: overridden virtual function is here
    virtual bool operator==(const Format& other) const = 0;
            ~~~~ ^
In file included from ../../base/i18n/time_formatting.cc:23:
../../third_party/icu/source/i18n/unicode/measfmt.h:151:19: error: virtual function 'operator==' has a different return type ('UBool' (aka 'signed char')) than the function it overrides (which has return type 'bool')
    virtual UBool operator==(const Format &other) const;
            ~~~~~ ^
/usr/include/unicode/format.h:114:18: note: overridden virtual function is here
    virtual bool operator==(const Format& other) const = 0;
            ~~~~ ^
4 errors generated.
Comment 9 Krzysztof Nowicki 2022-01-24 09:17:12 UTC
(In reply to Stephan Hartmann from comment #6)
> The logic in the ebuild is correct. With libcxx you cannot link against
> system ICU, because that might link against libstc++ from GCC. The
> unbundling script has problems if you specify library pathes twice. So we
> only add icu to keeplibs in case USE=system-icu.
> The problem here seems to be that the bundled ICU includes headers from
> system ICU. We need the compiler command to debug the issue further.

I have tried to disabling "system-icu" and Chromium built fine witg clang and libc++. This means that the logic in the ebuild is not entirely correct.

There are three changes in the build logic that are done differently dependent of the "system-icu" flag:
 1. keeplibs - used to control the unbubdler
 2. setting of gn_system_libraries
 3. setting of icu_use_data_file=false

Only the first action is reverted in presence of CHROMIUM_FORCE_LIBCXX=true. The remaining two steps are executed even with "+system-icu" and libc++.

From my naive point of view it seems that the general behaviour should be to block use of "system-icu" together with CHROMIUM_FORCE_LIBCXX. This means that the ebuild should either:
 a) fix steps 2 and 3 to also behave differently when libc++ is enabled
 b) throw an error if "system-icu" is requested together with enabling libc++.

Personally I would vote for b).

A nice addition would actually be to convert CHROMIUM_FORCE_CLANG and CHROMIUM_FORCE_LIBCXX to USE flags, which would allow to set-up REQUIRED_USE to block unsupported set of options.
Comment 10 Stephan Hartmann (RETIRED) gentoo-dev 2022-01-24 09:47:24 UTC
I have added USE=libcxx in ebuilds in my overlay, e.g.:

https://github.com/stha09/gpo-stha09/blob/master/www-client/chromium/chromium-99.0.4840.0.ebuild

However, there are a lot more changes (USE=headless, gtk4, cross-compiling), but I think those are not ready for the tree.
Comment 11 Larry the Git Cow gentoo-dev 2022-01-30 08:37:43 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c65f1fb18943313a621d8cce43d0a68ebf65d2f4

commit c65f1fb18943313a621d8cce43d0a68ebf65d2f4
Author:     Stephan Hartmann <sultan@gentoo.org>
AuthorDate: 2022-01-30 08:36:59 +0000
Commit:     Stephan Hartmann <sultan@gentoo.org>
CommitDate: 2022-01-30 08:37:35 +0000

    www-client/chromium: dev channel bump to 99.0.4844.11
    
    - improve headless builds
    - fix cross compiling
    - remove CHROMIUM_FORCE_LIBCXX and add USE=libcxx instead
    - allow building with GTK4
    
    Bug: https://bugs.gentoo.org/786597
    Bug: https://bugs.gentoo.org/828442
    Package-Manager: Portage-3.0.28, Repoman-3.0.3
    Signed-off-by: Stephan Hartmann <sultan@gentoo.org>

 www-client/chromium/Manifest                       |   4 +-
 ....4840.0.ebuild => chromium-99.0.4844.11.ebuild} | 242 +++++++++++++--------
 .../chromium/files/chromium-cross-compile.patch    |  12 +
 www-client/chromium/metadata.xml                   |   2 +
 4 files changed, 162 insertions(+), 98 deletions(-)
Comment 12 Alex Xu (Hello71) 2022-01-31 21:05:38 UTC
this seems like a good change, but am i missing something or is the icu problem not fixed here? there is no special handling of USE=libcxx && USE=system-icu. is it supposed to have REQUIRED_USE="libcxx? ( !system-icu )"?
Comment 13 Stephan Hartmann (RETIRED) gentoo-dev 2022-02-01 11:40:14 UTC
(In reply to Alex Xu (Hello71) from comment #12)
> this seems like a good change, but am i missing something or is the icu
> problem not fixed here? there is no special handling of USE=libcxx &&
> USE=system-icu. is it supposed to have REQUIRED_USE="libcxx? ( !system-icu
> )"?

In the previous configuration we were forced to use bundled libraries that link against libstdc++. With USE=libcxx we are using bundled libcxx and link static with it. Only re2 uses STL containers in its ABI and we can unbundle other libraries including ICU again.
Comment 14 Alex Xu (Hello71) 2022-02-01 14:01:51 UTC
(In reply to Stephan Hartmann from comment #13)
> (In reply to Alex Xu (Hello71) from comment #12)
> > this seems like a good change, but am i missing something or is the icu
> > problem not fixed here? there is no special handling of USE=libcxx &&
> > USE=system-icu. is it supposed to have REQUIRED_USE="libcxx? ( !system-icu
> > )"?
> 
> In the previous configuration we were forced to use bundled libraries that
> link against libstdc++. With USE=libcxx we are using bundled libcxx and link
> static with it. Only re2 uses STL containers in its ABI and we can unbundle
> other libraries including ICU again.

ah, I see. that makes sense. it seems like it should work, but i can't test this now; i'm happy to close this with TEST-REQUEST or leave open, whichever you prefer.