diff --git a/indra/cmake/Sentry.cmake b/indra/cmake/Sentry.cmake
index 86f5b0fc4cab9637db1ee6d43c41689ae2529f60..5206534f7d7d42ee669c90b42182ae34f351e4e1 100644
--- a/indra/cmake/Sentry.cmake
+++ b/indra/cmake/Sentry.cmake
@@ -40,5 +40,5 @@ if (USE_SENTRY)
     endif()
 
     set(SENTRY_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/sentry)
-    set(SENTRY_DEFINE "USE_SENTRY")
+    set(SENTRY_DEFINE "USE_SENTRY=1")
 endif ()
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 5d5595b2da8dae6527a45ef5ce67817be298ac9a..c0b69da7f66bdbb114b95a9cfd2c1b3f08f257a6 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1792,14 +1792,11 @@ add_executable(${VIEWER_BINARY_NAME}
     )
 
 if (SDL_FOUND)
-  set_property(TARGET ${VIEWER_BINARY_NAME}
-    PROPERTY COMPILE_DEFINITIONS LL_SDL=1
-    )
+  target_compile_definitions(${VIEWER_BINARY_NAME} PRIVATE LL_SDL=1)
 endif (SDL_FOUND)
 
 if (USE_SENTRY)
-  set_property(TARGET ${VIEWER_BINARY_NAME}
-    PROPERTY COMPILE_DEFINITIONS "${SENTRY_DEFINE}")
+  target_compile_definitions(${VIEWER_BINARY_NAME} PRIVATE ${SENTRY_DEFINE})
 
   list(APPEND viewer_LIBRARIES
        ${SENTRY_LIBRARIES}
@@ -2164,6 +2161,29 @@ if (LINUX)
     media_plugin_libvlc
     )
 
+  find_program (OBJCOPY NAMES "objcopy" REQUIRED)
+
+  add_custom_command (TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+                      COMMAND ${OBJCOPY}
+                      ARGS
+                        --only-keep-debug --compress-debug-sections=zlib
+                        ${VIEWER_BINARY_NAME} "${VIEWER_BINARY_NAME}.debug"
+                      BYPRODUCTS "${VIEWER_BINARY_NAME}.debug"
+                      COMMENT "Extracting and compressing debug information")
+
+  add_custom_command (TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+                      COMMAND ${OBJCOPY}
+                      ARGS
+                        --strip-all ${VIEWER_BINARY_NAME}
+                      COMMENT "Extracting and compressing debug information")
+
+  add_custom_command (TARGET ${VIEWER_BINARY_NAME} POST_BUILD
+                      COMMAND ${OBJCOPY}
+                      ARGS
+                        --add-gnu-debuglink="${VIEWER_BINARY_NAME}.debug" ${VIEWER_BINARY_NAME}
+                      COMMENT "Extracting and compressing debug information")
+
+  if (PACKAGE)
   add_custom_command(
       OUTPUT ${product}.tar.xz
       COMMAND ${Python3_EXECUTABLE}
@@ -2188,8 +2208,6 @@ if (LINUX)
         ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
         ${COPY_INPUT_DEPENDENCIES}
       )
-
-  if (PACKAGE)
   endif (PACKAGE)
 
   add_custom_command(
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp
index 398bcfb5cbd21c08ec41762691a79930fd5570f3..5fee1126fda5930298d8f8819a14fe9757999c15 100644
--- a/indra/newview/llappviewerlinux.cpp
+++ b/indra/newview/llappviewerlinux.cpp
@@ -346,7 +346,7 @@ void LLAppViewerLinux::initCrashReporting(bool reportFreeze)
 	sentry_options_set_release(options, LL_VIEWER_CHANNEL_AND_VERSION);
 
 	std::string database_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "sentry");
-	sentry_options_set_database_path(options, database_path);
+	sentry_options_set_database_path(options, database_path.c_str());
 
 	mSentryInitialized = (sentry_init(options) == 0);
 	if (mSentryInitialized)
diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h
index 0289c43043f2a906ce2b2f24c02be4223270fe93..c5b61fdb8ea1712fca4624abdd9edddadee38eb0 100644
--- a/indra/newview/llappviewerlinux.h
+++ b/indra/newview/llappviewerlinux.h
@@ -68,6 +68,8 @@ class LLAppViewerLinux : public LLAppViewer
 
 	virtual bool initSLURLHandler();
 	virtual bool sendURLToOtherInstance(const std::string& url);
+private:
+	bool mSentryInitialized;
 };
 
 #if LL_DBUS_ENABLED