Index | Thread | Search

From:
Jeremie Courreges-Anglas <jca@wxcvbn.org>
Subject:
x11/qt5/qtwebengine on arm64 (was: Re: aarch64 bulk build report)
To:
rsadowski@openbsd.org
Cc:
ports@openbsd.org, landry@openbsd.org, phessler@openbsd.org
Date:
Sun, 4 Aug 2024 21:13:07 +0200

Download raw body.

Thread
  • Stuart Henderson:

    aarch64 bulk build report

  • On Mon, Jul 22, 2024 at 12:19:28AM +0200, Jeremie Courreges-Anglas wrote:
    > On Sat, Jul 20, 2024 at 10:50:30AM +0200, Landry Breuil wrote:
    > > Le Fri, Jul 19, 2024 at 10:45:18AM +0200, Landry Breuil a écrit :
    > > > Le Fri, Jul 19, 2024 at 08:49:54AM +0200, Peter Hessler a écrit :
    > > > > On 2024 Jul 18 (Thu) at 21:35:47 -0600 (-0600), phessler@openbsd.org wrote:
    > > > > :critical path missing pkgs:  http://build-failures.rhaalovely.net/aarch64/2024-07-16/summary.log
    > > > > 
    > > > > :http://build-failures.rhaalovely.net/aarch64/2024-07-16/mail/mozilla-thunderbird.log
    > > > > :http://build-failures.rhaalovely.net/aarch64/2024-07-16/www/firefox-esr.log
    > > > > :http://build-failures.rhaalovely.net/aarch64/2024-07-16/www/tor-browser/browser.log
    > > > > :http://build-failures.rhaalovely.net/aarch64/2024-07-16/x11/qt5/qtwebengine.log
    > > > > 
    > > > > the above 4 ports fail related to hwcap in the same way:
    > > > > 
    > > > > /usr/obj/ports/firefox-esr-115.13.0/firefox-115.13.0/gfx/skia/skia/src/core/SkCpu.cpp:84:27:
    > > > > error: use of undeclared identifier 'getauxval'
    > > > >         uint32_t hwcaps = getauxval(AT_HWCAP);
    > > > 
    > > > https://searchfox.org/mozilla-esr115/source/gfx/skia/skia/src/core/SkCpu.cpp#76
    > > > for the surrounding code, i guess it now finds a sys/auxv.h header ?
    > 
    > That would make sense.  Looking at the www/mozilla-firefox copy of
    > skia, this chunk of code appears to have disappeared from SkCpu.cpp.
    > 
    >   https://github.com/google/skia/commit/571b4cf2e35930f6744181b73b72939ab236f3ea
    
    Still left to fix: x11/qt5/qtwebengine.  Here's a diff that drops the
    sys/auxv.h & getauxval code that breaks on arm64 (already dropped in
    upstream Skia).  Comment snagged from Landry's commit.
    
    ok?
    
    
    Index: patches/patch-src_3rdparty_chromium_third_party_skia_src_core_SkCpu_cpp
    ===================================================================
    RCS file: patches/patch-src_3rdparty_chromium_third_party_skia_src_core_SkCpu_cpp
    diff -N patches/patch-src_3rdparty_chromium_third_party_skia_src_core_SkCpu_cpp
    --- /dev/null	1 Jan 1970 00:00:00 -0000
    +++ patches/patch-src_3rdparty_chromium_third_party_skia_src_core_SkCpu_cpp	4 Aug 2024 18:56:41 -0000
    @@ -0,0 +1,88 @@
    +drop cpu features detection, as done in upstream skia in
    +https://github.com/google/skia/commit/571b4cf2e35930f6744181b73b72939ab236f3ea
    +
    +fixes build since elf_aux_info/auxv.h addition
    +
    +Index: src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp
    +--- src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp.orig
    ++++ src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp
    +@@ -72,79 +72,6 @@
    +         return features;
    +     }
    + 
    +-#elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
    +-    #include <sys/auxv.h>
    +-
    +-    static uint32_t read_cpu_features() {
    +-        const uint32_t kHWCAP_CRC32   = (1<< 7),
    +-                       kHWCAP_ASIMDHP = (1<<10);
    +-
    +-        uint32_t features = 0;
    +-        uint32_t hwcaps = getauxval(AT_HWCAP);
    +-        if (hwcaps & kHWCAP_CRC32  ) { features |= SkCpu::CRC32; }
    +-        if (hwcaps & kHWCAP_ASIMDHP) { features |= SkCpu::ASIMDHP; }
    +-
    +-        // The Samsung Mongoose 3 core sets the ASIMDHP bit but doesn't support it.
    +-        for (int core = 0; features & SkCpu::ASIMDHP; core++) {
    +-            // These /sys files contain the core's MIDR_EL1 register, the source of
    +-            // CPU {implementer, variant, part, revision} you'd see in /proc/cpuinfo.
    +-            SkString path =
    +-                SkStringPrintf("/sys/devices/system/cpu/cpu%d/regs/identification/midr_el1", core);
    +-
    +-            // Can't use SkData::MakeFromFileName() here, I think because /sys can't be mmap()'d.
    +-            SkFILEStream midr_el1(path.c_str());
    +-            if (!midr_el1.isValid()) {
    +-                // This is our ordinary exit path.
    +-                // If we ask for MIDR_EL1 from a core that doesn't exist, we've checked all cores.
    +-                if (core == 0) {
    +-                    // On the other hand, if we can't read MIDR_EL1 from any core, assume the worst.
    +-                    features &= ~(SkCpu::ASIMDHP);
    +-                }
    +-                break;
    +-            }
    +-
    +-            const char kMongoose3[] = "0x00000000531f0020";  // 53 == Samsung.
    +-            char buf[SK_ARRAY_COUNT(kMongoose3) - 1];  // No need for the terminating \0.
    +-
    +-            if (SK_ARRAY_COUNT(buf) != midr_el1.read(buf, SK_ARRAY_COUNT(buf))
    +-                          || 0 == memcmp(kMongoose3, buf, SK_ARRAY_COUNT(buf))) {
    +-                features &= ~(SkCpu::ASIMDHP);
    +-            }
    +-        }
    +-        return features;
    +-    }
    +-
    +-#elif defined(SK_CPU_ARM32) && __has_include(<sys/auxv.h>) && \
    +-    (!defined(__ANDROID_API__) || __ANDROID_API__ >= 18)
    +-    // sys/auxv.h will always be present in the Android NDK due to unified
    +-    //headers, but getauxval is only defined for API >= 18.
    +-    #include <sys/auxv.h>
    +-
    +-    static uint32_t read_cpu_features() {
    +-        const uint32_t kHWCAP_NEON  = (1<<12);
    +-        const uint32_t kHWCAP_VFPv4 = (1<<16);
    +-
    +-        uint32_t features = 0;
    +-        uint32_t hwcaps = getauxval(AT_HWCAP);
    +-        if (hwcaps & kHWCAP_NEON ) {
    +-            features |= SkCpu::NEON;
    +-            if (hwcaps & kHWCAP_VFPv4) { features |= SkCpu::NEON_FMA|SkCpu::VFP_FP16; }
    +-        }
    +-        return features;
    +-    }
    +-
    +-#elif defined(SK_CPU_ARM32) && __has_include(<cpu-features.h>)
    +-    #include <cpu-features.h>
    +-
    +-    static uint32_t read_cpu_features() {
    +-        uint32_t features = 0;
    +-        uint64_t cpu_features = android_getCpuFeatures();
    +-        if (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON)     { features |= SkCpu::NEON; }
    +-        if (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON_FMA) { features |= SkCpu::NEON_FMA; }
    +-        if (cpu_features & ANDROID_CPU_ARM_FEATURE_VFP_FP16) { features |= SkCpu::VFP_FP16; }
    +-        return features;
    +-    }
    +-
    + #else
    +     static uint32_t read_cpu_features() {
    +         return 0;
    
    
    -- 
    jca
    
    
    
  • Stuart Henderson:

    aarch64 bulk build report