diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 5d0fdb092f87007f9b25cd580a5351a293e789e6..c3addf93195106a7743cfbb650091103b02a5bac 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -19,13 +19,8 @@ qt:!isEmpty(QT_CONFIG) {
     contains(QT_CONFIG, static):contains(QT_CONFIG, c++11): CONFIG += c++11
 }
 
-isEmpty(_QMAKE_CACHE_) {
-    warning("No .qmake.cache is present. This significantly slows down qmake with this makespec.")
-    warning("Call 'cache()' in the top-level project file to rectify this problem.")
-} else {
-    cache(QMAKE_XCODE_DEVELOPER_PATH)
-    cache(QMAKE_XCODE_VERSION)
-}
+cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
+cache(QMAKE_XCODE_VERSION, stash)
 
 QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
 
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index 788fa5b3622c0ad1878c19253c51b4956d4251a8..5b5186a14b9387aa89190e05fe95490628bcd141 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -8,7 +8,7 @@ contains(QMAKE_MAC_SDK, .*/.*): \
 isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path) {
     QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
     isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
-    !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set, QMAKE_MAC_SDK_PATH)
+    cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path, set stash, QMAKE_MAC_SDK_PATH)
 } else {
     QMAKE_MAC_SDK_PATH = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.path)
 }
@@ -41,7 +41,7 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
     isEmpty(sysrooted): next()
 
     $$tool = $$sysrooted $$member(value, 1, -1)
-    !isEmpty(_QMAKE_CACHE_): cache($$tool_variable, set, $$tool)
+    cache($$tool_variable, set stash, $$tool)
 }
 
 isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
@@ -52,7 +52,7 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
         "sed 's/.*Value: \\(.*\\)/\\1/'")
 
     isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")
-    !isEmpty(_QMAKE_CACHE_): cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set, QMAKE_MAC_PLATFORM_NAME)
+    cache(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name, set stash, QMAKE_MAC_PLATFORM_NAME)
 } else {
     QMAKE_MAC_PLATFORM_NAME = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name)
 }