Changes between Version 73 and Version 74 of LibcxxOnOlderSystems
- Timestamp:
- Mar 23, 2020, 1:04:30 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LibcxxOnOlderSystems
v73 v74 1 1 {{{ 2 2 #!div style="clear:both; display:block; width: 75%; margin:0 auto; background-color: lightyellow; border: 2pt solid; font-weight:bold; text-align: center; font-size:120%;" 3 With the release of MacPorts 2.6.0 the setup suggested on this page became obsolete for Mac OS X 10. 6, 10.7 and 10.8.3 With the release of MacPorts 2.6.0 the setup suggested on this page became obsolete for Mac OS X 10.7 and 10.8. 4 4 5 5 If you used it before, below are instructions for reverting back. 6 7 For Mac OS X 10.6, MacPorts will install a functional libc++ toolchain by default, but it can be updated with the instructions below. 6 8 }}} 7 9 8 = Using libc++ on older system =10 = Using libc++ on older systems = 9 11 10 12 If you have been referred to this page, you are likely trying to build software that uses C++11 on OS X 10.8 or earlier. … … 21 23 [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.] 22 24 23 == Snow Leopard,Lion and Mountain Lion ==25 == Lion and Mountain Lion == 24 26 25 27 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. … … 28 30 29 31 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. 32 33 == Snow Leopard == 34 35 As of version 2.6.0, MacPorts will use libc++ by default when building ports. 36 37 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. 38 39 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. 40 41 Although the default toolchain that MacPorts will install is quite capable, some ports may require a newer, more capable toolchain than MacPorts presently can install automatically. Snow Leopard can be brought up to a very current toolchain with some further manual updates. 42 43 1. Once clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulated_tls` variant for full functionality: 44 {{{ 45 sudo port -v -n upgrade --force --enforce-variants libcxx +emulated_tls 46 }}} 47 48 2. Rebuild cctools to use a newer version of llvm (currently llvm-9.0 is latest): 49 {{{ 50 sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm90 51 }}} 52 53 3. Rebuild {{{ld64}}} to use the newer version of both {{{ld64}}} and {{{llvm}}} (currently llvm-9.0 is latest). {{{ld64}}} is set up a bit differently than most other ports; by negating the default {{{+ld64_127}}} variant, the port installs the latest version of {{{ld64}}} ({{{ld64_latest}}}). Also, please note that the port name is {{{ld64-127}}} but the variant for ld64 is {{{ld64_127}}}. This is because negative signs (dashes) cannot be used in variant names. 54 {{{ 55 sudo port -v install ld64-latest -llvm34 +llvm90 56 sudo port -v -n upgrade --force --enforce-variants ld64 -ld64_127 -llvm34 +llvm90 57 }}} 58 59 And your Snow Leopard toolchain is now approximately up to par with Xcode 10.2. You can use quite new SDK versions to build against as well, as there is full TAPI support in ld64. 30 60 31 61 == Leopard (Intel) == … … 75 105 {{{ 76 106 -llvm34 77 +llvm 50107 +llvm90 78 108 }}} 79 109 6. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-3.7` as preferred compiler: … … 83 113 7. Rebuild cctools and ld64 to use the newer version of llvm (currently llvm-5.0): 84 114 {{{ 85 sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm 5086 sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm 50115 sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm90 116 sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm90 87 117 }}} 88 118 8. Install clang-5.0 … … 95 125 ## delete this line you added previously ==> revupgrade_autorun no 96 126 }}} 97 10. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulated tls` variant for full functionality:127 10. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulated_tls` variant for full functionality: 98 128 {{{ 99 sudo port -v upgrade --enforce-variants libcxx +emulatedtls129 sudo port -v -n upgrade --force --enforce-variants libcxx +emulated_tls 100 130 }}} 101 131 11. Uninstall the bootstrap toolchain: … … 104 134 sudo port -v uninstall inactive 105 135 }}} 106 12. Snow Leopard is able to install and use versions of clang and llvm up at least 9.0 at present. Leopard can also use up to clang-9.0.136 12. Leopard is able to install and use versions of clang and llvm up at least 9.0 at present. 107 137 108 138 == Leopard (ppc) ==