Skip to content

Conversation

@dzbarsky
Copy link
Contributor

@dzbarsky dzbarsky commented Nov 25, 2025

The current handling of static_runtime_lib/dynamic_runtime_lib is broken because it never adds these libs to the action. I think it assumes they are coming from cc_toolchain.all_files but that's not necessarily a safe assumption; when these libs are built from source there's no reason to force all actions to depend on both of them via the toolchain files if we may not end up using them. (We hit this scenario in https://github.com/cerisier/toolchains_llvm_bootstrapped)

args.add_all(make_link_flags_args, map_each = make_link_flags)

args.add_all(linkstamp_outs, before_each = "-C", format_each = "link-args=%s")
args.add_all(linkstamp_outs, format_each = "-Clink-args=%s")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by cleanup

if crate_type in ["dylib", "cdylib"]:
# For shared libraries we want to link C++ runtime library dynamically
# (for example libstdc++.so or libc++.so).
args.add_all(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of this is drive-by cleanup; I initially thought they needed to be passed by full path and then discovered they weren't in the sandbox at all :)

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dzbarsky dzbarsky force-pushed the zbarsky/runtime-libs branch from 8cb02aa to deb6664 Compare November 25, 2025 20:49
@UebelAndre UebelAndre added this pull request to the merge queue Nov 25, 2025
Merged via the queue into bazelbuild:main with commit da4de3b Nov 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants