You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am compiling Envoy using Bazel, and I encountered an issue during the process: there is a problem compiling gperftools. After investigation, I found that the issue is caused by incorrect LDFLAGS—specifically, --gdb-index is not supported by my ld.
I discovered that rules_foreign_cc automatically generates a configuration file named gperftools_build_foreign_cc/build_script.sh, which specifies the erroneous LDFLAGS. I tried to manually modify this file, but each time I compile, a new file is generated, overwriting my changes. I also attempted to set LDFLAGS in the system environment, but it had no effect.
I searched for gdb-index in the Envoy, gperftools, and rules_foreign_cc project files, but strangely, none of them specify this ld parameter. I suspect that rules_foreign_cc retrieves this ld parameter via ldflags = flags_info.cxx_linker_executable, and I pinpointed the code to:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am compiling Envoy using Bazel, and I encountered an issue during the process: there is a problem compiling gperftools. After investigation, I found that the issue is caused by incorrect LDFLAGS—specifically,
--gdb-index
is not supported by myld
.I discovered that
rules_foreign_cc
automatically generates a configuration file namedgperftools_build_foreign_cc/build_script.sh
, which specifies the erroneous LDFLAGS. I tried to manually modify this file, but each time I compile, a new file is generated, overwriting my changes. I also attempted to set LDFLAGS in the system environment, but it had no effect.I searched for
gdb-index
in the Envoy, gperftools, and rules_foreign_cc project files, but strangely, none of them specify thisld
parameter. I suspect thatrules_foreign_cc
retrieves thisld
parameter vialdflags = flags_info.cxx_linker_executable
, and I pinpointed the code to:It seems that this
ld
parameter is retrieved from thecc_toolchain
. Could you provide some advice on how to specify LDFLAGS?Beta Was this translation helpful? Give feedback.
All reactions