[MacPorts] LibcxxOnOlderSystems modified
noreply at macports.org
Mon Sep 23 16:06:12 UTC 2019
Page "LibcxxOnOlderSystems" was changed by jmroot
Diff URL: <https://trac.macports.org/wiki/LibcxxOnOlderSystems?action=diff&version=70>
Comment: update for 2.6.0
--- LibcxxOnOlderSystems (version: 69)
+++ LibcxxOnOlderSystems (version: 70)
@@ -9,32 +9,25 @@
Alternately, you can switch MacPorts on OS X 10.8 or earlier to use libc++ instead of libstdc++.
This must be done for MacPorts as a whole; it can't be done for individual ports.
-At this time the MacPorts project does not build binary packages for libc++ on OS X 10.8 or earlier, so if you make this change, MacPorts will be building all ports from source.
If you use MacPorts C++-using ports as dependencies for C++-using software that you compile outside of MacPorts, you must compile that software using libc++ as well.
[Note: since the original writing of this article, MacPorts has developed the ability to build software against newer versions of libgcc that support c++11 (and newer) as well. This is currently undertaken by default in MacPorts. You may still wish to use libc++ as your default runtime to achieve maximal compatibility with currently-developed software, however. If so, continue with these instructions.]
-== Lion and Mountain Lion ==
+== Snow Leopard, Lion and Mountain Lion ==
-Lion and Mountain Lion systems have libc++ installed with the OS but still use libstdc++ as the default C++ runtime. You can use it by passing -stdlib=libc++ as a command line argument to clang++, and you can instruct MacPorts to use it instead of libstdc++ as the default C++ runtime.
+As of version 2.6.0, MacPorts will use libc++ by default when building ports. You no longer need to make any changes on these OS versions.
-1. Start with a new install of MacPorts or '''uninstall all ports that use C++'''
-2. Edit /opt/local/etc/macports/macports.conf to contain:
+If you followed the instructions that were here for earlier versions of MacPorts, you should remove or comment out the `default_compilers` setting in your macports.conf, or the correct compiler may not be chosen. Also remove or comment out the `buildfromsource` setting if you wish to be able to install from prebuilt archives. The `cxx_stdlib` setting can safely be removed also, though leaving it set to `libc++` will do no harm since that is now the default.
+If you changed the `delete_la_files` setting from its default value (as suggested in much older versions of these instructions), you will unfortunately need to uninstall all installed ports before changing it back, as ports built with this setting on are not compatible with those built with it off. All ports will be built from source if this setting has a value other than the default.
-These instructions previously said to set `delete_la_files yes` and `buildfromsource always`, but that is not recommended since it will render your installation unable to use binary archives when libc++ becomes the default on these OS versions. The current version of MacPorts will automatically avoid using binary archives when your cxx_stdlib setting does not match that of the server.
-== Leopard and Snow Leopard (Intel) ==
+== Leopard (Intel) ==
Leopard and Snow Leopard do not have libc++ installed by the OS, but MacPorts can build and install system roots that contain these runtimes for your use. After installing these roots (which is done automatically when the libcxx port activates), you can choose to continue using libstdc++ as the default C++ runtime in MacPorts or configure MacPorts to use the new libc++ runtime.
'''Warning:''' libc++ is fairly well tested on Snow Leopard, and Leopard support was only recently added on November 1, 2016.
-==== Bootstrapping 1: Fix the SDK (Leopard Only) ====
+==== Bootstrapping 1: Fix the SDK ====
Leopard's SDK has some bugs that are more visible when using newer toolchains, so please follow the steps in [wiki:LeopardSDKFixes Leopard SDK Fixes] first.
@@ -85,36 +78,25 @@
sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm50
sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm50
-8. **Snow Leopard Only:** Disable the variants corresponding to the older versions of ld64 in `/opt/local/etc/macports/variants.conf`. This ensures that ld64 will be reinstalled using the appropriate variants in the future:
-9. **Snow Leopard Only:** Reinstall ld64 with the legacy variants disabled to use ld64-latest as the default linker and deactivate the bootstrap linker:
-sudo port -v upgrade --enforce-variants ld64 -ld64_97 -ld64_127 -ld64_236
-sudo port -v deactivate ld64-127
-10. Install clang-5.0
+8. Install clang-5.0
sudo port -v install clang-5.0
-11. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-5.0` as preferred compiler, and re-enable revupgrade_autorun:
+9. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-5.0` as preferred compiler, and re-enable revupgrade_autorun:
default_compilers macports-clang-5.0 macports-clang-3.7 macports-clang-3.4 gcc-4.2 apple-gcc-4.2 gcc-4.0
## delete this line you added previously ==> revupgrade_autorun no
-12. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulatedtls` variant for full functionality:
+10. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulatedtls` variant for full functionality:
sudo port -v upgrade --enforce-variants libcxx +emulatedtls
-13. Uninstall the bootstrap toolchain:
+11. Uninstall the bootstrap toolchain:
sudo port -v deactivate llvm-3.4 clang-3.4
sudo port -v uninstall inactive
-14. Snow Leopard is able to install and use versions of clang and llvm up at least 8.0 at present. Leopard is presently limited to clang-7.0.
+12. Snow Leopard is able to install and use versions of clang and llvm up at least 8.0 at present. Leopard is presently limited to clang-7.0.
== Leopard (ppc) ==
Page URL: <https://trac.macports.org/wiki/LibcxxOnOlderSystems>
Ports system for macOS
This is an automated message. Someone added your email address to be
notified of changes on 'LibcxxOnOlderSystems' page.
If it was not you, please report to admin at macports.org.
More information about the macports-changes