<html>
    <head>
      <base href="https://bugs.llvm.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 - UTIME_OMIT shouldn't be used to detect presence of utimensat()"
   href="https://bugs.llvm.org/show_bug.cgi?id=33469">33469</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>UTIME_OMIT shouldn't be used to detect presence of utimensat()
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>howarth.mailing.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The Xcode 9 beta release breaks the assumption...

    // We can use the presence of UTIME_OMIT to detect platforms that do not
    // provide utimensat.

made in src/experimental/filesystem/operations.cpp. The new Xcode 9 release has
a shared SDK for both 10.12/10.13 on 10.12...

% cd /Library/Developer/CommandLineTools/SDKs
[Mac-Pro:Developer/CommandLineTools/SDKs] howarth% ls -l
total 16
drwxr-xr-x  5 root  wheel  170 Jun 14 17:48 MacOSX.sdk
lrwxr-xr-x  1 root  wheel   10 Jun 14 09:11 MacOSX10.12.sdk -> MacOSX.sdk
lrwxr-xr-x  1 root  wheel   10 Jun 14 17:47 MacOSX10.13.sdk -> MacOSX.sdk

which results in a MacOSX.sdk/usr/include/sys/stat.h being used which
unconditionally contains...

#define UTIME_OMIT      -2

This produces a undefined _utimensat symbol when '-isysroot
/Library/Developer/CommandLineTools/SDKs/MacOSX10.12.sdk
-mmacosx-version-min=10.12' is used. This is because the the 
MacOSX.sdk/usr/include/sys/stat.h properly uses the __API_AVAILABLE() macro on
the utimensat()...

int     utimensat(int __fd, const char *__path, const struct timespec
__times[2],
                int __flag) __API_AVAILABLE(macosx(10.13), ios(11.0),
tvos(11.0), watchos(4.0));

which leaves that symbol undeclared on the 10.12 target. However
src/experimental/filesystem/operations.cpp errornously tries to use the
utimensat() call based on the definition of UTIME_OMIT.
    This should be replaced with an appropriate cmake module to check for
utimensat() directly with the current compile flags rather than incorrectly
depending on the definition of UTIME_OMIT.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>