Changes between Version 69 and Version 70 of LibcxxOnOlderSystems
- Timestamp:
- Sep 23, 2019, 4:06:11 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LibcxxOnOlderSystems
v69 v70 10 10 This must be done for MacPorts as a whole; it can't be done for individual ports. 11 11 12 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.13 14 12 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. 15 13 16 14 [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.] 17 15 18 == Lion and Mountain Lion ==16 == Snow Leopard, Lion and Mountain Lion == 19 17 20 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.18 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. 21 19 22 1. Start with a new install of MacPorts or '''uninstall all ports that use C++''' 23 2. Edit /opt/local/etc/macports/macports.conf to contain: 20 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. 24 21 25 {{{ 26 cxx_stdlib libc++ 27 }}} 22 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. 28 23 29 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. 30 31 == Leopard and Snow Leopard (Intel) == 24 == Leopard (Intel) == 32 25 33 26 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. … … 35 28 '''Warning:''' libc++ is fairly well tested on Snow Leopard, and Leopard support was only recently added on November 1, 2016. 36 29 37 ==== Bootstrapping 1: Fix the SDK (Leopard Only)====30 ==== Bootstrapping 1: Fix the SDK ==== 38 31 39 32 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. … … 86 79 sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm50 87 80 }}} 88 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: 89 {{{ 90 -ld64_97 91 -ld64_127 92 -ld64_236 93 }}} 94 9. **Snow Leopard Only:** Reinstall ld64 with the legacy variants disabled to use ld64-latest as the default linker and deactivate the bootstrap linker: 95 {{{ 96 sudo port -v upgrade --enforce-variants ld64 -ld64_97 -ld64_127 -ld64_236 97 sudo port -v deactivate ld64-127 98 }}} 99 10. Install clang-5.0 81 8. Install clang-5.0 100 82 {{{ 101 83 sudo port -v install clang-5.0 102 84 }}} 103 11. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-5.0` as preferred compiler, and re-enable revupgrade_autorun:85 9. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-5.0` as preferred compiler, and re-enable revupgrade_autorun: 104 86 {{{ 105 87 default_compilers macports-clang-5.0 macports-clang-3.7 macports-clang-3.4 gcc-4.2 apple-gcc-4.2 gcc-4.0 106 88 ## delete this line you added previously ==> revupgrade_autorun no 107 89 }}} 108 1 2. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulatedtls` variant for full functionality:90 10. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulatedtls` variant for full functionality: 109 91 {{{ 110 92 sudo port -v upgrade --enforce-variants libcxx +emulatedtls 111 93 }}} 112 1 3. Uninstall the bootstrap toolchain:94 11. Uninstall the bootstrap toolchain: 113 95 {{{ 114 96 sudo port -v deactivate llvm-3.4 clang-3.4 115 97 sudo port -v uninstall inactive 116 98 }}} 117 1 4. 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.99 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. 118 100 119 101 == Leopard (ppc) ==