[libcxx-commits] [libcxx] 8142425 - Revert "[libc++] Workaround timespec_get not always being available in Apple SDKs"

Raphael Isemann via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 2 00:46:02 PDT 2020


Author: Raphael Isemann
Date: 2020-09-02T09:45:35+02:00
New Revision: 814242572731da240ff91b233a0bc8c7b2323434

URL: https://github.com/llvm/llvm-project/commit/814242572731da240ff91b233a0bc8c7b2323434
DIFF: https://github.com/llvm/llvm-project/commit/814242572731da240ff91b233a0bc8c7b2323434.diff

LOG: Revert "[libc++] Workaround timespec_get not always being available in Apple SDKs"

This reverts commit 99f3b231cb21abc567c93813650cd76cfa614325. It breaks
libcxx/modules/stds_include.sh.cpp on macOS as the new include to sys/cdefs.h
causes a dependency from __config to the Darwin module (which already has
a dependency on __config). This cyclic dependency breaks compiling the std
module which breaks compiling pretty much every program with ToT libc++ and
enabled modules.

I'll revert for now to get the bots green again. Sorry for the inconvenience.

Added: 
    

Modified: 
    libcxx/include/__config

Removed: 
    libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp


################################################################################
diff  --git a/libcxx/include/__config b/libcxx/include/__config
index d734c10cd8ed..d7b6a2acaeff 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -388,14 +388,7 @@
          __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
          __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)
 #      define _LIBCPP_HAS_ALIGNED_ALLOC
-       // TODO: Apple SDKs don't define ::timespec_get unconditionally in C++
-       //       mode. This should be fixed in future SDKs, but for the time
-       //       being we need to avoid trying to use that declaration when
-       //       the SDK doesn't provide it.
-#      include <sys/cdefs.h>
-#      if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL)
-#        define _LIBCPP_HAS_TIMESPEC_GET
-#      endif
+#      define _LIBCPP_HAS_TIMESPEC_GET
 #    endif
 #  endif // __APPLE__
 #endif

diff  --git a/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp b/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
deleted file mode 100644
index cf4c5957a418..000000000000
--- a/libcxx/test/libcxx/language.support/timespec_get.xopen.compile.pass.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14
-
-// Make sure that <ctime> can be included even when _XOPEN_SOURCE is defined.
-// This used to trigger some bug in Apple SDKs, since timespec_get was not
-// defined in <time.h> but we tried using it from <ctime>.
-// See https://llvm.org/PR47208 for details.
-
-// ADDITIONAL_COMPILE_FLAGS: -D_XOPEN_SOURCE=500
-
-#include <ctime>


        


More information about the libcxx-commits mailing list