ryandesign at macports.org
Wed May 6 17:07:49 PDT 2015
On May 6, 2015, at 3:49 PM, Michael Dickens wrote:
> Yes; OK; agreed in general.
> So, why do we have "configure.cxx_stdlib"? Why not just force users to
> use libc++ and never libstdc++? I know this setting -can be- per port,
> but for (guessing) 99%+ of all users they just use the default (they
> likely do not even know they can change this setting). On 10.8- this
> setting defaults to "libstdc++" and thus ports can use clang or GCC for
> building (Apple or MacPorts). On 10.9+ this setting defaults to "libc++"
> and thus ports must use clang for building (Apple or MacPorts). I don't
> see these settings as opposing what you wrote, including that "we should
> not allow use of the GCC compilers in the general case". The major issue
> happens someone decides to mix and match the stdlib in the same MacPorts
> install -- which is never a good idea in general, and should be used
> only in very specific instances by knowledgeable and qualified
> developers; in this case "you get what you pay for" I think fits the
> bill pretty well.
> What I'm saying is that when specifying -std=c++11 and using libstdc++,
> one -must- use GCC 4.7+ but -cannot- use Clang because of how Clang
> finds headers -in this case-. I don't think that these conditions
> contradict what you wrote below, nor the general / specific usage cases.
> If the user is brave enough to be using libc++ on 10.8-, then compiling
> using -std=c++11 will work just fine for my ports because they are
> programmed to use Clang as the compiler. If they use libstdc++, then
> they are programmed to use GCC 4.7+ as the compiler -- doesn't matter
> the OS; what matters is the stdlib setting.
> I don't see this as a big deal; maybe I'm just not getting the point
> yet? Sorry if I'm being daft! - MLD
The point is:
If you want C++11 on a Mac, you need libc++. So you either need 10.9 or later, or you need to switch to libc++ on 10.7 or 10.8. Users can switch to libc++ on 10.7 or 10.8 by editing macports.conf, and then rebuilding all ports. See the wiki page:
We have not switched default installations of MacPorts on 10.7 and 10.8 to use libc++ because we do not have buildbots set up for this case, and not many developers have tested this configuration, and also MacPorts base does not contain code that could facilitate an easy upgrade to this configuration.
Using libgcc's libstdc++ for C++11 support is not something we're prepared to support in MacPorts. Mixing two different C++ libraries -- including Apple's libstdc++ and libgcc's libstdc++ -- can lead to problems that we want to avoid.
The simplest answer is that users who want C++11 should use OS X 10.9 or later.
More information about the macports-dev