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