From 5c037fe1226d8ae8c8fb964fb60e5de487550d7c Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 1 Feb 2022 09:44:00 -0800 Subject: [PATCH] Revert "cmake: compiler/xcc: omit -g if needed for Clang" This reverts commit deeb98da5328c6fbdfc4ad1c7638a205d86f83e7. 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 --- cmake/compiler/gcc/compiler_flags.cmake | 12 +++++------- cmake/compiler/xcc/compiler_flags.cmake | 4 ---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/cmake/compiler/gcc/compiler_flags.cmake b/cmake/compiler/gcc/compiler_flags.cmake index 1921d97dc52..bc3f37b2fc5 100644 --- a/cmake/compiler/gcc/compiler_flags.cmake +++ b/cmake/compiler/gcc/compiler_flags.cmake @@ -162,14 +162,12 @@ check_set_compiler_property(APPEND PROPERTY hosted -fno-freestanding) # gcc flag for a freestandingapplication set_compiler_property(PROPERTY freestanding -ffreestanding) -if(NOT DEFINED GCC_NO_G_FLAG) - # Flag to enable debugging - set_compiler_property(PROPERTY debug -g) +# Flag to enable debugging +set_compiler_property(PROPERTY debug -g) - # GCC 11 by default emits DWARF version 5 which cannot be parsed by - # pyelftools. Can be removed once pyelftools supports v5. - check_set_compiler_property(APPEND PROPERTY debug -gdwarf-4) -endif() +# GCC 11 by default emits DWARF version 5 which cannot be parsed by +# pyelftools. Can be removed once pyelftools supports v5. +check_set_compiler_property(APPEND PROPERTY debug -gdwarf-4) set_compiler_property(PROPERTY no_common -fno-common) diff --git a/cmake/compiler/xcc/compiler_flags.cmake b/cmake/compiler/xcc/compiler_flags.cmake index 53be2d3da64..92ef62c4be1 100644 --- a/cmake/compiler/xcc/compiler_flags.cmake +++ b/cmake/compiler/xcc/compiler_flags.cmake @@ -1,10 +1,6 @@ # No special flags are needed for xcc. # Only select whether gcc or clang flags should be inherited. if(CC STREQUAL "clang") - if($ENV{XCC_NO_G_FLAG}) - set(GCC_NO_G_FLAG 1) - endif() - include(${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake) # Now, let's overwrite the flags that are different in xcc/clang.