From bfcbcd6eaa6b6d78516169069d83afb717c319e6 Mon Sep 17 00:00:00 2001 From: nipil Date: Tue, 19 Mar 2024 13:44:57 -0700 Subject: [PATCH] [bazel/dbg copt] fix warning name for GCC (#36040) Reproduced with : - bazel-bootstrap 3.5.1+ds-3 (pulling bazel 6.4.0) - setting CC to gcc and CXX to g++ otherwise bazel does not detect it - overall, using debian 11 using default gcc/g++ versions 10.2.1 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 for GCC 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 (so any help will be appreciated) Closes #36040 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36040 from nipil:fix_compile_dbg_option 7ade99de768ebfd6a2cc1a8e466381d88bbccb81 PiperOrigin-RevId: 617281605 --- tools/bazel.rc | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/bazel.rc b/tools/bazel.rc index 83fc0aa1767..336a9d3a870 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -36,7 +36,6 @@ build:opt --compilation_mode=opt build:opt --copt=-Wframe-larger-than=16384 build:dbg --compilation_mode=dbg -build:dbg --copt=-Werror=return-stack-address # Dynamic link cause issues like: `dyld: malformed mach-o: load commands size (59272) > 32768` # https://github.com/bazelbuild/bazel/issues/9190