<?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>266218</bug_id>
          
          <creation_ts>2023-12-11 05:51:11 -0800</creation_ts>
          <short_desc>[GTK] webkitgtk 2.43.2 fails to build on riscv64 JavaScriptCore/offlineasm/riscv64.rb</short_desc>
          <delta_ts>2024-12-11 01:25:36 -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>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeremy Bicha">jbicha</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>berto</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>david.abd+webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1998607</commentid>
    <comment_count>0</comment_count>
    <who name="Jeremy Bicha">jbicha</who>
    <bug_when>2023-12-11 05:51:11 -0800</bug_when>
    <thetext>webkitgtk 2.43.2 (and 2.43.1) fails to build on Debian and Ubuntu&apos;s riscv64 but seems to build ok on other architectures.


/Source/JavaScriptCore/offlineasm/riscv64.rb:132:in `riscv64RaiseMismatchedOperands&apos;:
 Unable to match operands [RegisterID, RegisterID, LabelReference] (due to LowLevelInterpreter64.asm:258) (LoweringError)

Full build log
==============
Click Build-Attempted at https://buildd.debian.org/status/package.php?p=webkit2gtk&amp;suite=experimental (or click old, then in the result column to see other versions)

Build log excerpt
=================
[1461/6943] cd /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources &amp;&amp; /usr/bin/cmake -E
 env CMAKE_CXX_COMPILER_ID=GNU GCC_OFFLINEASM_SOURCE_MAP=OFF /usr/bin/ruby
 /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb -I/&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/
 /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
 /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/bin/LLIntOffsetsExtractor /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/LLIntAssembly.h
 normal --binary-format=ELF &amp;&amp; /usr/bin/cmake -E touch_nocreate /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/LLIntAssembly.h
FAILED: JavaScriptCore/DerivedSources/LLIntAssembly.h /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/LLIntAssembly.h 
cd /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources &amp;&amp; /usr/bin/cmake -E env CMAKE_CXX_COMPILER_ID=GNU
 GCC_OFFLINEASM_SOURCE_MAP=OFF /usr/bin/ruby /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb
 -I/&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/ /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
 /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/bin/LLIntOffsetsExtractor /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/LLIntAssembly.h
 normal --binary-format=ELF &amp;&amp; /usr/bin/cmake -E touch_nocreate /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/LLIntAssembly.h
/&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/riscv64.rb:132:in `riscv64RaiseMismatchedOperands&apos;:
 Unable to match operands [RegisterID, RegisterID, LabelReference] (due to LowLevelInterpreter64.asm:258) (LoweringError)
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/riscv64.rb:136:in `riscv64ValidateOperands&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/riscv64.rb:1627:in `lowerRISCV64&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/backends.rb:137:in `lower&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/backends.rb:195:in `block in lower&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/backends.rb:193:in `each&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/backends.rb:193:in `lower&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:443:in `block (5 levels) in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:102:in `inAsm&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:442:in `block (4 levels) in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/settings.rb:210:in `emitCodeInConfiguration&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:440:in `block (3 levels) in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/settings.rb:107:in `forSettings&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:425:in `block (2 levels) in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:421:in `each&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:421:in `block in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:405:in `open&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:405:in `&lt;main&gt;&apos;
/&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/riscv64.rb:132:in `riscv64RaiseMismatchedOperands&apos;:
 Unable to match operands [RegisterID, RegisterID, LabelReference] (RuntimeError)
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/riscv64.rb:136:in `riscv64ValidateOperands&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/riscv64.rb:1627:in `lowerRISCV64&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/backends.rb:137:in `lower&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/backends.rb:195:in `block in lower&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/backends.rb:193:in `each&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/backends.rb:193:in `lower&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:443:in `block (5 levels) in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:102:in `inAsm&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:442:in `block (4 levels) in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/settings.rb:210:in `emitCodeInConfiguration&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:440:in `block (3 levels) in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/settings.rb:107:in `forSettings&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:425:in `block (2 levels) in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:421:in `each&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:421:in `block in &lt;main&gt;&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:405:in `open&apos;
	from /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/asm.rb:405:in `&lt;main&gt;&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1998610</commentid>
    <comment_count>1</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2023-12-11 06:01:48 -0800</bug_when>
    <thetext>*** Bug 265082 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1999096</commentid>
    <comment_count>2</comment_count>
    <who name="Jeremy Bicha">jbicha</who>
    <bug_when>2023-12-12 15:01:42 -0800</bug_when>
    <thetext>In an attempt to work around this issue since I eventually need webkitgtk 2.43 to build on Ubuntu&apos;s riscv64, I did a build with
-DENABLE_JIT=OFF -DENABLE_C_LOOP=ON -DENABLE_WEBASSEMBLY=OFF

This also caused the build to fail:

[1363/6942] cd /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/Source/JavaScriptCore &amp;&amp; /usr/bin/ruby /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb -I/&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/ /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/llint/LowLevelInterpreter.asm /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/bin/LLIntSettingsExtractor /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/LLIntDesiredOffsets.h C_LOOP normal
FAILED: JavaScriptCore/DerivedSources/LLIntDesiredOffsets.h /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/LLIntDesiredOffsets.h 
cd /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/Source/JavaScriptCore &amp;&amp; /usr/bin/ruby /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb -I/&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/ /&lt;&lt;PKGBUILDDIR&gt;&gt;/Source/JavaScriptCore/llint/LowLevelInterpreter.asm /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/bin/LLIntSettingsExtractor /&lt;&lt;PKGBUILDDIR&gt;&gt;/build-soup2/JavaScriptCore/DerivedSources/LLIntDesiredOffsets.h C_LOOP normal
LowLevelInterpreter.asm:2778 in call to entry: Could not find macro entry (MacroError)

Full build log at
https://launchpad.net/~jbicha/+archive/ubuntu/arch2/+sourcepub/15534909/+listing-archive-extra</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2001817</commentid>
    <comment_count>3</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2023-12-24 08:21:17 -0800</bug_when>
    <thetext>This is still broken, so we decided to work around this downstream in Debian by using WTF_CPU_UNKNOWN in riscv64.

https://salsa.debian.org/webkit-team/webkit/-/raw/debian/2.43.3-1/debian/patches/fix-ftbfs-riscv64.patch?ref_type=tags</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010466</commentid>
    <comment_count>4</comment_count>
    <who name="Lu Yahan">luyahan</who>
    <bug_when>2024-02-03 22:02:25 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/23829</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010471</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-02-03 23:40:34 -0800</bug_when>
    <thetext>Committed 274066@main (6b46c24db814): &lt;https://commits.webkit.org/274066@main&gt;

Reviewed commits have been landed. Closing PR #23829 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2080781</commentid>
    <comment_count>6</comment_count>
    <who name="">david.abd+webkit</who>
    <bug_when>2024-12-11 01:25:36 -0800</bug_when>
    <thetext>FYI, there seems to be another similar compilation error: https://bugs.webkit.org/show_bug.cgi?id=284361</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>