mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Set -g0 to make cc_pie_obj produce deterministic output to help Bazel caching.
The output object file contains debug information, which, by default, contains the absolute path to source files. These absolute paths are volatile data because they contain host/user specific paths, which makes the files differ between invocations. This then negatively affects Bazel's ability to accurately detect changes and cache them, which means people need to rebuilt it much more frequently. To fix, specify `-g0`, which will omit debugging information entirely. PiperOrigin-RevId: 609575453
This commit is contained in:
@@ -24,7 +24,12 @@ def cc_pie_obj(name, srcs, outs):
|
||||
" -fno-builtin " +
|
||||
"-ffreestanding " +
|
||||
"-mgeneral-regs-only " +
|
||||
"-g " +
|
||||
# Set -g0 to omit debugging information because it contains
|
||||
# absolute paths, which are volatile build information and results
|
||||
# in Bazel being unable to properly cache the output. If debugging
|
||||
# information is desired, the flags -fdebug-compilation-dir or
|
||||
# -fdebug-prefix-map can be used.
|
||||
"-g0 " +
|
||||
"-Wa,--noexecstack " +
|
||||
"-fno-asynchronous-unwind-tables " +
|
||||
"-fno-stack-protector " +
|
||||
|
||||
Reference in New Issue
Block a user