Changes between Version 36 and Version 37 of LibcxxOnOlderSystems
- Timestamp:
- Jul 31, 2016, 3:13:22 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LibcxxOnOlderSystems
v36 v37 51 51 52 52 ==== Bootstrapping 3: Build a current version of clang against libc++ ==== 53 54 The instructions below are for the latest stable build of llvm at the time of this writing (3.8). You should be able to easily replace 3.8 with 3.6, 3.7, 3.9, or later versions, but 3.4 is needed to bootstrap the process. 55 53 56 1. Deactivate all your active ports (or at least the C++ ports) in order to prepare to rebuild them, and just activate the new toolchain: 54 57 {{{ … … 71 74 sudo port -v install clang-3.8 72 75 }}} 73 5. Update cctools and ld64 to use the newerversion of llvm:76 5. Add the variant corresponding to the new version of llvm to `/opt/local/etc/macports/variants.conf`. This ensures that cctools and ld64 will be reinstalled using the appropriate version of llvm: 74 77 {{{ 75 sudo port -v -n upgrade --enforce-variants cctools -llvm33 -llvm34 +llvm38 configure.compiler=macports-clang-3.8 76 sudo port -v upgrade --enforce-variants ld64 -llvm33 -llvm34 +llvm38 configure.compiler=macports-clang-3.8 78 +llvm38 77 79 }}} 78 6. Uninstall the bootstrap toolchain: 80 6. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-3.8` as preferred compiler: 81 {{{ 82 default_compilers macports-clang-3.8 macports-clang-3.7 macports-clang-3.4 macports-clang-3.3 gcc-4.2 apple-gcc-4.2 gcc-4.0 83 }}} 84 7. Uninstall the bootstrap toolchain: 79 85 {{{ 80 86 sudo port -v deactivate llvm-3.4 clang-3.4 81 87 sudo port -v uninstall inactive 82 88 }}} 83 7. Either: 84 1. Edit `/opt/local/etc/macports/macports.conf` again to add `macports-clang-3.8` as preferred compiler: 89 7. Rebuild cctools and ld64 to use the newer version of llvm: 85 90 {{{ 86 default_compilers macports-clang-3.8 macports-clang-3.7 macports-clang-3.4 macports-clang-3.3 gcc-4.2 apple-gcc-4.2 gcc-4.0 91 sudo port -v -n upgrade --enforce-variants cctools -llvm34 92 sudo port -v upgrade --enforce-variants ld64 -llvm34 87 93 }}} 88 2. Rebuild clang-3.4 using clang-3.8:94 8. Rebuild libcxxabi and libcxx +universal to allow linking universal C++ code with the new toolchain: 89 95 {{{ 90 sudo port -v install clang-3.4 configure.compiler=macports-clang-3.896 sudo port -v -s upgrade --enforce-variants libcxx +universal universal_archs="x86_64 i386" 91 97 }}} 92 8. Add the variant corresponding to your default compiler to your `/opt/local/etc/macports/variants.conf`. This ensures that deactivating all ports leaves your MacPorts installation in a usable state (which may be important, if you are setting up a buildbot, for example): 93 1. For clang-3.8: 98 or possibly (not verified) for ppc support as well: 94 99 {{{ 95 +llvm38 96 }}} 97 2. For clang-3.4: 98 {{{ 99 +llvm34 100 sudo port -v -s upgrade --enforce-variants ld64 +ld64_127 101 sudo port -v -s upgrade --enforce-variants libcxx +universal universal_archs="x86_64 i386 ppc" 100 102 }}} 101 103