Subject: [PATCH bazel-zig-cc 0/1] Adds supports_dynamic_linker feature

From: ~jvolkman <[email-masked]>
Date: Sat, 17 Dec 2022 01:00:18 +0000

I noticed that the default cc toolchain outputs .so files next to the
.a, and provides a "dynamic_library" output group. With bazel-zig-cc, an
attempt to use the "dynamic_library" output group fails with
> failed: Toolchain does not support dynamic linking

Maybe I'm missing something, but adding support seems as simple as
enabling the "supports_dynamic_linker" flag.

Jeremy Volkman (1):
  Adds supports_dynamic_linker feature

 toolchain/zig_toolchain.bzl | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.34.5

---

From: ~jvolkman <[email-masked]>
Date: Fri, 16 Dec 2022 16:44:57 -0800

From: Jeremy Volkman <[email-masked]>

With this feature, cc_library generates a .so as well as a .a and the
"dynamic_library" output group is enabled.
---
 toolchain/zig_toolchain.bzl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/toolchain/zig_toolchain.bzl b/toolchain/zig_toolchain.bzl
index f76aa80..2578973 100644
--- a/toolchain/zig_toolchain.bzl
+++ b/toolchain/zig_toolchain.bzl
@@ -129,9 +129,15 @@ def _zig_cc_toolchain_config_impl(ctx):
         flag_sets = dynamic_library_flag_sets,
     )
 
+    supports_dynamic_linker = feature(
+        name = "supports_dynamic_linker",
+        enabled = True,
+    )
+
     features = [
         compile_and_link_flags,
         default_linker_flags,
+        supports_dynamic_linker,
     ] + _compilation_mode_features(ctx)
 
     return cc_common.create_cc_toolchain_config_info(
-- 
2.34.5

---

From: "builds.sr.ht" <[email-masked]>
Date: Sat, 17 Dec 2022 01:18:26 +0000

bazel-zig-cc/patches/.build.yml: SUCCESS in 18m7s

[Adds supports_dynamic_linker feature][0] from [~jvolkman][1]

[0]: https://lists.sr.ht/~motiejus/bazel-zig-cc/patches/37589
[1]: mailto:[email-masked]

✓ #906609 SUCCESS bazel-zig-cc/patches/.build.yml https://builds.sr.ht/~motiejus/job/906609