diff --git a/config/components.yml b/config/components.yml
index 868f196968df3a9bfc65c545404dc0fe33a8bb30..159537b6ed2db61cb1c67c6d42b68e0e5977d697 100644
--- a/config/components.yml
+++ b/config/components.yml
@@ -32,6 +32,8 @@
 #@ load("/components/toolchain/arch/win32.lib.yml", "win32_toolchain_components")
 #@ load("/components/toolchain/arch/win64.lib.yml", "win64_toolchain_components")
 
+#@ load("/components/macos/macos.lib.yml", "macos_toolchain_components")
+
 #@ load("/global_options.lib.yml", "options")
 
 components:
@@ -68,4 +70,6 @@ components:
   _: #@ template.replace(win64_toolchain_components)
   _: #@ template.replace(win32_toolchain_components)
 
+  _: #@ template.replace(macos_toolchain_components)
+
 options: #@ options
diff --git a/config/components/macos/clang.lib.yml b/config/components/macos/clang.lib.yml
new file mode 100644
index 0000000000000000000000000000000000000000..4f62717ace62eaa360d1694bb5078e515e36dc73
--- /dev/null
+++ b/config/components/macos/clang.lib.yml
@@ -0,0 +1,35 @@
+#@ load("/lib/make.lib.yml", "make")
+#@ load("/lib/cmake.lib.yml", "cmake_base_configuration")
+#@ load("/lib/shell.lib.yml", "expand_args")
+
+#@ source_url = "https://codeload.github.com/tpoechtrager/cctools-port/tar.gz/1e3f614aff4eaae01b6cc4d29c3237c93f3322f8"
+
+---
+#@ def prefixes():
+- x86-64
+- i686
+#@ end
+
+
+#@yaml/text-templated-strings
+---
+#@ def _macosx_clang_components():
+#@ for prefix in prefixes():
+macos/(@= prefix @)-clang:
+  builds:
+    default:
+      configure: ""
+      install: |
+        rm -f "${TMP_ROOT}${ORCHESTRA_ROOT}/bin/(@= prefix @)-apple-darwin11-clang"
+        cp support/add-sysroot-wrapper.sh "${TMP_ROOT}${ORCHESTRA_ROOT}/bin/(@= prefix @)-apple-darwin11-clang"
+        rm -f "${TMP_ROOT}${ORCHESTRA_ROOT}/bin/(@= prefix @)-apple-darwin11-clang++"
+        cp support/add-sysroot-wrapper.sh "${TMP_ROOT}${ORCHESTRA_ROOT}/bin/(@= prefix @)-apple-darwin11-clang++"
+  dependencies:
+    - macos/sdk
+    - clang-release
+    - macos/(@= prefix @)-ld64
+#@ end
+#@ end
+
+---
+#@ macosx_clang_components = _macosx_clang_components()
diff --git a/config/components/macos/ld64.lib.yml b/config/components/macos/ld64.lib.yml
new file mode 100644
index 0000000000000000000000000000000000000000..f2655424022a2cc732ce69181ab8a9ea7af5cbf3
--- /dev/null
+++ b/config/components/macos/ld64.lib.yml
@@ -0,0 +1,55 @@
+#@ load("/lib/make.lib.yml", "make")
+
+#@ source_url = "https://codeload.github.com/tpoechtrager/cctools-port/tar.gz/1e3f614aff4eaae01b6cc4d29c3237c93f3322f8"
+#@ source_url = "https://github.com/tpoechtrager/cctools-port/archive/cctools-877.8-ld64-253.9-1.tar.gz"
+
+---
+#@ def prefixes():
+- x86-64
+- i686
+- arm
+- aarch64
+#@ end
+
+
+#@yaml/text-templated-strings
+---
+#@ def _ld64_components():
+#@ for prefix in prefixes():
+macos/(@= prefix @)-ld64:
+  builds:
+    default:
+      configure: |
+        mkdir -p "$BUILD_DIR"
+
+        # extract.sh --into "$BUILD_DIR" --save-as "cctools-port.tar.gz" "(@= source_url @)"
+        # extract.sh --into "$BUILD_DIR" "(@= source_url @)"
+
+        git clone --depth 1 https://github.com/tpoechtrager/cctools-port.git "$BUILD_DIR"
+
+        cd "$BUILD_DIR/cctools"
+        ./autogen.sh
+        autoconf --force
+        libtoolize --force
+        ./configure \
+          --prefix="$ORCHESTRA_ROOT" \
+          --target=(@= prefix.replace("-", "_") @)-apple-darwin11 \
+          --enable-tapi-support \
+          CC="clang" \
+          CXX="clang++" \
+          OBJC="clang" \
+          CXXFLAGS="-I${BUILD_DIR}/include" \
+          LDFLAGS="-L${BUILD_DIR}/lib"
+      install: |
+        cd "$BUILD_DIR/cctools"
+        (@= make @)
+        (@= make @) install
+  dependencies:
+    - macos/libtapi
+    - clang-release
+    - toolchain/host/gcc
+#@ end
+#@ end
+
+---
+#@ ld64_components = _ld64_components()
diff --git a/config/components/macos/libtapi.lib.yml b/config/components/macos/libtapi.lib.yml
new file mode 100644
index 0000000000000000000000000000000000000000..7cfd1e1da3b8a88ae1d0995d914445a969f6fe21
--- /dev/null
+++ b/config/components/macos/libtapi.lib.yml
@@ -0,0 +1,41 @@
+#@ load("/lib/make.lib.yml", "make")
+#@ load("/lib/cmake.lib.yml", "cmake_base_configuration")
+#@ load("/lib/shell.lib.yml", "expand_args")
+
+#@ clang_source_url = "https://opensource.apple.com/tarballs/clang/clang-800.0.42.1.tar.gz"
+#@ libtapi_source_url = "https://opensource.apple.com/tarballs/tapi/tapi-1.30.tar.gz"
+
+#@yaml/text-templated-strings
+---
+#@ def _libtapi_component():
+builds:
+  default:
+    configure: |
+      mkdir -p "$BUILD_DIR"
+      cd "$BUILD_DIR"
+
+      extract.sh --into "$BUILD_DIR" "(@= clang_source_url @)"
+      extract.sh --into "$BUILD_DIR/src/projects/libtapi" "(@= libtapi_source_url @)"
+
+      sed -i 's|NOT APPLE|FALSE|' src/projects/libtapi/CMakeLists.txt
+      sed -i 's|^|#include <limits>\n|' src/projects/libtapi/include/tapi/Core/ArchitectureSupport.h
+      cmake src/ \
+        (@= expand_args(cmake_base_configuration(cmake_build_type="Release")) @) \
+        -DLLVM_INCLUDE_TESTS=OFF
+    install: |
+      cd "$BUILD_DIR"
+      (@= make @) libtapi
+      mkdir -p "${TMP_ROOT}${ORCHESTRA_ROOT}/lib"
+      mkdir -p "${TMP_ROOT}${ORCHESTRA_ROOT}/include"
+      rm -rf "${TMP_ROOT}${ORCHESTRA_ROOT}/include/tapi/"
+      cp lib/libtapi.so "${TMP_ROOT}${ORCHESTRA_ROOT}/lib/"
+      cp -ar src/projects/libtapi/include/tapi/ "${TMP_ROOT}${ORCHESTRA_ROOT}/include/"
+      cp -a projects/libtapi/include/tapi/Version.inc "${TMP_ROOT}${ORCHESTRA_ROOT}/include/tapi/"
+dependencies:
+  - cmake
+  - clang-release
+  - toolchain/host/gcc
+#@ end
+
+---
+#@ libtapi_component = _libtapi_component()
diff --git a/config/components/macos/macos.lib.yml b/config/components/macos/macos.lib.yml
new file mode 100644
index 0000000000000000000000000000000000000000..9f77b02fa7432e899700f458042b31bd64069c2f
--- /dev/null
+++ b/config/components/macos/macos.lib.yml
@@ -0,0 +1,16 @@
+#@ load("@ytt:template", "template")
+
+#@ load("/components/macos/libtapi.lib.yml", "libtapi_component")
+#@ load("/components/macos/sdk.lib.yml", "macosx_sdk_component")
+#@ load("/components/macos/ld64.lib.yml", "ld64_components")
+#@ load("/components/macos/clang.lib.yml", "macosx_clang_components")
+
+#@ def _macos_toolchain_components():
+macos/libtapi: #@ libtapi_component
+macos/sdk: #@ macosx_sdk_component
+_ : #@ template.replace(ld64_components)
+_ : #@ template.replace(macosx_clang_components)
+#@ end
+
+---
+#@ macos_toolchain_components = _macos_toolchain_components()
diff --git a/config/components/macos/sdk.lib.yml b/config/components/macos/sdk.lib.yml
new file mode 100644
index 0000000000000000000000000000000000000000..c43733666988f17c4e874dcb64de909ee41e21f8
--- /dev/null
+++ b/config/components/macos/sdk.lib.yml
@@ -0,0 +1,21 @@
+#@ sdk_archive_name = "Xcode_9.xip-MacOSX.sdk.tar.gz"
+
+#@yaml/text-templated-strings
+---
+#@ def _macosx_sdk_component():
+builds:
+  default:
+    configure: ""
+    install: |
+      echo "TODO: macosx sdk" && exit 1
+      create-package.sh Xcode_9.xip
+      extract.sh --into "${TMP_ROOT}${ORCHESTRA_ROOT}" --src-archive-dir "$SDK_ARCHIVE_DIR" "(@= sdk_archive_name @)"
+dependencies:
+  - cmake
+  - clang-release
+  - toolchain/host/gcc
+additional_path: "$ORCHESTRA/helpers/repackage-apple-sdk"
+#@ end
+
+---
+#@ macosx_sdk_component = _macosx_sdk_component()