Changes between Version 73 and Version 74 of LibcxxOnOlderSystems


Ignore:
Timestamp:
Mar 23, 2020, 1:04:30 AM (5 years ago)
Author:
kencu (Ken)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LibcxxOnOlderSystems

    v73 v74  
    11{{{
    22#!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.
     3With the release of MacPorts 2.6.0 the setup suggested on this page became obsolete for Mac OS X 10.7 and 10.8.
    44
    55If you used it before, below are instructions for reverting back.
     6
     7For Mac OS X 10.6, MacPorts will install a functional libc++ toolchain by default, but it can be updated with the instructions below.
    68}}}
    79
    8 = Using libc++ on older system =
     10= Using libc++ on older systems =
    911
    1012If 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.
     
    2123[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.]
    2224
    23 == Snow Leopard, Lion and Mountain Lion ==
     25== Lion and Mountain Lion ==
    2426
    2527As 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.
     
    2830
    2931If 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
     35As of version 2.6.0, MacPorts will use libc++ by default when building ports.
     36
     37If 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
     39If 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
     41Although 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
     431. Once clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulated_tls` variant for full functionality:
     44{{{
     45sudo port -v -n upgrade --force --enforce-variants libcxx +emulated_tls
     46}}}
     47
     482. Rebuild cctools to use a newer version of llvm (currently llvm-9.0 is latest):
     49{{{
     50sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm90
     51}}}
     52
     533. 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{{{
     55sudo port -v install ld64-latest -llvm34 +llvm90
     56sudo port -v -n upgrade --force --enforce-variants ld64 -ld64_127 -llvm34 +llvm90
     57}}}
     58
     59And 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.
    3060
    3161== Leopard (Intel) ==
     
    75105{{{
    76106-llvm34
    77 +llvm50
     107+llvm90
    78108}}}
    791096. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-3.7` as preferred compiler:
     
    831137. Rebuild cctools and ld64 to use the newer version of llvm (currently llvm-5.0):
    84114{{{
    85 sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm50
    86 sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm50
     115sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm90
     116sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm90
    87117}}}
    881188. Install clang-5.0
     
    95125## delete this line you added previously ==> revupgrade_autorun         no
    96126}}}
    97 10. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulatedtls` variant for full functionality:
     12710. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulated_tls` variant for full functionality:
    98128{{{
    99 sudo port -v upgrade --enforce-variants libcxx +emulatedtls
     129sudo port -v -n upgrade --force --enforce-variants libcxx +emulated_tls
    100130}}}
    10113111. Uninstall the bootstrap toolchain:
     
    104134sudo port -v uninstall inactive
    105135}}}
    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.
     13612. Leopard is able to install and use versions of clang and llvm up at least 9.0 at present.
    107137
    108138== Leopard (ppc) ==