diff --git a/cmake/BuildLibCURL.cmake b/cmake/BuildLibCURL.cmake
index dc1b407503df25e9c9b50ce6fdc29a79296fcd50..12062ec8bea2da78e5f0a6a0cf14a44a708a9b3f 100644
--- a/cmake/BuildLibCURL.cmake
+++ b/cmake/BuildLibCURL.cmake
@@ -45,9 +45,21 @@ macro(curl_build)
         CONFIGURE_COMMAND
             cd <SOURCE_DIR> && ./buildconf &&
             cd <BINARY_DIR> && <SOURCE_DIR>/configure
+                # Pass the same toolchain as is used to build
+                # tarantool itself, because they can be
+                # incompatible.
                 CC=${CMAKE_C_COMPILER}
+                LD=${CMAKE_LINKER}
+                AR=${CMAKE_AR}
+                RANLIB=${CMAKE_RANLIB}
+                NM=${CMAKE_NM}
+                STRIP=${CMAKE_STRIP}
+
+                # Pass -isysroot=<SDK_PATH> option on Mac OS, see
+                # above.
                 CPPFLAGS=${LIBCURL_CPPFLAGS}
                 CFLAGS=${LIBCURL_CFLAGS}
+
                 --prefix <INSTALL_DIR>
                 --enable-static
                 --enable-shared
diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake
index eca2bf36bd89aa3c6bda757cebedfdbd54b5f770..10df633d57a1d2edd3eb05301a3baa43b7e3449f 100644
--- a/cmake/luajit.cmake
+++ b/cmake/luajit.cmake
@@ -223,12 +223,24 @@ macro(luajit_build)
     foreach(def ${defs})
         set(luajit_xcflags ${luajit_xcflags} -D${def})
     endforeach()
+
+    # Pass the same toolchain that is used for building of
+    # tarantool itself, because tools from different toolchains
+    # can be incompatible. A compiler and a linker are already set
+    # above.
+    set (luajit_ld ${CMAKE_LINKER})
+    set (luajit_ar ${CMAKE_AR} rcus)
+    set (luajit_strip ${CMAKE_STRIP})
+
     set (luajit_buildoptions
         BUILDMODE=static
         HOST_CC="${luajit_hostcc}"
         TARGET_CC="${luajit_cc}"
         TARGET_CFLAGS="${luajit_cflags}"
+        TARGET_LD="${luajit_ld}"
         TARGET_LDFLAGS="${luajit_ldflags}"
+        TARGET_AR="${luajit_ar}"
+        TARGET_STRIP="${luajit_strip}"
         TARGET_SYS="${CMAKE_SYSTEM_NAME}"
         CCOPT="${luajit_ccopt}"
         CCDEBUG="${luajit_ccdebug}"