bazelbuild / bazelbuild/rules_cc
I tried using rule_based_toolchain, but I get the error: unrecognized option '-Wl,-S'
- Dominant language
- Starlark
- Stars
- 247
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
repo:
https://github.com/kekxv/based_toolchain
This toolchain works fine in the old configuration:
https://github.com/kekxv/cc_mini_toolchain/blob/main/toolchains/toolchains/glibc_linux_x86_64/BUILD
```log
INFO: Analyzed target //example:hello_world (0 packages loaded, 0 targets configured).
SUBCOMMAND: # //example:hello_world [action 'Linking example/hello_world', configuration: ccc2fc2b13bb30202853b419de83021bdffd4ab6a901eff33281bc560d129977, execution platform: //toolchains:linux_x86_64, mnemonic: CppLink]
(cd /home/caesar/.cache/bazel/_bazel_caesar/7f043285842ae4d856021bae20b12bff/execroot/_main && \
exec env - \
PATH=/home/caesar/.cache/bazelisk/downloads/sha256/b4bae524f58e00a69f7c6fa10e62a91f85bfee586105dd480dccb4300c7cbca5/bin:/usr/local/bin:/usr/bin:/bin:/usr/games \
PWD=/proc/self/cwd \
external/+_repo_rules+gcc-linux-x86_64/bin/x86_64-linux-ld -lm -lpthread -ldl -lc -lstdc++ '--sysroot=external/+_repo_rules+gcc-linux-x86_64/x86_64-buildroot-linux-gnu/sysroot' -o bazel-out/k8-fastbuild/bin/example/hello_world -Wl,-S bazel-out/k8-fastbuild/bin/example/_objs/hello_world/main.o)
# Configuration: ccc2fc2b13bb30202853b419de83021bdffd4ab6a901eff33281bc560d129977
# Execution platform: //toolchains:linux_x86_64
# Runner: sandbox-fallback
ERROR: /tmp/based_toolchain/example/BUILD:3:10: Linking example/hello_world failed: (Exit 1): x86_64-linux-ld failed: error executing CppLink command (from target //example:hello_world) external/+_repo_rules+gcc-linux-x86_64/bin/x86_64-linux-ld -lm -lpthread -ldl -lc -lstdc++ '--sysroot=external/+_repo_rules+gcc-linux-x86_64/x86_64-buildroot-linux-gnu/sysroot' -o ... (remaining 3 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/+_repo_rules+gcc-linux-x86_64/bin/x86_64-linux-ld: unrecognized option '-Wl,-S'
external/+_repo_rules+gcc-linux-x86_64/bin/x86_64-linux-ld: use the --help option for usage information
Target //example:hello_world failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.160s, Critical Path: 0.05s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully
```
Contributor guide
Assessment
This issue has not been assessed yet.