cpp-tutorial build error , Linking main/hello-world failed

Open
#256 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
build-system

Research direction

Reproduce the failure with bazel build //main:hello-world from the cpp-tutorial on an M1 Mac, then inspect stage1/main/BUILD and the generated command referenced in the error. Trace where the invalid -fuse-ld=-debugger-tuning=lldb flag is introduced; done means the //main:hello-world target links successfully with the documented toolchain.

Written by the indexing model from the issue text.

Description

bazel build //main:hello-world in m1 mac

INFO: Analyzed target //main:hello-world (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR:/bazel-examples/cpp-tutorial/stage1/main/BUILD:3:10: Linking main/hello-world failed: (Exit 1): cc_wrapper.sh failed: error executing command external/local_config_cc/cc_wrapper.sh @bazel-out/darwin_arm64-fastbuild/bin/main/hello-world-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
clang: error: invalid linker name in argument '-fuse-ld=-debugger-tuning=lldb'
Target //main:hello-world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.259s, Critical Path: 0.07s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully

Sounds my clang-14 can't handle-fuse-ld=-debugger-tuning=lldb ,by the way,I found it can deal with-debugger-tuning=-fuse-ld=lldb.Maybe I should change the command -fuse-ld=-debugger-tuning=lldb in bazel-out?But I don‘t know how to change it.Have you ever had the same situation?

Dominant language
Starlark
Stars
957
Forks
578
Avg merge
2d 10h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/examples

All issues in bazelbuild/examples

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.