<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [CMake] Build failure with GCC 6 (fatal error: stdlib.h: No such file or directory)"
   href="https://bugs.webkit.org/show_bug.cgi?id=161697">161697</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[CMake] Build failure with GCC 6 (fatal error: stdlib.h: No such file or directory)
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Tools / Tests
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>clopez&#64;igalia.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bugs-noreply&#64;webkitgtk.org, lforschler&#64;apple.com, mcatanzaro&#64;igalia.com, ossy&#64;webkit.org, raj.khem&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Trying to build WebKitGTK+ with GCC 6 I got this error:

In file included from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-64/tmp-glibc/sysroots/qemux86/usr/include/c++/6.2.0/ext/string_conversions.h:41:0,
                 from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-64/tmp-glibc/sysroots/qemux86/usr/include/c++/6.2.0/bits/basic_string.h:5402,
                 from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-64/tmp-glibc/sysroots/qemux86/usr/include/c++/6.2.0/string:52,
                 from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-64/tmp-glibc/work/i586-oe-linux/webkitgtk/2.12.5-r0/webkitgtk-2.12.5/Source/ThirdParty/ANGLE/src/common/debug.h:14,
                 from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-64/tmp-glibc/work/i586-oe-linux/webkitgtk/2.12.5-r0/webkitgtk-2.12.5/Source/ThirdParty/ANGLE/src/common/mathutil.h:12,
                 from /home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-64/tmp-glibc/work/i586-oe-linux/webkitgtk/2.12.5-r0/webkitgtk-2.12.5/Source/ThirdParty/ANGLE/src/common/mathutil.cpp:9:
/home/igalia/clopez/yocto/commit-builds/meta-webkit/builds/qemux86-64/tmp-glibc/sysroots/qemux86/usr/include/c++/6.2.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
 #include_next &lt;stdlib.h&gt;

The issue seems to be that GCC 6 has now introduced stdlib.h in libstdc++ for better compliance and its including the C library stdlib.h using include_next which is sensitive to order of system header include paths. See: <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129</a>

The recommended way to fix this is to stop adding include directories as system ones (-isystem) and instead use the standard way to include directories (-I)

The openembedded project is carrying this downstream patch against WebKitGTK+ 2.12 with the above fix: <a href="http://git.openembedded.org/openembedded-core/tree/meta/recipes-sato/webkit/files/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch">http://git.openembedded.org/openembedded-core/tree/meta/recipes-sato/webkit/files/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch</a>


Seems that we started using -isystem on r185806 &lt;<a href="http://trac.webkit.org/r185806">http://trac.webkit.org/r185806</a>&gt; as a way to silence warnings.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>