[MacPorts] #62770: clang++ 11 broken by MacOS 11.3 update

MacPorts noreply at macports.org
Fri Apr 30 09:36:07 UTC 2021


#62770: clang++ 11 broken by MacOS 11.3 update
-----------------------+---------------------------
  Reporter:  haberg-1  |      Owner:  jeremyhu
      Type:  defect    |     Status:  assigned
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:  2.6.4
Resolution:            |   Keywords:  bigsur x86_64
      Port:  clang-11  |
-----------------------+---------------------------

Comment (by cjones051073):

 Small correction..

 The differences in fact seem to start from when `c++/v1/__config` is
 include,

 clang from Xcode on macOS11 of course uses the SDK includes

 {{{
 Oberon ~/cernbox/MacPorts/gcc11 > clang++ -M conftest.cpp
 conftest.o: conftest.cpp \
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/stdio.h
 \
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config
 \
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h
 \
 <snip>
 }}}

 whereas MP clang 11

 {{{
 Oberon ~/cernbox/MacPorts/gcc11 > clang++-mp-11 -M conftest.cpp
 conftest.o: conftest.cpp \
   /opt/local/libexec/llvm-11/bin/../include/c++/v1/stdio.h \
   /opt/local/libexec/llvm-11/bin/../include/c++/v1/__config \
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h
 \
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/stdio.h
 }}}

 This is starting to me look like a compatibility issue between the
 `include/c++/v1` headers shipped with the MacPorts stock LLVM builds and
 those with Xcode.

 If I diff the `__config` file from both, on macOS11

 {{{
 Oberon ~/cernbox/MacPorts/gcc11 > diff
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config
 /opt/local/libexec/llvm-11/bin/../include/c++/v1/__config
 16c16
 < #define _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
 ---
 > /* #undef _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT */
 31c31
 < #define _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION 1
 ---
 > /* #undef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION */
 73c73
 < #define _LIBCPP_VERSION 12000
 ---
 > #define _LIBCPP_VERSION 11000
 79c79
 < #if __STDC_HOSTED__ == 0
 ---
 > #ifndef __STDC_HOSTED__
 146,149d145
 < // Enable clang::trivial_abi on std::unique_ptr.
 < #  define _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI
 < // Enable clang::trivial_abi on std::shared_ptr and std::weak_ptr
 < #  define _LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI
 388a385
 > #    define _LIBCPP_HAS_C11_FEATURES
 393a391
 > #    define _LIBCPP_HAS_C11_FEATURES
 406a405
 > #    define _LIBCPP_HAS_C11_FEATURES
 413a413
 > #        define _LIBCPP_HAS_C11_FEATURES
 419a420
 > #      define _LIBCPP_HAS_C11_FEATURES
 421,431c422
 < #  elif defined(__APPLE__)
 <      // timespec_get and aligned_alloc were introduced in macOS 10.15
 and
 <      // aligned releases
 < #    if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 || \
 <          __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
 <          __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
 <          __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)
 < #      define _LIBCPP_HAS_ALIGNED_ALLOC
 < #      define _LIBCPP_HAS_TIMESPEC_GET
 < #    endif
 < #  endif // __APPLE__
 ---
 > #  endif // __linux__
 439c430,432
 < # error "We don't know a correct way to implement alignof(T) in C++03
 outside of Clang"
 ---
 > // This definition is potentially buggy, but it's only taken with GCC in
 C++03,
 > // which we barely support anyway. See llvm.org/PR39713
 > # define _LIBCPP_ALIGNOF(_Tp) __alignof(_Tp)
 454,475d446
 < #if defined(__APPLE__) &&
 defined(__ENVIRONMENT_DRIVERKIT_VERSION_MIN_REQUIRED__)
 < #  define _LIBCPP_DRIVERKIT
 <
 <    // System libraries on DriverKit build against a libc that provides
 <    // additional declarations beyond the normal DriverKit API. This
 <    // determines whether we can rely on those declarations being
 provided
 <    // by the underlying libc (when defined, we can't rely on them).
 < #  include <sys/cdefs.h>
 < #  if defined(__DRIVERKIT_LIBC__)
 < #    define _LIBCPP_DRIVERKIT_LIBC
 < #  endif
 < #endif
 <
 < // For the DriverKit ABI, we use ABI v1 with a few ABI breaking fixes on
 top.
 < #if defined(_LIBCPP_DRIVERKIT)
 < #  define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
 < #  define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
 < #  define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
 < #  define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
 < #  define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
 < #endif
 <
 514a486,489
 > #if !(__has_feature(cxx_rvalue_references))
 > #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
 > #endif
 >
 518a494,497
 > #if !(__has_feature(cxx_variadic_templates))
 > #define _LIBCPP_HAS_NO_VARIADICS
 > #endif
 >
 808,809d786
 <
 <
 1142a1120,1125
 > #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 > #  define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
 > #else
 > #  define _LIBCPP_EXPLICIT_MOVE(x) (x)
 > #endif
 >
 }}}

 so yes, different, but then they are on macOS10.13 as well....

-- 
Ticket URL: <https://trac.macports.org/ticket/62770#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list