Opened 13 months ago

Closed 12 months ago

Last modified 9 months ago

#17941 closed defect (fixed)

Qtwebengine FTBFS with icu-73

Reported by: pierre Owned by: blfs-book
Priority: normal Milestone: 12.0
Component: BOOK Version: git
Severity: normal Keywords:
Cc:

Description

FAILED: obj/v8/v8_base_without_compiler/js-display-names.o 
/usr/bin/g++ -MMD -MF obj/v8/v8_base_without_compiler/js-display-names.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DENABLE_MINOR_MC -DV8_INTL_SUPPORT -DV8_CONCURRENT_MARKING -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SNAPSHOT_COMPRESSION -DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRECATION_WARNINGS -DV8_REVERSE_JSARGS -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_LINUX -DDISABLE_UNTRUSTED_CODE_MITIGATIONS -DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRECATION_WARNINGS -DV8_REVERSE_JSARGS -DCPPGC_CAGED_HEAP -DUSING_SYSTEM_ICU=1 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DUCHAR_TYPE=uint16_t -DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_DEPRECATION_WARNINGS -DV8_REVERSE_JSARGS -I. -Igen -I../../../../src/3rdparty/chromium -I../../../../src/3rdparty/chromium/v8 -I../../../../src/3rdparty/chromium/v8/include -Igen/v8 -Igen -Igen -I../../../../src/3rdparty/chromium/v8/include -I../../../../src/3rdparty/chromium/third_party/zlib -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -m64 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -fno-omit-frame-pointer -fvisibility=hidden -Wno-strict-overflow -Wno-return-type -O3 -fno-ident -fdata-sections -ffunction-sections -g0 -std=gnu++14 -Wno-narrowing -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -c ../../../../src/3rdparty/chromium/v8/src/objects/js-display-names.cc -o obj/v8/v8_base_without_compiler/js-display-names.o
In file included from /usr/include/unicode/timezone.h:45,
                 from /usr/include/unicode/calendar.h:42,
                 from /usr/include/unicode/dtfmtsym.h:29,
                 from ../../../../src/3rdparty/chromium/v8/src/objects/js-display-names.cc:21:
/usr/include/unicode/ures.h: In function ‘icu_73::UnicodeString icu_73::ures_getUnicodeString(const UResourceBundle*, UErrorCode*)’:
/usr/include/unicode/ures.h:815:39: error: invalid conversion from ‘const UChar*’ {aka ‘const short unsigned int*’} to ‘const char16_t*’ [-fpermissive]
  815 |     const char16_t *r = ures_getString(resB, &len, status);
      |                                       ^
      |                                       |
      |                                       const UChar* {aka const short unsigned int*}

and a number of similar errors. I suspect -std=gnu++14 should be changed to a former version (gnu++11 or so: in icu4C-73 changelog, it is said that the code relies "more" on C+++11), but not sure, and anyway, this should only be changed when including icu headers...

Change History (8)

comment:1 by Xi Ruoyao, 13 months ago

#include <unicode/ures.h>

int main() {}

But this program compiles fine with C++11, 14, and 17.

comment:2 by Xi Ruoyao, 13 months ago

Alright, it's triggered by -DUCHAR_TYPE=uint16_t. I'll see if there is an upstream bug report...

comment:4 by Xi Ruoyao, 13 months ago

Created https://github.com/unicode-org/icu/pull/2431. But not sure if it's a proper fix.

comment:5 by pierre, 13 months ago

The qtwebengine development source at https://github.com/qt/qtwebengine does not do the defines of UCHAR_TYPE anymore. But they have introduced a src/3rdparty/chromium/base/i18n/uchar.h header that they use for some other code that needs type conversions. I'll try to make a patch out of this.

comment:6 by pierre, 12 months ago

patch committed at commit 1ea9ffa in patches repo. Let me try to tell how I did it. First:

git clone https://github.com/qt/qtwebengine-chromium.git

Then, checkout the commit that removed UCHAR_TYPE:

git checkout 189d4fd8fad

Then generate a very long diff for this commit:

git diff HEAD^ >/tmp/temp/patch

Edit the patch, and look for the regexp \(uchar.h\|UCHAR_TYPE\) Keep all the diffs that have base/i18n/uchar.h as a header, but remove addition or removal of any other header. Keep only diffs that add ToUCharPtr. Also keep the diffs that remove UCHAR_TYPE. Save the patch (should be down to about 875 lines).

Generate an auxiliary patch for chromium/base/i18n/rtl.cc:

git diff HEAD^ -- chromium/base/i18n/rtl.cc >/tmp/aux1.patch

Generate another one for chromium/ppapi/proxy/pdf_resource.cc:

git diff HEAD^ -- chromium/ppapi/proxy/pdf_resource.cc >/tmp/aux2.patch

Create two directories containing qtwebengine-5.15.13, rename one a and the other b. Only apply changes into b:

  • apply the temporary patch (you need to cd to src/3rdparty for that) and the 2 auxiliary patches
  • one removal of UCHAR_TYPE has not been done in src/3rdparty/chromium/third_party/icu/BUILD.gn, edit that file and remove it (2 lines).
  • edit chromium/third_party/blink/renderer/platform/wtf/text/string_view.h, chromium/third_party/blink/renderer/platform/wtf/text/atomic_string.h, and chromium/third_party/blink/renderer/platform/wtf/text/wtf_string.h: remove:
      StringView(const char16_t* chars)
          : StringView(reinterpret_cast<const UChar*>(chars)) {}
    

from the first,

  AtomicString(const char16_t* chars)
      : AtomicString(reinterpret_cast<const UChar*>(chars)) {}

from the second, and

  String(const char16_t* chars)
      : String(reinterpret_cast<const UChar*>(chars)) {}

from the third...

  • Last but not least, edit chromium/third_party/blink/renderer/core/exported/web_view_impl.cc, and add
    #include "base/i18n/uchar.h"
    

to the headers (after all the "base" headers). Then change "event.text" to "base::i18n::ToUCharPtr(event.text)" at two places.

You should be done. Generate the patch. Change to the directory containing a and b, then:

diff -Naur a b >/path/to/the.patch

Test the patch. Test it builds. Fix if not...

comment:7 by pierre, 12 months ago

Resolution: fixed
Status: newclosed

Fixed at 2a89d30852

comment:8 by Bruce Dubbs, 9 months ago

Milestone: 11.412.0

Milestone renamed

Note: See TracTickets for help on using tickets.