Changes between Version 130 and Version 131 of FAQ


Ignore:
Timestamp:
Feb 27, 2014, 2:48:58 AM (10 years ago)
Author:
cooljeanius (Eric Gallager)
Comment:

edit new libcpp section for clarity and a typo

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v130 v131  
    253253Apple ships `g++` based on the old `libstdc++` runtime in pre-5.x versions of Xcode and on pre-10.9 OS X. Starting with Xcode 5 and OS X 10.9, Apple is using `clang` and its C++11 compliant `libc++`. The C++11 runtime is not compatible with the older C++ runtime.
    254254
    255 It is entirely possible to build the C++11 runtime on pre-10.9 by itself. The problem is that it is never by itself; it exists in an ecosystem whose contents are defined by Apple. On 10.8 and earlier that ecosystem is not C++11, and while you can build a C++11 ecosystem of your own it is not compatible with anything else. In particular it is not compatible with any C++ libraries provided by Apple as part of the base system or Xcode, and if you ever try to use an Apple-compatible C++ library with it you will get link errors or possibly crashes.
    256 
    257 After playing whack-a-mole for a while trying to get stuff to coexist, MacPorts has given up and acknowledged that the only thing that works reliably is to go with what is compatible with Apple libraries; that means only older LLVM/`clang` that uses pre-C++11 interfaces (provided by `libstdc++` or an Apple-sourced compatible `libc++`) on 10.8 and earlier and only newer LLVM/`clang` that uses C++11 interfaces (provided by modern `libc++` but not the `libc++` shipped on older OS X) on 10.9 and layer. Any other combination ''might'' work if you are lucky, but is not guaranteed in any way and has led to many port build failures, and MacPorts no longer attempts to support it.
     255It is entirely possible to build the C++11 runtime on pre-10.9 by itself. The problem is that it is never actually by itself; it exists in an ecosystem whose contents are defined by Apple. On 10.8 and earlier that ecosystem is not C++11, and while you can build a C++11 ecosystem of your own, it will not be compatible with anything else. In particular, it will not be compatible with any C++ libraries provided by Apple as part of the base system or Xcode, and if you ever try to use an Apple-compatible C++ library with it, you will get link errors or possibly crashes.
     256
     257After playing whack-a-mole for a while trying to get stuff to coexist, MacPorts has given up and acknowledged that the only thing that works reliably is to go with what is compatible with Apple libraries; that means only older LLVM/`clang` that uses pre-C++11 interfaces (provided by `libstdc++` or an Apple-sourced compatible `libc++`) on 10.8 and earlier and only newer LLVM/`clang` that uses C++11 interfaces (provided by modern `libc++` but not the `libc++` shipped on older OS X) on 10.9 and later. Any other combination ''might'' work if you are lucky, but is not guaranteed in any way and has led to many port build failures, and MacPorts no longer attempts to support it.
    258258
    259259== Portfile Development and Maintenance Questions ==