Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 684682

Summary: net-libs/webkit-gtk-2.24.1 - .../work/webkitgtk-2.24.1/Source/JavaScriptCore/assembler/ARM64Assembler.h:3769:100: error: ‘class JSC::AssemblerBuffer’ has no member named ‘data’ on machines with Cortex-A53 CPU
Product: Gentoo Linux Reporter: Andrius Štikonas <andrius>
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: ARM64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log.xz

Description Andrius Štikonas 2019-04-28 23:35:46 UTC
webkit-gtk fails to build on my aarch64 (rk3399) system.

Reproducible: Always




[ebuild     U ~] net-libs/webkit-gtk-2.24.1:4/37::gentoo [2.22.6:4/37::gentoo] USE="X egl geolocation gstreamer introspection jpeg2k%* libnotify opengl spell wayland webgl (-aqua) -coverage -doc -gles2 -gnome-keyring -nsplugin -test (-jit%*)" 0 KiB
Comment 1 Andrius Štikonas 2019-04-28 23:36:45 UTC
Created attachment 574582 [details]
build.log.xz

Build log
Comment 2 Andrius Štikonas 2019-09-02 06:29:41 UTC
This bug is specific to Cortex-A53 CPUs.
Comment 3 Mart Raudsepp gentoo-dev 2019-09-02 11:27:55 UTC
Yes, this looks like very clearly broken upstream code for this code path.

Source/JavaScriptCore/assembler/AssemblerBuffer.h has this for the data member:

#if !CPU(ARM64) // If we were to define this on arm64e, we'd need a way to update the hash as we write directly into the buffer.
        void* data() const { return m_storage.buffer(); }
#endif

while Source/JavaScriptCore/assembler/ARM64Assembler.h has this:

#if CPU(ARM64_CORTEXA53)
        CHECK_DATASIZE();
        if (datasize == 64) {
            if (LIKELY(m_buffer.codeSize() >= sizeof(int32_t))) {
                // From ARMv8 Reference Manual, Section C4.1: the encoding of the
                // instructions in the Loads and stores instruction group is:
                // ---- 1-0- ---- ---- ---- ---- ---- ----
                if (UNLIKELY((*reinterpret_cast_ptr<int32_t*>(reinterpret_cast_ptr<char*>(m_buffer.data()) + m_buffer.codeSize() - sizeof(int32_t)) & 0x0a000000) == 0x08000000))
                    nop();
            }
        }
#endif

There you can see if tries to access m_buffer.data(), but it's not even declared in the header if CPU(ARM64).

Please find upstream bug report for this, perhaps check it isn't fixed in their subversion trunk already (I think they have git mirror too, or have converted it all to git by now), and if nothing, file a new upstream bug and report the link here.
Comment 4 Mart Raudsepp gentoo-dev 2019-09-02 11:30:18 UTC
The build system detects this CPU type from /proc/cpuinfo in Source/cmake/OptionsCommon.cmake and sets up the preprocessor vars and also prepends "-mfix-cortex-a53-835769" to CFLAGS/CXXFLAGS. The latter you may want to research and do yourself too if not already doing (albeit I'm not sure all a53 need that errata toolchain workaround).