From b12735934239b4ec577cdaa9ba1eba7ff8a9c8a3 Mon Sep 17 00:00:00 2001 From: nipil Date: Sun, 3 Mar 2024 08:55:18 +0100 Subject: [PATCH] [bazel/dbg copt] fix warning name for GCC When using --config=dbg, a warning name produces an error at the beginning of the compilation : `cc1plus: error: '-Werror=return-stack-address': no option '-Wreturn-stack-address'; did you mean '-Wreturn-local-addr'?` Fixed the error following the compiler advice (tested on Debian 11 using default gcc/g++ versions 10.2.1) PLEASE NOTE : I guess `return-stack-address` might be related to CLANG and `return-local-addr` is the GCC equivalent. I do not know CLANG, nor am i good enough with bazel to know how to make this option flexible. --- tools/bazel.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bazel.rc b/tools/bazel.rc index 83fc0aa1767..561d9b371a7 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -36,7 +36,7 @@ build:opt --compilation_mode=opt build:opt --copt=-Wframe-larger-than=16384 build:dbg --compilation_mode=dbg -build:dbg --copt=-Werror=return-stack-address +build:dbg --copt=-Werror=return-local-addr # Dynamic link cause issues like: `dyld: malformed mach-o: load commands size (59272) > 32768` # https://github.com/bazelbuild/bazel/issues/9190