<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>271371</bug_id>
          
          <creation_ts>2024-03-21 03:14:30 -0700</creation_ts>
          <short_desc>[RISCV64] /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Validate.cpp:457:43: error: ‘toB3Type’ was not declared in this scope</short_desc>
          <delta_ts>2025-01-07 14:33:35 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk, Regression</keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andreas Schwab">schwab</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>berto</cc>
    
    <cc>cgarcia</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>michael</cc>
    
    <cc>thomas.perrot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2022693</commentid>
    <comment_count>0</comment_count>
    <who name="Andreas Schwab">schwab</who>
    <bug_when>2024-03-21 03:14:30 -0700</bug_when>
    <thetext>FAILED: Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-23a5fd0e-9.cpp.o 
/usr/bin/ccache /var/lib/build/ccache/bin/c++ -DBUILDING_GTK__=1 -DBUILDING_JavaScriptCore -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1 -DBWRAP_EXECUTABLE=\&quot;/usr/bin/bwrap\&quot; -DDBUS_PROXY_EXECUTABLE=\&quot;/usr/bin/xdg-dbus-proxy\&quot; -DGETTEXT_PACKAGE=\&quot;WebKitGTK-6.0\&quot; -DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DJavaScriptCore_EXPORTS -DPAS_BMALLOC=1 -DSTATICALLY_LINKED_WITH_WTF -DSTATICALLY_LINKED_WITH_bmalloc -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCore/Headers -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/API -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/assembler -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3 -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/air -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/bindings -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/builtins -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/bytecode -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/bytecompiler -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/dfg -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/disassembler -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/disassembler/ARM64 -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/disassembler/zydis/Zydis -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/domjit -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/ftl -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/fuzzilli -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/heap -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/debugger -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/inspector -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/inspector/agents -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/inspector/augmentable -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/inspector/remote -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/interpreter -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/jit -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/llint -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/parser -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/profiler -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/runtime -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/tools -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/wasm -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/wasm/js -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/yarr -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCore/DerivedSources -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCore/DerivedSources/inspector -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCore/DerivedSources/runtime -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCore/DerivedSources/yarr -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/API/glib -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCoreGLib/DerivedSources -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCoreGLib/DerivedSources/jsc -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCoreGLib/Headers -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/inspector/remote/glib -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/WTF/Headers -I/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/bmalloc/Headers -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -fdiagnostics-color=always -Wextra -Wall -pipe -fmax-errors=20 -Wno-odr -Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -fno-strict-aliasing -fno-exceptions -fno-rtti -O3 -DNDEBUG -std=c++20 -fPIC -fvisibility=hidden -ffp-contract=off -MD -MT Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-23a5fd0e-9.cpp.o -MF Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-23a5fd0e-9.cpp.o.d -o Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-23a5fd0e-9.cpp.o -c /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-23a5fd0e-9.cpp
In file included from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/assembler/MacroAssembler.h:81,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/jit/GPRInfo.h:28,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Common.h:31,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Type.h:30,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Bank.h:30,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Value.h:30,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3SwitchValue.h:32,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3SwitchValue.cpp:27,
                 from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-23a5fd0e-9.cpp:1:
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h: In member function ‘void JSC::MacroAssemblerRISCV64::testFinalize(ResultCondition, JSC::AbstractMacroAssembler&lt;JSC::RISCV64Assembler&gt;::RegisterID, JSC::AbstractMacroAssembler&lt;JSC::RISCV64Assembler&gt;::RegisterID)’:
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/assembler/MacroAssemblerRISCV64.h:4438:16: warning: enumeration value ‘Carry’ not handled in switch [-Wswitch]
 4438 |         switch (cond) {
      |                ^
In file included from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-23a5fd0e-9.cpp:6:
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Validate.cpp: In member function ‘void JSC::B3::{anonymous}::Validater::run()’:
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Validate.cpp:457:43: error: ‘toB3Type’ was not declared in this scope
  457 |                 VALIDATE(value-&gt;type() == toB3Type(Wasm::simdScalarType(value-&gt;asSIMDValue()-&gt;simdLane())), (&quot;At &quot;, *value));
      |                                           ^~~~~~~~
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Validate.cpp:63:13: note: in definition of macro ‘VALIDATE’
   63 |         if (condition)                                                  \
      |             ^~~~~~~~~
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Validate.cpp:465:53: error: ‘toB3Type’ was not declared in this scope
  465 |                 VALIDATE(value-&gt;child(1)-&gt;type() == toB3Type(Wasm::simdScalarType(value-&gt;asSIMDValue()-&gt;simdLane())), (&quot;At &quot;, *value));
      |                                                     ^~~~~~~~
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Validate.cpp:63:13: note: in definition of macro ‘VALIDATE’
   63 |         if (condition)                                                  \
      |             ^~~~~~~~~
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Validate.cpp:487:53: error: ‘toB3Type’ was not declared in this scope
  487 |                 VALIDATE(value-&gt;child(0)-&gt;type() == toB3Type(Wasm::simdScalarType(value-&gt;asSIMDValue()-&gt;simdLane())), (&quot;At &quot;, *value));
      |                                                     ^~~~~~~~
/home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/JavaScriptCore/b3/B3Validate.cpp:63:13: note: in definition of macro ‘VALIDATE’
   63 |         if (condition)                                                  \
      |             ^~~~~~~~~</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2028477</commentid>
    <comment_count>1</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2024-04-15 04:38:36 -0700</bug_when>
    <thetext>FYI until this is fixed you can work around the problem and build WebKitGTK for riscv with this patch: https://salsa.debian.org/webkit-team/webkit/-/raw/debian/2.44.1-1/debian/patches/fix-ftbfs-riscv64.patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2028559</commentid>
    <comment_count>2</comment_count>
    <who name="Andreas Schwab">schwab</who>
    <bug_when>2024-04-15 11:09:37 -0700</bug_when>
    <thetext>Workaround is configuring with ENABLE_JIT=OFF</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2028610</commentid>
    <comment_count>3</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2024-04-15 14:34:17 -0700</bug_when>
    <thetext>(In reply to Andreas Schwab from comment #2)
&gt; Workaround is configuring with ENABLE_JIT=OFF

Oh ok, I&apos;d swear that I tried that first... thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2038791</commentid>
    <comment_count>4</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2024-05-30 09:33:44 -0700</bug_when>
    <thetext>&gt; Workaround is configuring with ENABLE_JIT=OFF

This does not work for me, see also bug 274826.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2053575</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2024-08-18 09:52:25 -0700</bug_when>
    <thetext>Came to report the same thing in 2.44.3. It looks possibly related to https://bugs.launchpad.net/ubuntu/+source/webkit2gtk/+bug/2008798</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2084236</commentid>
    <comment_count>6</comment_count>
    <who name="">thomas.perrot</who>
    <bug_when>2024-12-30 01:01:44 -0800</bug_when>
    <thetext>Hello,

The same issue occurs in version 2.46.5, and the workaround (e.g., ENABLE_JIT=OFF) doesn&apos;t work.

Kind regards,
Thomas</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2084248</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2024-12-30 06:33:43 -0800</bug_when>
    <thetext>(In reply to thomas.perrot from comment #6)
&gt; Hello,
&gt; 
&gt; The same issue occurs in version 2.46.5, and the workaround (e.g.,
&gt; ENABLE_JIT=OFF) doesn&apos;t work.

Even if you fix this, you will hit at least two other build failures on risc-v.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085005</commentid>
    <comment_count>8</comment_count>
    <who name="">thomas.perrot</who>
    <bug_when>2025-01-06 01:33:58 -0800</bug_when>
    <thetext>Hello Michael,

Yes, I attempted to fix it, but other build failures occurred. Do you have a plan to address the RISC-V issues?

Kind regards,
Thomas</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085545</commentid>
    <comment_count>9</comment_count>
    <who name="Andreas Schwab">schwab</who>
    <bug_when>2025-01-07 12:31:58 -0800</bug_when>
    <thetext>What are those failures?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085574</commentid>
    <comment_count>10</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2025-01-07 14:27:38 -0800</bug_when>
    <thetext>(In reply to thomas.perrot from comment #8)
&gt; Hello Michael,
&gt; 
&gt; Yes, I attempted to fix it, but other build failures occurred. Do you have a
&gt; plan to address the RISC-V issues?

I&apos;m not in charge :)

There are PRs for some of them on Github if you search for riscv or risc-v. There&apos;s also the OpenBSD ports repo which has patches for several of the outstanding issues. But even if I apply every available patch, there are build failures that I don&apos;t know how to solve.

At one point I was able to get a stable release to build, but then it would crash at runtime on javascript-heavy pages. I have riscv hardware and can debug them, but the problem then becomes, how do I report the crash when it requires a random assortment of unofficial patches from multiple sources before it will even compile? (And will anybody fix them?)

I think eventually we should try to get a riscv machine (even if it&apos;s a VM) added to the CI, but before we can do that, it has to build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085575</commentid>
    <comment_count>11</comment_count>
    <who name="Michael Orlitzky">michael</who>
    <bug_when>2025-01-07 14:33:35 -0800</bug_when>
    <thetext>(In reply to Andreas Schwab from comment #9)
&gt; What are those failures?

It depends on if you&apos;re using the stable releases or git, but there&apos;s no shortage of them. Here&apos;s the next two I hit with 2.46.5,

 * https://bugs.webkit.org/show_bug.cgi?id=282677
 * https://bugs.webkit.org/show_bug.cgi?id=282898

using the cmake JIT args,

    -DENABLE_JIT=ON
    -DENABLE_WEBASSEMBLY=OFF
    -DENABLE_FTL_JIT=OFF

After patching those two, there&apos;s another...</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>