Bug 235410

Summary: [WPE][GTK] Build error in ARMv7 Neon targets after r286152
Product: WebKit Reporter: Pablo Saavedra <psaavedra>
Component: WebCore Misc.Assignee: Pablo Saavedra <psaavedra>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, darin, dino, ews-watchlist, heycam, kondapallykalyan, sabouhallawa, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=233500
https://bugs.webkit.org/show_bug.cgi?id=243415
Attachments:
Description Flags
patch
none
patch
none
patch
none
patch none

Description Pablo Saavedra 2022-01-20 09:53:28 PST
* Related to this change: After: https://bugs.webkit.org/show_bug.cgi?id=232833
* Added a rudimentary patch addressing the build errors with the only purpose of illustrating the problematic changes.
Comment 1 Pablo Saavedra 2022-01-20 09:56:03 PST
Created attachment 449592 [details]
patch
Comment 2 Pablo Saavedra 2022-01-20 23:58:03 PST


* List of the compile errors found:



* In /Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h:

In file included from /nightly/workspace/sources/wpewebkit/Source/WebCore/platform/graphics/filters/FEBlend.cpp:29:
/nightly/workspace/sources/wpewebkit/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h:109:6: error: no declaration matches 'bool WebCore::FEBlend::platformApplySoftware(const WebCore::Filter&)'
  109 | bool FEBlend::platformApplySoftware(const Filter&)
      |      ^~~~~~~
/nightly/workspace/sources/wpewebkit/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h:109:6: note: no functions named 'bool WebCore::FEBlend::platformApplySoftware(const WebCore::Filter&)'
In file included from /nightly/workspace/sources/wpewebkit/Source/WebCore/platform/graphics/filters/FEBlend.cpp:27:
/nightly/workspace/sources/wpewebkit/Source/WebCore/platform/graphics/filters/FEBlend.h:31:7: note: 'class WebCore::FEBlend' defined here
   31 | class FEBlend : public FilterEffect {
      |       ^~~~~~~




* In Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:

/nightly/workspace/sources/wpewebkit/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp: In static member function 'static void WebCore::FEGaussianBlurSoftwareApplier::boxBlurUnaccelerated(JSC::Uint8ClampedArray&, JSC::Uint8ClampedArray&, unsigned int, unsigned int, int, WebCore::IntSize&, bool, WebCore::EdgeModeType)':
/nightly/workspace/sources/wpewebkit/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:304:17: error: 'boxBlurNEON' was not declared in this scope; did you mean 'boxBlur'?
  304 |                 boxBlurNEON(*fromBuffer, *toBuffer, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height());
      |                 ^~~~~~~~~~~
      |                 boxBlur
/nightly/workspace/sources/wpewebkit/Source/WebCore/platform/graphics/filters/software/FEGaussianBlurSoftwareApplier.cpp:317:17: error: 'boxBlurNEON' was not declared in this scope; did you mean 'boxBlur'?
  317 |                 boxBlurNEON(*fromBuffer, *toBuffer, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width());
      |                 ^~~~~~~~~~~
      |                 boxBlur




* In Source/WebCore/platform/graphics/filters/software/FEBlendSoftwareApplier.cpp: 

FAILED: lib/libWPEWebKit-1.0.so.3.17.0
: && /nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -fPIC -fdiagnostics-color=always -Wextra -Wall -Wno-expansion-to-defined -Wno-stringop-overread -Wno-nonnull -Wno-array-bounds -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Wdate-time  --sysroot=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot  -O2 -pipe  -feliminate-unused-debug-types -fmacro-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0=/usr/src/debug/wpewebkit/trunk+https999-r0                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0=/usr/src/debug/wpewebkit/trunk+https999-r0                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot=                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Wdate-time  --sysroot=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot -fno-strict-aliasing -fno-exceptions -fno-rtti -DNDEBUG  -Wl,--no-undefined -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0=/usr/src/debug/wpewebkit/trunk+https999-r0                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0=/usr/src/debug/wpewebkit/trunk+https999-r0                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot=                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now -fuse-ld=gold -Wl,--disable-new-dtags   -Wl,--version-script,/nightly/workspace/sources/wpewebkit/Source/WebKit/webkitglib-symbols.map -shared -Wl,-soname,libWPEWebKit-1.0.so.3 -o lib/libWPEWebKit-1.0.so.3.17.0 @CMakeFiles/WebKit.rsp  && :
lib/libWebCore.a(lib/../Source/WebCore/CMakeFiles/WebCore.dir/platform/graphics/filters/FEBlend.cpp.o):FEBlend.cpp:function WebCore::FEBlend::createSoftwareApplier() const: error: undefined reference to 'vtable for WebCore::FEBlendSoftwareApplier'
/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/11.2.0/ld.gold: the vtable symbol may be undefined because the class is missing its key function




* In Source/WebCore/platform/graphics/filters/software/FECompositeSoftwareApplier.cpp:

FAILED: lib/libWPEWebKit-1.0.so.3.17.0
: && /nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -fPIC -fdiagnostics-color=always -Wextra -Wall -Wno-expansion-to-defined -Wno-stringop-overread -Wno-nonnull -Wno-array-bounds -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Wdate-time  --sysroot=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot  -O2 -pipe  -feliminate-unused-debug-types -fmacro-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0=/usr/src/debug/wpewebkit/trunk+https999-r0                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0=/usr/src/debug/wpewebkit/trunk+https999-r0                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot=                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot-native=  -fvisibility-inlines-hidden  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Wdate-time  --sysroot=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot -fno-strict-aliasing -fno-exceptions -fno-rtti -DNDEBUG  -Wl,--no-undefined -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0=/usr/src/debug/wpewebkit/trunk+https999-r0                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0=/usr/src/debug/wpewebkit/trunk+https999-r0                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot=                      -fdebug-prefix-map=/nightly/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/wpewebkit/trunk+https999-r0/recipe-sysroot-native=  -Wl,-z,relro,-z,now -fuse-ld=gold -Wl,--disable-new-dtags   -Wl,--version-script,/nightly/workspace/sources/wpewebkit/Source/WebKit/webkitglib-symbols.map -shared -Wl,-soname,libWPEWebKit-1.0.so.3 -o lib/libWPEWebKit-1.0.so.3.17.0 @CMakeFiles/WebKit.rsp  && :
lib/libWebCore.a(lib/../Source/WebCore/CMakeFiles/WebCore.dir/platform/graphics/filters/software/FECompositeSoftwareApplier.cpp.o):FECompositeSoftwareApplier.cpp:function WebCore::FECompositeSoftwareApplier::applyArithmetic(WebCore::FilterImage&, WebCore::FilterImage&, WebCore::FilterImage&) const: error: undefined reference to 'WebCore::FECompositeSoftwareApplier::applyPlatformArithmetic(unsigned char*, unsigned char*, int, float, float, float, float)'
collect2: error: ld returned 1 exit status
Comment 3 Pablo Saavedra 2022-01-21 13:29:58 PST
Created attachment 449693 [details]
patch
Comment 4 Pablo Saavedra 2022-01-22 13:54:31 PST
Created attachment 449736 [details]
patch
Comment 5 Pablo Saavedra 2022-01-22 13:57:07 PST
Sorry Simon the previous patch was incomplete. I added a newest version addressing all the build errors mentioned in comment #2
Comment 6 Pablo Saavedra 2022-01-22 13:58:42 PST
Created attachment 449737 [details]
patch
Comment 7 EWS 2022-01-25 09:36:06 PST
Committed r288559 (246389@main): <https://commits.webkit.org/246389@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449737 [details].
Comment 8 Radar WebKit Bug Importer 2022-01-25 09:37:37 PST
<rdar://problem/88028497>
Comment 9 Said Abou-Hallawa 2022-01-25 14:06:46 PST
I do not think the approach of this patch is correct. I am not very familiar with the code under 

#if HAVE(ARM_NEON_INTRINSICS)
#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC_COMPATIBLE)

But my understanding is this code is an optimization for some arm7 platform. But since we do not have a bot for it, I even thought about removing it altogether. See bug 233500.

This patch directs the code to the software applier which may not be suitable for this "unknown" platform. If you have a way to compile this code for this platform, I would suggest the following:

1. Add new class FEBlendNeonApplier under Source/WebCore/platform/graphics/cpu/arm/filters/ which should be similar to FEBlendSoftwareApplier.

2. Move the code in the deleted function FEBlend::platformApplySoftware() to FEBlendNeonApplier::apply().

3. Make this change

std::unique_ptr<FilterEffectApplier> FEBlend::createSoftwareApplier() const
{
#if HAVE(ARM_NEON_INTRINSICS)
    return FilterEffectApplier::create<FEBlendNeonApplier>(*this);
#else
    return FilterEffectApplier::create<FEBlendSoftwareApplier>(*this);
#endif
}