<?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>172799</bug_id>
          
          <creation_ts>2017-06-01 02:37:59 -0700</creation_ts>
          <short_desc>[GTK] [2.17.3] Fails to build in x86</short_desc>
          <delta_ts>2018-08-31 06:30:07 -0700</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>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alberto Garcia">berto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>clopez</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1314563</commentid>
    <comment_count>0</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2017-06-01 02:37:59 -0700</bug_when>
    <thetext>x86_64 builds fine, but I&apos;m having this error when trying to build it for x86:

In file included from /tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/interpreter/CallFrame.h:26:0,
                 from /tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/runtime/ClassInfo.h:25,
                 from /tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/runtime/Structure.h:28,
                 from /tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/runtime/ArrayStorage.h:33,
                 from /tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/runtime/ButterflyInlines.h:28,
                 from /tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/runtime/JSArray.h:24,
                 from /tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/bytecode/ArrayProfile.h:29,
                 from /tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
/tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/interpreter/CalleeBits.h: In static member function &apos;static void* JSC::CalleeBits::boxWasm(JSC::Wasm::Callee*)&apos;:
/tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/interpreter/CalleeBits.h:54:81: error: &apos;TagBitsWasm&apos; was not declared in this scope
         CalleeBits result(bitwise_cast&lt;void*&gt;(bitwise_cast&lt;uintptr_t&gt;(callee) | TagBitsWasm));
                                                                                 ^~~~~~~~~~~
/tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/interpreter/CalleeBits.h: In member function &apos;bool JSC::CalleeBits::isWasm() const&apos;:
/tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/interpreter/CalleeBits.h:63:50: error: &apos;TagWasmMask&apos; was not declared in this scope
         return (bitwise_cast&lt;uintptr_t&gt;(m_ptr) &amp; TagWasmMask) == TagBitsWasm;
                                                  ^~~~~~~~~~~
/tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/interpreter/CalleeBits.h:63:66: error: &apos;TagBitsWasm&apos; was not declared in this scope
         return (bitwise_cast&lt;uintptr_t&gt;(m_ptr) &amp; TagWasmMask) == TagBitsWasm;
                                                                  ^~~~~~~~~~~
/tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/interpreter/CalleeBits.h: In member function &apos;JSC::Wasm::Callee* JSC::CalleeBits::asWasmCallee() const&apos;:
/tmp/webkit2gtk-2.17.3/Source/JavaScriptCore/interpreter/CalleeBits.h:80:78: error: &apos;TagBitsWasm&apos; was not declared in this scope
         return bitwise_cast&lt;Wasm::Callee*&gt;(bitwise_cast&lt;uintptr_t&gt;(m_ptr) &amp; ~TagBitsWasm);
                                                                              ^~~~~~~~~~~
Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/build.make:99: recipe for target &apos;Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/llint/LLIntOffsetsExtractor.cpp.o&apos; failed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1314569</commentid>
    <comment_count>1</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2017-06-01 04:09:13 -0700</bug_when>
    <thetext>I think that the reason is that I&apos;m building this on an x86_64 machine using an i386 chroot.

In CMakeLists.txt, CMAKE_SYSTEM_PROCESSOR is defined by CMake using (I believe) &quot;uname -m&quot;, which is x86_64 (the host CPU).

if (MSVC_CXX_ARCHITECTURE_ID)
    string(TOLOWER ${MSVC_CXX_ARCHITECTURE_ID} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
else ()
    string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
endif ()
if (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES &quot;^arm&quot;)
    set(WTF_CPU_ARM 1)
   [...]
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES &quot;(x64|x86_64|amd64)&quot;)
    set(WTF_CPU_X86_64 1)
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES &quot;(i[3-6]86|x86)&quot;)
    set(WTF_CPU_X86 1)
   [...]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1314580</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2017-06-01 05:00:46 -0700</bug_when>
    <thetext>(In reply to Alberto Garcia from comment #1)
&gt; I think that the reason is that I&apos;m building this on an x86_64 machine using
&gt; an i386 chroot.
&gt; 
&gt; In CMakeLists.txt, CMAKE_SYSTEM_PROCESSOR is defined by CMake using (I
&gt; believe) &quot;uname -m&quot;, which is x86_64 (the host CPU).
&gt; 
&gt; if (MSVC_CXX_ARCHITECTURE_ID)
&gt;     string(TOLOWER ${MSVC_CXX_ARCHITECTURE_ID}
&gt; LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
&gt; else ()
&gt;     string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR}
&gt; LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
&gt; endif ()
&gt; if (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES &quot;^arm&quot;)
&gt;     set(WTF_CPU_ARM 1)
&gt;    [...]
&gt; elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES &quot;(x64|x86_64|amd64)&quot;)
&gt;     set(WTF_CPU_X86_64 1)
&gt; elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES &quot;(i[3-6]86|x86)&quot;)
&gt;     set(WTF_CPU_X86 1)
&gt;    [...]

Passing “-m32” to the compiler under x86_64 is equivalent to
cross-compiling. When cross-compiling using CMake one is supposed
to supply a “toolchain file” which defines a few things, including
the value for CMAKE_SYSTEM_PROCESSOR _for the target system_ (x86
in your case). See: https://cmake.org/Wiki/CMake_Cross_Compiling

Now, having to provide a complete toolchain file sounds like a chore,
but IIUC from the CMake documentation, you can as well pass the
variables directly to the CMake invocation, and you could get away
with something like:

  cmake path/to/sources -DCMAKE_SYSTEM_PROCESSOR=i686 ...

In general CMake won&apos;t use the built-in default values for variables
defined in the command line.

I hope this helps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1314584</commentid>
    <comment_count>3</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2017-06-01 05:10:54 -0700</bug_when>
    <thetext>(In reply to Adrian Perez from comment #2)
&gt; Passing “-m32” to the compiler under x86_64 is equivalent to
&gt; cross-compiling.

I&apos;m not doing that, I&apos;m using a native 32-bit compiler. Everything
inside the chroot is 32bit, just the kernel is 64bit.

&gt; Now, having to provide a complete toolchain file sounds like a chore,
&gt; but IIUC from the CMake documentation, you can as well pass the
&gt; variables directly to the CMake invocation, and you could get away
&gt; with something like:
&gt;
&gt;   cmake path/to/sources -DCMAKE_SYSTEM_PROCESSOR=i686 ...

Passing -DCMAKE_SYSTEM_PROCESSOR=XXX doesn&apos;t seem to solve the
problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1314594</commentid>
    <comment_count>4</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2017-06-01 06:53:23 -0700</bug_when>
    <thetext>I confirm that using CMAKE_CXX_LIBRARY_ARCHITECTURE instead of CMAKE_SYSTEM_PROCESSOR solves the problem.

I&apos;m not sure if that&apos;s a good solution for all platforms supported by WebKit, so I can keep it as a Debian-specific workaround while we don&apos;t have the proper fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426154</commentid>
    <comment_count>5</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2018-05-22 07:54:00 -0700</bug_when>
    <thetext>Is this still an issue? I can successfully build webkit in an i386 container/schroot with Debian and as well cross-compile for i686 with Yocto (on an x86_64 host).

Are you setting a 32 bit personality before starting the build?

&quot;uname -m&quot; should return i686.

If you use schroot you can set &quot;personality=linux32&quot; on the schroot config.

If you use a raw chroot then you can prefix the build script/command with the &quot;linux32&quot; command.

Example:

$ uname -m
x86_64

$ linux32 uname -m
i686</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426155</commentid>
    <comment_count>6</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2018-05-22 07:56:47 -0700</bug_when>
    <thetext>(In reply to Carlos Alberto Lopez Perez from comment #5)

&gt; If you use a raw chroot then you can prefix the build script/command with
&gt; the &quot;linux32&quot; command.
&gt; 
&gt; Example:
&gt; 
&gt; $ uname -m
&gt; x86_64
&gt; 
&gt; $ linux32 uname -m
&gt; i686

Or better... prefix the chroot command before entering into it so everything you execute into the container has the right personality by default:

$ sudo linux32 chroot container_i386</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1426168</commentid>
    <comment_count>7</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2018-05-22 08:52:20 -0700</bug_when>
    <thetext>(In reply to Carlos Alberto Lopez Perez from comment #5)
&gt; If you use a raw chroot then you can prefix the build script/command
&gt; with the &quot;linux32&quot; command.

Ok, I didn&apos;t know that. Not sure how that would work with the Debian
buildds, I need to see what&apos;s the current status.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>