[libcxx] r348436 - [libcxx] Don't depend on availability markup to provide the streams in the dylib
Louis Dionne
ldionne at apple.com
Wed Dec 5 16:24:58 PST 2018
Author: ldionne
Date: Wed Dec 5 16:24:58 2018
New Revision: 348436
URL: http://llvm.org/viewvc/llvm-project?rev=348436&view=rev
Log:
[libcxx] Don't depend on availability markup to provide the streams in the dylib
Whether an explicit instantiation declaration should be provided is not
a matter of availability markup.
This problem is exemplified by the fact that some tests were incorrectly
marked as XFAIL when they should instead have been using the definition
of streams from the headers, and hence passing, and that, regardless of
whether visibility annotations are enabled.
Modified:
libcxx/trunk/include/__config
libcxx/trunk/include/istream
libcxx/trunk/include/ostream
libcxx/trunk/include/streambuf
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
libcxx/trunk/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp
Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Wed Dec 5 16:24:58 2018
@@ -1359,16 +1359,19 @@ _LIBCPP_FUNC_VIS extern "C" void __sanit
# define _LIBCPP_AVAILABILITY_THROW_BAD_VARIANT_ACCESS _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS
#endif
-// Availability of stream API in the dylib got dropped and re-added. The
-// extern template should effectively be available at:
-// availability(macosx,introduced=10.9)
-// availability(ios,introduced=7.0)
-#if defined(_LIBCPP_USE_AVAILABILITY_APPLE) && \
+// The stream API was dropped and re-added in the dylib shipped on macOS
+// and iOS. We can only assume the dylib to provide these definitions for
+// macosx >= 10.9 and ios >= 7.0. Otherwise, the definitions are available
+// from the headers, but not from the dylib. Explicit instantiation
+// declarations for streams exist conditionally to this; if we provide
+// an explicit instantiation declaration and we try to deploy to a dylib
+// that does not provide those symbols, we'll get a load-time error.
+#if !defined(_LIBCPP_BUILDING_LIBRARY) && \
((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090) || \
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000))
-#define _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+# define _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
#endif
#if defined(_LIBCPP_COMPILER_IBM)
Modified: libcxx/trunk/include/istream
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/istream?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/include/istream (original)
+++ libcxx/trunk/include/istream Wed Dec 5 16:24:58 2018
@@ -1504,7 +1504,7 @@ operator>>(basic_istream<_CharT, _Traits
return __is;
}
-#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
Modified: libcxx/trunk/include/ostream
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ostream?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/include/ostream (original)
+++ libcxx/trunk/include/ostream Wed Dec 5 16:24:58 2018
@@ -1092,7 +1092,7 @@ operator<<(basic_ostream<_CharT, _Traits
use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
}
-#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
#endif
Modified: libcxx/trunk/include/streambuf
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/streambuf?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/include/streambuf (original)
+++ libcxx/trunk/include/streambuf Wed Dec 5 16:24:58 2018
@@ -486,7 +486,7 @@ basic_streambuf<_CharT, _Traits>::overfl
return traits_type::eof();
}
-#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
+#ifndef _LIBCPP_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: with_system_cxx_lib=macosx10.7
-
// <istream>
// int_type get();
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: with_system_cxx_lib=macosx10.7
-
// <istream>
// basic_istream<charT,traits>& get(char_type& c);
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,13 +7,13 @@
//
//===----------------------------------------------------------------------===//
+// In macosx10.9 to macosx10.14, streams are provided in the dylib AND they
+// have a bug in how they handle null-termination in case of errors (see D40677).
// XFAIL: with_system_cxx_lib=macosx10.13
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
// <istream>
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_pointer_size_chart.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,13 +7,13 @@
//
//===----------------------------------------------------------------------===//
+// In macosx10.9 to macosx10.14, streams are provided in the dylib AND they
+// have a bug in how they handle null-termination in case of errors (see D40677).
// XFAIL: with_system_cxx_lib=macosx10.13
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
// <istream>
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,13 +7,13 @@
//
//===----------------------------------------------------------------------===//
+// In macosx10.9 to macosx10.14, streams are provided in the dylib AND they
+// have a bug in how they handle null-termination in case of errors (see D40677).
// XFAIL: with_system_cxx_lib=macosx10.13
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
// <istream>
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/getline_pointer_size_chart.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,13 +7,13 @@
//
//===----------------------------------------------------------------------===//
+// In macosx10.9 to macosx10.14, streams are provided in the dylib AND they
+// have a bug in how they handle null-termination in case of errors (see D40677).
// XFAIL: with_system_cxx_lib=macosx10.13
// XFAIL: with_system_cxx_lib=macosx10.12
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
// <istream>
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,9 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
// <istream>
// basic_istream<charT,traits>&
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: with_system_cxx_lib=macosx10.7
-
// <istream>
// basic_istream<charT,traits>& read(char_type* s, streamsize n);
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,9 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
// <istream>
// streamsize readsome(char_type* s, streamsize n);
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,9 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
// <istream>
// basic_istream<charT,traits>& seekg(pos_type pos);
Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp Wed Dec 5 16:24:58 2018
@@ -10,8 +10,6 @@
// XFAIL: with_system_cxx_lib=macosx10.11
// XFAIL: with_system_cxx_lib=macosx10.10
// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
// <istream>
Modified: libcxx/trunk/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp?rev=348436&r1=348435&r2=348436&view=diff
==============================================================================
--- libcxx/trunk/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp (original)
+++ libcxx/trunk/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp Wed Dec 5 16:24:58 2018
@@ -7,8 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// XFAIL: with_system_cxx_lib=macosx10.7
-
// <complex>
// template<class T, class charT, class traits>
More information about the libcxx-commits
mailing list