diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index b582b47f1537525216e198631530408056bdb4aa..40fc706a9908b02a80bc4f1eb4ef0edd9192a951 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -19,9 +19,7 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
 include(Variables)
 
 # We go to some trouble to set LL_BUILD to the set of relevant compiler flags.
-set(CMAKE_CXX_FLAGS_RELEASE "$ENV{LL_BUILD_RELEASE}")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "$ENV{LL_BUILD_RELWITHDEBINFO}")
-set(CMAKE_CXX_FLAGS_DEBUG "$ENV{LL_BUILD_DEBUG}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{LL_BUILD}")
 # Given that, all the flags you see added below are flags NOT present in
 # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables.
 # Before adding new ones here, it's important to ask: can this flag really be
@@ -156,6 +154,10 @@ if (DARWIN)
   set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
   set(DARWIN_extra_cstar_flags "-Wno-unused-local-typedef -Wno-deprecated-declarations")
+  # Ensure that CMAKE_CXX_FLAGS has the correct -g debug information format --
+  # see Variables.cmake.
+  string(REPLACE "-gdwarf-2" "-g${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}"
+    CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   # The viewer code base can now be successfully compiled with -std=c++14. But
   # turning that on in the generic viewer-build-variables/variables file would
   # potentially require tweaking each of our ~50 third-party library builds.
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index e8698ace68f47cfd06992882f461f35e14abaf88..bd69c4985644a8e5d4e642341f9b01f5f8c49c5d 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -155,6 +155,20 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 
   string(REGEX MATCH " -g([^ ]*)" scratch "$ENV{LL_BUILD}")
   set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "${CMAKE_MATCH_1}")
+  # -gdwarf-2 is passed in LL_BUILD according to 00-COMPILE-LINK-RUN.txt.
+  # However, when CMake 3.9.2 sees -gdwarf-2, it silently deletes the whole -g
+  # switch, producing no symbols at all! The same thing happens if we specify
+  # plain -g ourselves, i.e. CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT is
+  # the empty string. Specifying -gdwarf-with-dsym or just -gdwarf drives a
+  # different CMake behavior: it substitutes plain -g. As of 2017-09-19,
+  # viewer-build-variables/variables still passes -gdwarf-2, which is the
+  # no-symbols case. Set -gdwarf, triggering CMake to substitute plain -g --
+  # at least that way we should get symbols, albeit mangled ones. It Would Be
+  # Nice if CMake's behavior could be predicted from a consistent mental
+  # model, instead of only observed experimentally.
+  string(REPLACE "dwarf-2" "dwarf"
+    CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT
+    "${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}")
   message(STATUS "CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT = '${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}'")
 
   string(REGEX MATCH "-O([^ ]*)" scratch "$ENV{LL_BUILD}")