Skip to content

Commit 5c037fe

Browse files
dcpleungnashif
authored andcommitted
Revert "cmake: compiler/xcc: omit -g if needed for Clang"
This reverts commit deeb98d. A less invasive change has been implemented which does not require changes to the GCC compiler flag file. So revert the commit. Signed-off-by: Daniel Leung <[email protected]>
1 parent 0b09ca8 commit 5c037fe

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

cmake/compiler/gcc/compiler_flags.cmake

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,12 @@ check_set_compiler_property(APPEND PROPERTY hosted -fno-freestanding)
162162
# gcc flag for a freestandingapplication
163163
set_compiler_property(PROPERTY freestanding -ffreestanding)
164164

165-
if(NOT DEFINED GCC_NO_G_FLAG)
166-
# Flag to enable debugging
167-
set_compiler_property(PROPERTY debug -g)
165+
# Flag to enable debugging
166+
set_compiler_property(PROPERTY debug -g)
168167

169-
# GCC 11 by default emits DWARF version 5 which cannot be parsed by
170-
# pyelftools. Can be removed once pyelftools supports v5.
171-
check_set_compiler_property(APPEND PROPERTY debug -gdwarf-4)
172-
endif()
168+
# GCC 11 by default emits DWARF version 5 which cannot be parsed by
169+
# pyelftools. Can be removed once pyelftools supports v5.
170+
check_set_compiler_property(APPEND PROPERTY debug -gdwarf-4)
173171

174172
set_compiler_property(PROPERTY no_common -fno-common)
175173

cmake/compiler/xcc/compiler_flags.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# No special flags are needed for xcc.
22
# Only select whether gcc or clang flags should be inherited.
33
if(CC STREQUAL "clang")
4-
if($ENV{XCC_NO_G_FLAG})
5-
set(GCC_NO_G_FLAG 1)
6-
endif()
7-
84
include(${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake)
95

106
# Now, let's overwrite the flags that are different in xcc/clang.

0 commit comments

Comments
 (0)