envoy
envoy copied to clipboard
Linking failed when trying to compile the binary from the envoy 1.29.1
Title: Linking failed when trying to compile the binary from the envoy 1.29.1
Description: Call to envoy_cc_binary
envoy_cc_binary(
name = "my-gateway",
repository = "@envoy",
deps = [
"my-filter-lib",
"@envoy//source/exe:envoy_main_entry_lib",
],
)
How I build the my-gateway
ADDITIONAL_BAZEL_ARGS=--disk_cache=/bazel-cache --repository_cache=/bazel-repo-cache
bazel-6.3.2 build -c opt ${ADDITIONAL_BAZEL_ARGS} //:my-gateway
Envoy proxy version 1.29.1, bazel version 6.3.2
My .bazelrc
import %workspace%/envoy/.bazelrc
build --features=external_include_paths
The error is as follows
Linking my-gateway failed: (Exit 1): gcc failed: error executing command (from target //:my-gateway) /usr/bin/gcc @bazel-out/k8-opt/bin/my-gateway-2.params
2024-04-27T09:11:31.2881143Z
2024-04-27T09:11:31.2881775Z Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
2024-04-27T09:11:31.2882863Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/envoy/source/extensions/filters/http/grpc_field_extraction/message_converter/_objs/message_converter_lib/message_converter.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
2024-04-27T09:11:31.2883941Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/envoy/source/extensions/tracers/xray/_objs/config/config.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
2024-04-27T09:11:31.2884917Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/v8/_objs/v8_libshared_noicu/debug-stack-trace-iterator.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
2024-04-27T09:11:31.2885831Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/v8/_objs/v8_libshared_noicu/bytecode-flags.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
2024-04-27T09:11:31.2886797Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/v8/_objs/v8_libshared_noicu/property.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
2024-04-27T09:11:31.2887563Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/v8/_objs/v8_libshared_noicu/code-space-access.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
2024-04-27T09:11:31.2891840Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/v8/_objs/v8_libshared_noicu/proxy-has-property-tq-csa.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
2024-04-27T09:11:31.2893363Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/v8/_objs/v8_libshared_noicu/reflect-tq-csa.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
2024-04-27T09:11:31.2895011Z /usr/bin/ld.gold: warning: bazel-out/k8-opt/bin/external/envoy/source/extensions/config_subscription/rest/_objs/rest_api_fetcher_lib/rest_api_fetcher.o: top level DIE is not DW_TAG_compile_unit or DW_TAG_type_unit
Thanks for reporting this. Was the building successful with Envoy version 1.29.0? If not, what was the latest version that was successfully built?
cc @phlax
i would check on @adisuissa 's suggestion first
the issue is related to gcc (cf https://www.spinics.net/lists/libreoffice/msg08609.html)
i would recommend using llvm via ci/run_envoy_docker.sh to ensure you have the correct version
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.
Im running into the same issue. Adding --linkopt=-fuse-ld=lld to my .bazelrc to change the linker to llvm did not fix the issue. I follow the same way the original poster described for building envoy.
@adisuissa or @phlax can we reopen this
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.