Changes between Version 69 and Version 70 of LibcxxOnOlderSystems


Ignore:
Timestamp:
Sep 23, 2019, 4:06:11 PM (5 years ago)
Author:
jmroot (Joshua Root)
Comment:

update for 2.6.0

Legend:

Unmodified
Added
Removed
Modified
  • LibcxxOnOlderSystems

    v69 v70  
    1010This must be done for MacPorts as a whole; it can't be done for individual ports.
    1111
    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 
    1412If 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.
    1513
    1614[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.]
    1715
    18 == Lion and Mountain Lion ==
     16== Snow Leopard, Lion and Mountain Lion ==
    1917
    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.
     18As 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.
    2119
    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:
     20If 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.
    2421
    25 {{{
    26 cxx_stdlib         libc++
    27 }}}
     22If 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.
    2823
    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) ==
    3225
    3326Leopard 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.
     
    3528'''Warning:''' libc++ is fairly well tested on Snow Leopard, and Leopard support was only recently added on November 1, 2016.
    3629
    37 ==== Bootstrapping 1: Fix the SDK (Leopard Only) ====
     30==== Bootstrapping 1: Fix the SDK ====
    3831
    3932Leopard'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.
     
    8679sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm50
    8780}}}
    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
     818. Install clang-5.0
    10082{{{
    10183sudo port -v install clang-5.0
    10284}}}
    103 11. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-5.0` as preferred compiler, and re-enable revupgrade_autorun:
     859. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-5.0` as preferred compiler, and re-enable revupgrade_autorun:
    10486{{{
    10587default_compilers macports-clang-5.0 macports-clang-3.7 macports-clang-3.4 gcc-4.2 apple-gcc-4.2 gcc-4.0
    10688## delete this line you added previously ==> revupgrade_autorun         no
    10789}}}
    108 12. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulatedtls` variant for full functionality:
     9010. Now that you have clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulatedtls` variant for full functionality:
    10991{{{
    11092sudo port -v upgrade --enforce-variants libcxx +emulatedtls
    11193}}}
    112 13. Uninstall the bootstrap toolchain:
     9411. Uninstall the bootstrap toolchain:
    11395{{{
    11496sudo port -v deactivate llvm-3.4 clang-3.4
    11597sudo port -v uninstall inactive
    11698}}}
    117 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.
     9912. 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.
    118100
    119101== Leopard (ppc) ==