<?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>106004</bug_id>
          
          <creation_ts>2013-01-03 00:58:07 -0800</creation_ts>
          <short_desc>build fails - MathExtras.h on Solaris using gcc</short_desc>
          <delta_ts>2017-03-11 11:02:58 -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>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>richard</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>berto</cc>
    
    <cc>bugs-noreply</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>799300</commentid>
    <comment_count>0</comment_count>
    <who name="">richard</who>
    <bug_when>2013-01-03 00:58:07 -0800</bug_when>
    <thetext>reference https://bugs.webkit.org/show_bug.cgi?id=41953
and http://article.gmane.org/gmane.os.opendarwin.webkit.gtk/1317

When building on solaris with gcc (4.7.x), e.g. using pkgsrc, the build will fail with the following:

GEN    DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h
offlineasm: Parsing ./Source/JavaScriptCore/llint/LowLevelInterpreter.asm and creating offset extractor DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h.
offlineasm: Including file ./Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
offlineasm: Including file ./Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
offlineasm: offset extractor DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h successfully generated.
  CXX Source/JavaScriptCore/llint/Programs_LLIntOffsetsExtractor-LLIntOffsetsExtractor.o
In file included from ./Source/JavaScriptCore/runtime/JSValue.h:33:0,
                 from ./Source/JavaScriptCore/runtime/CachedTranscendentalFunction.h:29,
                 from ./Source/JavaScriptCore/runtime/JSGlobalData.h:32,
                 from ./Source/JavaScriptCore/interpreter/CallFrame.h:27,
                 from ./Source/JavaScriptCore/runtime/ArgList.h:25,
                 from ./Source/JavaScriptCore/runtime/JSObject.h:26,
                 from ./Source/JavaScriptCore/runtime/JSArray.h:24,
                 from ./Source/JavaScriptCore/bytecode/ArrayProfile.h:29,
                 from Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
./Source/WTF/wtf/MathExtras.h: In function &apos;void doubleToInteger(double, long long unsigned int&amp;)&apos;:
./Source/WTF/wtf/MathExtras.h:349:16: error: &apos;isnan&apos; was not declared in this scope
./Source/WTF/wtf/MathExtras.h:349:16: note: suggested alternative:
In file included from ./Source/WTF/wtf/MathExtras.h:30:0,
                 from ./Source/JavaScriptCore/runtime/JSValue.h:33,
                 from ./Source/JavaScriptCore/runtime/CachedTranscendentalFunction.h:29,
                 from ./Source/JavaScriptCore/runtime/JSGlobalData.h:32,
                 from ./Source/JavaScriptCore/interpreter/CallFrame.h:27,
                 from ./Source/JavaScriptCore/runtime/ArgList.h:25,
                 from ./Source/JavaScriptCore/runtime/JSObject.h:26,
                 from ./Source/JavaScriptCore/runtime/JSArray.h:24,
                 from ./Source/JavaScriptCore/bytecode/ArrayProfile.h:29,
                 from Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp:28:
/opt/pkg/gcc47/include/c++/cmath:839:5: note:   &apos;std::isnan&apos;
gmake: *** [Source/JavaScriptCore/llint/Programs_LLIntOffsetsExtractor-LLIntOffsetsExtractor.o] Error 1
*** Error code 2

Stop.
bmake: stopped in /home/richard/src/pkgsrc/www/webkit-gtk3
*** Error code 1

Stop.
bmake: stopped in /home/richard/src/pkgsrc/www/webkit-gtk3


After finding the previous bug referenced above, I notice that the solaris check is inappropriate as implemented.
SunStudio defines __SUNPRO_CC... so this check should be added in addition to the solaris check.

Here is my patch (using 1.10.2 source kit):

diff --git a/www/webkit-gtk/patches/patch-Source_WTF_wtf_MathExtras.h 
 b/www/webkit-gtk/patches/patch-Source_WTF_wtf_MathExtras.h
 new file mode 100644
 index 0000000..7ab4e16
 --- /dev/null
 +++ b/www/webkit-gtk/patches/patch-Source_WTF_wtf_MathExtras.h
 @@ -0,0 +1,13 @@
 +$NetBSD$
 +
 +--- Source/WTF/wtf/MathExtras.h.orig	2012-11-23 20:12:16.000000000 +0000
 ++++ Source/WTF/wtf/MathExtras.h
 +@@ -288,7 +288,7 @@ inline bool isWithinIntRange(float x)
 +     return x &gt; static_cast&lt;float&gt;(std::numeric_limits&lt;int&gt;::min()) &amp;&amp; 
 x &lt; static_cast&lt;float&gt;(std::numeric_limits&lt;int&gt;::max());
 + }
 +
 +-#if !COMPILER(MSVC) &amp;&amp; !COMPILER(RVCT) &amp;&amp; !OS(SOLARIS)
 ++#if !COMPILER(MSVC) &amp;&amp; !COMPILER(RVCT) &amp;&amp; !(OS(SOLARIS) &amp;&amp; 
 defined(__SUNPRO_CC))
 + using std::isfinite;
 + #if !COMPILER_QUIRK(GCC11_GLOBAL_ISINF_ISNAN)
 + using std::isinf;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>926659</commentid>
    <comment_count>1</comment_count>
    <who name="Alberto Garcia">berto</who>
    <bug_when>2013-09-09 05:21:53 -0700</bug_when>
    <thetext>This code changed a bit since http://trac.webkit.org/changeset/143232

Is this problem still there? If so, can you post a new patch? Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>