<?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>140143</bug_id>
          
          <creation_ts>2015-01-06 13:27:03 -0800</creation_ts>
          <short_desc>Source/WTF/wtf/OSAllocatorPosix.cpp fails to build on OS X Leopard due to madvise() extensions not being available</short_desc>
          <delta_ts>2015-01-08 12:55:23 -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>Web Template Framework</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Jeremy Huddleston Sequoia">jeremyhu</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>mrobinson</cc>
    
    <cc>ossy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1059136</commentid>
    <comment_count>0</comment_count>
    <who name="Jeremy Huddleston Sequoia">jeremyhu</who>
    <bug_when>2015-01-06 13:27:03 -0800</bug_when>
    <thetext>Compilation of webkit-gtk-2.4.7 fails on OS X Leopard:

:info:build Source/WTF/wtf/OSAllocatorPosix.cpp:54:35: error: use of undeclared identifier &apos;MADV_FREE_REUSABLE&apos;
:info:build     while (madvise(result, bytes, MADV_FREE_REUSABLE) == -1 &amp;&amp; errno == EAGAIN) { }
:info:build                                   ^
:info:build Source/WTF/wtf/OSAllocatorPosix.cpp:139:36: error: use of undeclared identifier &apos;MADV_FREE_REUSE&apos;
:info:build     while (madvise(address, bytes, MADV_FREE_REUSE) == -1 &amp;&amp; errno == EAGAIN) { }
:info:build                                    ^
:info:build Source/WTF/wtf/OSAllocatorPosix.cpp:156:36: error: use of undeclared identifier &apos;MADV_FREE_REUSABLE&apos;
:info:build     while (madvise(address, bytes, MADV_FREE_REUSABLE) == -1 &amp;&amp; errno == EAGAIN) { }
:info:build                                    ^
:info:build 3 errors generated.
:info:build GNUmakefile:52455: recipe for target &apos;Source/WTF/wtf/libWTF_la-OSAllocatorPosix.lo&apos; failed
:info:build gmake: *** [Source/WTF/wtf/libWTF_la-OSAllocatorPosix.lo] Error 1

This happens because Leopard does not support:

#define MADV_ZERO_WIRED_PAGES   6       /* zero the wired pages that have not been unwired before the entry is deleted */
#define MADV_FREE_REUSABLE      7       /* pages can be reused (by anyone) */
#define MADV_FREE_REUSE         8       /* caller wants to reuse those pages */
#define MADV_CAN_REUSE          9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1059139</commentid>
    <comment_count>1</comment_count>
    <who name="Jeremy Huddleston Sequoia">jeremyhu</who>
    <bug_when>2015-01-06 13:29:57 -0800</bug_when>
    <thetext>It looks like the code is guarded:

#elif HAVE(MADV_FREE_REUSE)
    while (madvise(address, bytes, MADV_FREE_REUSABLE) == -1 &amp;&amp; errno == EAGAIN) { }

so the issue is that HAVE(MADV_FREE_REUSE) is not working right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1059145</commentid>
    <comment_count>2</comment_count>
    <who name="Jeremy Huddleston Sequoia">jeremyhu</who>
    <bug_when>2015-01-06 13:44:36 -0800</bug_when>
    <thetext>I&apos;m testing a patch of Platform.h for Leopard now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1059915</commentid>
    <comment_count>3</comment_count>
      <attachid>244284</attachid>
    <who name="Jeremy Huddleston Sequoia">jeremyhu</who>
    <bug_when>2015-01-08 12:54:34 -0800</bug_when>
    <thetext>Created attachment 244284
Fix Platform.h for Leopard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1059917</commentid>
    <comment_count>4</comment_count>
      <attachid>244285</attachid>
    <who name="Jeremy Huddleston Sequoia">jeremyhu</who>
    <bug_when>2015-01-08 12:55:03 -0800</bug_when>
    <thetext>Created attachment 244285
Fix malloc struct for Leopard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1059919</commentid>
    <comment_count>5</comment_count>
    <who name="Jeremy Huddleston Sequoia">jeremyhu</who>
    <bug_when>2015-01-08 12:55:23 -0800</bug_when>
    <thetext>With these two patches, webkit-gtk builds correctly against the Leopard SDK.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>244284</attachid>
            <date>2015-01-08 12:54:34 -0800</date>
            <delta_ts>2015-01-08 12:54:34 -0800</delta_ts>
            <desc>Fix Platform.h for Leopard</desc>
            <filename>leopard-platform.patch</filename>
            <type>text/plain</type>
            <size>532</size>
            <attacher name="Jeremy Huddleston Sequoia">jeremyhu</attacher>
            
              <data encoding="base64">LS0tIFNvdXJjZS9XVEYvd3RmL1BsYXRmb3JtLmgub3JpZwkyMDE1LTAxLTA2IDEzOjMwOjUyLjAw
MDAwMDAwMCAtMDgwMAorKysgU291cmNlL1dURi93dGYvUGxhdGZvcm0uaAkyMDE1LTAxLTA2IDEz
OjQyOjE1LjAwMDAwMDAwMCAtMDgwMApAQCAtNTg3LDExICs1ODcsMTQgQEAKIAogI2lmIE9TKERB
UldJTikKIAorI2lmIF9fTUFDX09TX1hfVkVSU0lPTl9NSU5fUkVRVUlSRUQgPj0gMTA2MCB8fCBQ
TEFURk9STShJT1MpCiAjZGVmaW5lIEhBVkVfRElTUEFUQ0hfSCAxCi0jZGVmaW5lIEhBVkVfTUFE
Vl9GUkVFIDEKICNkZWZpbmUgSEFWRV9NQURWX0ZSRUVfUkVVU0UgMQotI2RlZmluZSBIQVZFX01F
UkdFU09SVCAxCiAjZGVmaW5lIEhBVkVfUFRIUkVBRF9TRVROQU1FX05QIDEKKyNlbmRpZgorCisj
ZGVmaW5lIEhBVkVfTUFEVl9GUkVFIDEKKyNkZWZpbmUgSEFWRV9NRVJHRVNPUlQgMQogI2RlZmlu
ZSBIQVZFX1JFQURMSU5FIDEKICNkZWZpbmUgSEFWRV9TWVNfVElNRUJfSCAxCiAjZGVmaW5lIFdU
Rl9VU0VfQUNDRUxFUkFURSAxCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>244285</attachid>
            <date>2015-01-08 12:55:03 -0800</date>
            <delta_ts>2015-01-08 12:55:03 -0800</delta_ts>
            <desc>Fix malloc struct for Leopard</desc>
            <filename>leopard-malloc.patch</filename>
            <type>text/plain</type>
            <size>864</size>
            <attacher name="Jeremy Huddleston Sequoia">jeremyhu</attacher>
            
              <data encoding="base64">LS0tIFNvdXJjZS9XVEYvd3RmL0Zhc3RNYWxsb2MuY3BwLm9yaWcJMjAxNS0wMS0wNyAxNjowNDoz
MS4wMDAwMDAwMDAgLTA4MDAKKysrIFNvdXJjZS9XVEYvd3RmL0Zhc3RNYWxsb2MuY3BwCTIwMTUt
MDEtMDcgMTY6MDY6MDUuMDAwMDAwMDAwIC0wODAwCkBAIC01MDk1LDggKzUwOTUsMTMgQEAgdm9p
ZCogRmFzdE1hbGxvY1pvbmU6OnpvbmVSZWFsbG9jKG1hbGxvYwogZXh0ZXJuICJDIiB7CiBtYWxs
b2NfaW50cm9zcGVjdGlvbl90IGpzY29yZV9mYXN0bWFsbG9jX2ludHJvc3BlY3Rpb24gPSB7ICZG
YXN0TWFsbG9jWm9uZTo6ZW51bWVyYXRlLCAmRmFzdE1hbGxvY1pvbmU6Omdvb2RTaXplLCAmRmFz
dE1hbGxvY1pvbmU6OmNoZWNrLCAmRmFzdE1hbGxvY1pvbmU6OnByaW50LAogICAgICZGYXN0TWFs
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