envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Linking failed when trying to compile the binary from the envoy 1.29.1

Open alanalanyu opened this issue 1 year ago • 3 comments

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

alanalanyu avatar Apr 27 '24 18:04 alanalanyu

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

adisuissa avatar Apr 29 '24 13:04 adisuissa

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

phlax avatar Apr 29 '24 13:04 phlax

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.

github-actions[bot] avatar May 29 '24 16:05 github-actions[bot]

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.

github-actions[bot] avatar Jun 05 '24 20:06 github-actions[bot]

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.

akuteRoblo avatar Sep 12 '24 06:09 akuteRoblo

@adisuissa or @phlax can we reopen this

akuteRoblo avatar Sep 13 '24 23:09 akuteRoblo

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.

github-actions[bot] avatar Oct 14 '24 08:10 github-actions[bot]

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.

github-actions[bot] avatar Oct 21 '24 08:10 github-actions[bot]