[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 7ade99de76
PiperOrigin-RevId: 617281605
pull/36152/head
nipil 8 months ago committed by Copybara-Service
parent d6bb391449
commit bfcbcd6eaa
  1. 1
      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

Loading…
Cancel
Save