From efe76524067c7948e2ccdbf735c5419a7554ddc3 Mon Sep 17 00:00:00 2001
From: Omair Majid <omajid@redhat.com>
Date: Wed, 1 Nov 2017 00:13:41 -0400
Subject: [PATCH] Add -g flag to generate debuginfo on unix platforms (#24979)
The windows build already includes /Zi /Zl as part of commit 920fd2f3
(PR #7840). It looks like it was simply missed on Unix.
This change also makes the native debug information closer to what
CoreCLR does on all platforms. See
https://github.com/dotnet/coreclr/pull/3445 for more information.
This is also needed for the end-to-end debuginfo generation as part of
source-build. See https://github.com/dotnet/source-build/issues/267
---
src/Native/Unix/CMakeLists.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git dotnet/src/corefx/src/Native/Unix/CMakeLists.txt dotnet/src/corefx/src/Native/Unix/CMakeLists.txt
index de8ae20f262..ca2716f37b5 100644
--- dotnet/src/corefx/src/Native/Unix/CMakeLists.txt
+++ dotnet/src/corefx/src/Native/Unix/CMakeLists.txt
@@ -20,6 +20,7 @@ add_compile_options(-fPIC)
add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/Common)
add_compile_options(-I${CMAKE_CURRENT_BINARY_DIR}/Common)
add_compile_options(-Wno-c99-extensions)
+add_compile_options(-g)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
add_compile_options(-Wno-unreachable-code)
@@ -60,7 +61,7 @@ endif ()
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)
if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG)
- add_compile_options(-g -O0)
+ add_compile_options(-O0)
add_definitions(-DDEBUG)
# obtain settings from running coreclr\enablesanitizers.sh