diff mbox series

[v1,2/6] perf build: Don't always set -funwind-tables and -ggdb3

Message ID 20230728064917.767761-3-irogers@google.com (mailing list archive)
State Not Applicable
Headers show
Series Simplify C/C++ compiler flags | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Ian Rogers July 28, 2023, 6:49 a.m. UTC
Commit 6a40cd90f5de ("perf tools: Add libunwind dependency for DWARF
CFI unwinding") added libunwind support but also -funwind-tables and
-ggdb3 to the standard build. These build flags aren't necessary so
remove, set -g when DEBUG is enabled for the build.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/Makefile.config | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

James Clark July 28, 2023, 8:56 a.m. UTC | #1
On 28/07/2023 07:49, Ian Rogers wrote:
> Commit 6a40cd90f5de ("perf tools: Add libunwind dependency for DWARF
> CFI unwinding") added libunwind support but also -funwind-tables and
> -ggdb3 to the standard build. These build flags aren't necessary so
> remove, set -g when DEBUG is enabled for the build.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/Makefile.config | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
> index a9cfe83638a9..14709a6bd622 100644
> --- a/tools/perf/Makefile.config
> +++ b/tools/perf/Makefile.config
> @@ -246,6 +246,9 @@ ifeq ($(CC_NO_CLANG), 0)
>  else
>    CORE_CFLAGS += -O6
>  endif
> +else
> +  CORE_CFLAGS += -g
> +  CXXFLAGS += -g
>  endif
>  
>  ifdef PARSER_DEBUG
> @@ -324,8 +327,6 @@ FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
>  FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
>  
>  CORE_CFLAGS += -fno-omit-frame-pointer
> -CORE_CFLAGS += -ggdb3
> -CORE_CFLAGS += -funwind-tables
>  CORE_CFLAGS += -Wall
>  CORE_CFLAGS += -Wextra
>  CORE_CFLAGS += -std=gnu11
> @@ -333,8 +334,6 @@ CORE_CFLAGS += -std=gnu11
>  CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
>  CXXFLAGS += -Wall
>  CXXFLAGS += -fno-omit-frame-pointer
> -CXXFLAGS += -ggdb3
> -CXXFLAGS += -funwind-tables
>  CXXFLAGS += -Wno-strict-aliasing
>  
>  HOSTCFLAGS += -Wall

Acked-by: James Clark <james.clark@arm.com>
diff mbox series

Patch

diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index a9cfe83638a9..14709a6bd622 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -246,6 +246,9 @@  ifeq ($(CC_NO_CLANG), 0)
 else
   CORE_CFLAGS += -O6
 endif
+else
+  CORE_CFLAGS += -g
+  CXXFLAGS += -g
 endif
 
 ifdef PARSER_DEBUG
@@ -324,8 +327,6 @@  FEATURE_CHECK_LDFLAGS-disassembler-four-args = -lbfd -lopcodes -ldl
 FEATURE_CHECK_LDFLAGS-disassembler-init-styled = -lbfd -lopcodes -ldl
 
 CORE_CFLAGS += -fno-omit-frame-pointer
-CORE_CFLAGS += -ggdb3
-CORE_CFLAGS += -funwind-tables
 CORE_CFLAGS += -Wall
 CORE_CFLAGS += -Wextra
 CORE_CFLAGS += -std=gnu11
@@ -333,8 +334,6 @@  CORE_CFLAGS += -std=gnu11
 CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
 CXXFLAGS += -Wall
 CXXFLAGS += -fno-omit-frame-pointer
-CXXFLAGS += -ggdb3
-CXXFLAGS += -funwind-tables
 CXXFLAGS += -Wno-strict-aliasing
 
 HOSTCFLAGS += -Wall