diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9d6f2b7b00e125cd80e14261dea52af4eaa70b20..410580ca1c0c9cfc164d38cda1e0c8688616b0ae 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -158,8 +158,10 @@ target_link_libraries(tarantool
     ${common_libraries}
     -rdynamic)
 
-if (module_link_flags)
+# Necessary to make LuaJIT work on Darwin, see
+# http://luajit.org/install.html
+if (TARGET_OS_DARWIN)
     set_target_properties(tarantool PROPERTIES
-        LINK_FLAGS ${module_link_flags})
+        LINK_FLAGS "-pagezero_size 10000 -image_base 100000000")
 endif()
 install (TARGETS tarantool DESTINATION bin)
diff --git a/src/box/CMakeLists.txt b/src/box/CMakeLists.txt
index 600f848a2bc544640eee935a9a8ea2325f653719..0bf3dcc0f313fd23db9034f214f380edff0b20bb 100644
--- a/src/box/CMakeLists.txt
+++ b/src/box/CMakeLists.txt
@@ -1,7 +1,3 @@
-if (TARGET_OS_DARWIN)
-    set(module_link_flags "-pagezero_size 10000 -image_base 100000000")
-endif()
-
 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/src/box/lua)
 
 include_directories(${SOPHIA_INCLUDE_DIR})
diff --git a/src/lua/init.cc b/src/lua/init.cc
index 6be42b410f7a0fafa666360e946555f8cdaf7412..06102f8f31b3420ad7395d05a7d205ce3587f131 100644
--- a/src/lua/init.cc
+++ b/src/lua/init.cc
@@ -262,8 +262,9 @@ void
 tarantool_lua_init()
 {
 	lua_State *L = luaL_newstate();
-	if (L == NULL)
-		return;
+	if (L == NULL) {
+		panic("failed to initialize Lua");
+	}
 	luaL_openlibs(L);
 	/*
 	 * Search for Lua modules, apart from the standard