Page MenuHomeFreeBSD

www/qt6-webengine: add powerpc64le support
Needs ReviewPublic

Authored by pkubaj on Wed, Sep 9, 9:02 AM.
Tags
None
Referenced Files
F173843244: D59520.id186255.diff
Mon, Sep 28, 8:27 PM
Unknown Object (File)
Sun, Sep 27, 7:58 PM
Unknown Object (File)
Sun, Sep 27, 12:55 PM
Unknown Object (File)
Sun, Sep 27, 12:55 PM
Unknown Object (File)
Sun, Sep 27, 12:54 PM
Unknown Object (File)
Sun, Sep 27, 12:53 PM
Unknown Object (File)
Tue, Sep 22, 1:21 AM
Unknown Object (File)
Mon, Sep 21, 7:44 PM
Subscribers

Details

Reviewers
jhale
Group Reviewers
kde
Summary

Add powerpc64le support to www/qt6-webengine.

The architecture layer is derived from Chimera Linux's qt6-qtwebengine
ppc64le patchset (same 6.11.1 / Chromium 140 base), reduced to the files
FreeBSD actually compiles and adjusted for FreeBSD:

  • gn: map FreeBSD's uname -m result "powerpc" to ppc64 in host arch detection (sys_info.cc; upstreamable)
  • build/config/compiler: do not force the powerpc64le-unknown-linux-gnu target triple on BSD; the native toolchain default is correct
  • PartitionAlloc: ppc64 GN wiring, use the dynamic-page-size ASLR variant on BSD (same approach as the existing arm64 hunk), pin kAlignment to 16 (long double is 64-bit on powerpc64le before FreeBSD 16, so alignof(max_align_t) is only 8)
  • v8: POWER8 baseline with AltiVec/VSX (as on Linux ppc64le)
  • boringssl: provide the no-asm test_support_asm target for ppc64
  • dawn: check PPC64 before PPC (ppc64 defines both)
  • base: define kThreadPriorityToNiceValueMapForTest in platform_thread_bsd.cc; on ppc64 the reference lives in the TOC and is not garbage-collected, so it must exist
  • blink/webaudio: fix the stale scalar ProcessARateVector fallback signature in delay.cc (never compiled on x86/arm; upstreamable, unbreaks every other architecture)
  • dav1d: ppc64 config using HAVE_ELF_AUX_INFO
  • devtools: give @rollup/plugin-terser a worker-pool fallback; os.cpus() is empty on FreeBSD/powerpc because libuv fails on the missing hw.clockrate sysctl (fix submitted upstream to libuv), which otherwise makes every terser bundling step hang forever
  • GN cpu-list additions for libvpx, highway, tflite, sqlite, webrtc, ui/gl, compiler_specific

amd64/aarch64/armv7/i386: no functional change - the additions are
ppc64-conditional or add BSD guards to branches those arches do not
take.

Test Plan

poudriere testport on powerpc64le-151 (15.1-RELEASE jail, POWER9): full
build (23358 ninja targets), stage, plist check, package, install and
deinstall all pass.

Runtime-tested in the testport -I jail: ldd of QtWebEngineProcess and
libQt6WebEngineCore.so.6 shows no missing symbols; an offscreen
QWebEngineView test app spawns the renderer subprocess, loads a page
and executes JavaScript (V8 JIT) correctly.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

pkubaj requested review of this revision.Wed, Sep 9, 9:02 AM
pkubaj created this revision.
arrowd added inline comments.
www/qt6-webengine/files/patch-src_3rdparty_chromium_base_compiler__specific.h
8

Why this patch? Clang on PPC does not have this attribute?

www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread__bsd.cc
22

This hunk doesn't seem to be PPC-related. Where does it come from?

www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_compiler_translator_InfoSink.h
17 ↗(On Diff #186246)

Same question about this hunk.

www/qt6-webengine/files/patch-src_3rdparty_chromium_base_compiler__specific.h
8

Yes, look at https://github.com/llvm/llvm-project/issues/63214. Note that while this issue is closed, the PR that supposedly fixes it is still open.

www/qt6-webengine/files/patch-src_3rdparty_chromium_base_threading_platform__thread__bsd.cc
22

platform_thread_internal_posix.cc (compiled on FreeBSD) iterates that array in its ThreadPriorityForTest helper and the header declares it extern with a per-platform definition expected elsewhere. Linux and Android each define it but the BSD stub never did. On amd64 that's fine because the referencing function is unused, so --gc-sections discards it and the undefined symbol never reaches the linker. On powerpc64le's ELFv2 the reference lives in the TOC, and TOC entries aren't garbage-collected the same way - without it linking host/root_store_tool failed with undefined symbol: base::internal::kThreadPriorityToNiceValueMapForTest referenced from .toc+0x30.

The values mirror platform_thread_linux.cc's exactly . It's defined unconditionally for all architectures, because it should exist on all the other architectures as well. If GetCurrentThreadPriorityForTest() is called on FreeBSD/amd64, this will be used as well.

www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_angle_src_compiler_translator_InfoSink.h
17 ↗(On Diff #186246)

Ah, it seems I have missed this patch when I was looking through all the Linux-specific patches to remove from Chimera's patchset (without it, that review would have been 4 times as big as it is now). It's possible some unnecessary patches slipped through. I'll drop it.

Remove unnecessary patch-src_3rdparty_chromium_third__party_angle_src_compiler_translator_InfoSink.h

Remove the unnecessary SQLITE_BYTEORDER hunks from the two sqlite amalgamation patches: the bundled sqlite no longer lists ppc in its big-endian heuristic, so ppc64le correctly falls back to runtime endianness detection (SQLITE_BYTEORDER 0) without them.

Rebase to Qt 6.11.2: refresh patch-cmake_QtToolchainHelpers.cmake and patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn for the changes from the 6.11.2 update and the aarch64 build fix; everything else applies unchanged. The full set applies cleanly to a pristine 6.11.2 tree.

Add patch-src_3rdparty_chromium_v8_src_codegen_ppc_assembler-ppc.h: the 6.11.2 chromium snapshot updated V8, whose baseline compiler now reads Assembler::kMaximalBufferSize; the ppc assembler declares it private (other architectures expose it) — make it public. With this, a full poudriere testport of 6.11.2 on powerpc64le passes.