[MacPorts] LibcxxOnOlderSystems modified

MacPorts Wiki noreply at macports.org
Mon Mar 23 01:04:30 UTC 2020


Page "LibcxxOnOlderSystems" was changed by kencu
Diff URL: <https://trac.macports.org/wiki/LibcxxOnOlderSystems?action=diff&version=74>
Revision 74
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: LibcxxOnOlderSystems
=========================================================================
--- LibcxxOnOlderSystems (version: 73)
+++ LibcxxOnOlderSystems (version: 74)
@@ -1,11 +1,13 @@
 {{{
 #!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%;"
-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.
+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.
 
 If you used it before, below are instructions for reverting back.
+
+For Mac OS X 10.6, MacPorts will install a functional libc++ toolchain by default, but it can be updated with the instructions below.
 }}}
 
-= Using libc++ on older system =
+= Using libc++ on older systems =
 
 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.
 The default C++ runtime on OS X 10.8 and earlier is a version of libstdc++ based on GCC 4.2.1 which does not support C++11.
@@ -20,13 +22,41 @@
 
 [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.]
 
-== Snow Leopard, Lion and Mountain Lion ==
+== Lion and Mountain Lion ==
 
 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.
 
 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.
+
+== Snow Leopard ==
+
+As of version 2.6.0, MacPorts will use libc++ by default when building ports. 
+
+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.
+
+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.
+
+1. Once clang-5.0 (or greater) installed, you can rebuild libcxx with the `+emulated_tls` variant for full functionality:
+{{{
+sudo port -v -n upgrade --force --enforce-variants libcxx +emulated_tls
+}}}
+
+2. Rebuild cctools to use a newer version of llvm (currently llvm-9.0 is latest):
+{{{
+sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm90
+}}}
+
+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.
+{{{
+sudo port -v install ld64-latest -llvm34 +llvm90
+sudo port -v -n upgrade --force --enforce-variants ld64 -ld64_127 -llvm34 +llvm90
+}}}
+
+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.
 
 == Leopard (Intel) ==
 
@@ -74,7 +104,7 @@
 5. Disable the variants corresponding to the bootstrap versions of llvm in `/opt/local/etc/macports/variants.conf`.  This ensures that future installs of cctools and ld64 will use a newer version of llvm:
 {{{
 -llvm34
-+llvm50
++llvm90
 }}}
 6. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-3.7` as preferred compiler:
 {{{
@@ -82,8 +112,8 @@
 }}}
 7. Rebuild cctools and ld64 to use the newer version of llvm (currently llvm-5.0):
 {{{
-sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm50
-sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm50
+sudo port -v -n upgrade --force --enforce-variants cctools -llvm34 +llvm90
+sudo port -v -n upgrade --force --enforce-variants ld64 -llvm34 +llvm90
 }}}
 8. Install clang-5.0
 {{{
@@ -94,16 +124,16 @@
 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
 }}}
-10. 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 `+emulated_tls` variant for full functionality:
 {{{
-sudo port -v upgrade --enforce-variants libcxx +emulatedtls
+sudo port -v -n upgrade --force --enforce-variants libcxx +emulated_tls
 }}}
 11. Uninstall the bootstrap toolchain:
 {{{
 sudo port -v deactivate llvm-3.4 clang-3.4
 sudo port -v uninstall inactive
 }}}
-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.
+12. Leopard is able to install and use versions of clang and llvm up at least 9.0 at present.
 
 == Leopard (ppc) ==
 
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/LibcxxOnOlderSystems>
MacPorts <https://www.macports.org/>
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 mailing list