bazelbuild / bazelbuild/rules_rust

processwrapper using system dynamic linker with hermetic sysroot libc from cc toolchain

Open
#3,375 1 comment 1 reaction 0 assignees View on GitHub
awaiting-response bug needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

We have a custom hermetic gcc toolchain with a sysroot. However, when building third party rust libraries with process_wrapper, we see that all the sysroot deps are found for the processwrapper, but the linker is still using system's dynamic linker. Why is this the case?

We set

```
--@rules_rust//rust/settings:experimental_use_cc_common_link=true

```

```
bazel-out/k8-opt-exec-ST-a828a81199fe/bin/external/rules_rust/util/process_wrapper/process_wrapper --subst 'pwd=${pwd}' -- bazel-out/k8-opt/bin/external/rust_linux_x86_64__x86_64-unknown-linux-gnu__stable_tools/rust_toolchain/bin/rustc external/crate_index__unindent-0.2.3/src/lib.rs '--crate-name=unindent' '--crate-type=rlib' '--error-format=human' '--codegen=metadata=-1314625682' '--codegen=extra-filename=-1314625682' '--out-dir=bazel-out/k8-opt/bin/external/crate_index__unindent-0.2.3' '--codegen=opt-level=3' '--codegen=debuginfo=0' '--codegen=strip=debuginfo' '--remap-path-prefix=${pwd}=' '--emit=dep-info,link' '--color=always' '--target=x86_64-unknown-linux-gnu' -L bazel-out/k8-opt/bin/external/rust_linux_x86_64__x86_64-unknown-linux-gnu__stable_tools/rust_toolchain/lib/rustlib/x86_64-unknown-linux-gnu/lib '--edition=2021' '-Cembed-bitcode=no' '-Ctarget-cpu=x86-64-v3' '-Cforce-frame-pointers=y' '-Cforce-unwind-tables=y' '--cap-lints=allow'

Inconsistency detected by ld.so: dl-call-libc-early-init.c: 37: _dl_call_libc_early_init: Assertion `sym != NULL' failed!

ldd bazel-out/k8-opt-exec-ST-a828a81199fe/bin/external/rules_rust/util/process_wrapper/process_wrapper
linux-vdso.so.1 (0x00007fffa19de000)
libm.so.6 => external/sysroot_x86_64/usr/lib/libm.so.6 (0x00007858bd642000)
librt.so.1 => external/sysroot_x86_64/usr/lib/librt.so.1 (0x00007858bd638000)
libstdc++.so.6 => external/sysroot_x86_64/lib64/libstdc++.so.6 (0x00007858bd461000)
libdl.so.2 => external/sysroot_x86_64/usr/lib/libdl.so.2 (0x00007858bd45c000)
libpthread.so.0 => external/sysroot_x86_64/usr/lib/libpthread.so.0 (0x00007858bd43b000)
libgcc_s.so.1 => external/sysroot_x86_64/lib64/libgcc_s.so.1 (0x00007858bd421000)
libc.so.6 => external/sysroot_x86_64/usr/lib/libc.so.6 (0x00007858bd265000)
/lib64/ld-linux-x86-64.so.2 (0x00007858bd846000)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.