1
Fork 0
Commit Graph

17 Commits (main)

Author SHA1 Message Date
Jeremy Volkman f35f5d3eeb buildifier 2023-04-26 07:32:43 +03:00
Jeremy Volkman 5a7e58af4e Move -Wl,-S to a separate strip_debug_symbols feature 2023-04-26 07:32:43 +03:00
Jeremy Volkman cff2b2660b Re-add linkopts and set -Wl,-headerpad_max_install_names on macos 2023-04-24 09:48:27 -07:00
Jeremy Volkman cc8f113489 Use artifact_name_pattern to specify proper macos and windows artifact names.
On macos, dynamic libraries are generated as "libfoo.dylib".

On windows, executables end with ".exe", static libraries end with ".lib",
and dynamic libraries end with ".dll".
2022-12-18 05:29:04 +02:00
Jeremy Volkman 0db5d2d9e6 Adds supports_dynamic_linker feature
With this feature, cc_library generates a .so as well as a .a and the
"dynamic_library" output group is enabled.
2022-12-18 05:07:59 +02:00
Motiejus Jakštys f30a3afdde remove redundant flags
- -target
- linkopts
2022-10-01 23:27:58 +03:00
Motiejus Jakštys 771fcc5bc6 bump to go 1.19
Removing --no-gc-sections, because that's now in Go. Whoo!
2022-08-12 05:21:24 +03:00
Motiejus Jakštys 64a7007a23 fastbuild: remove -O0
this is the default in zig cc now
2022-07-12 14:53:02 +03:00
Motiejus Jakštys de0350405d lint 2022-07-04 15:32:36 +03:00
Motiejus Jakštys 527ebbc863 fastbuild: replace -gmlt with -O0
- -gmlt is a noop in zig, because -g is a default anyway.
- -O0 was fixed in ziglang/zig 02ba3cb25cc8ee2637c6fb7bcb935722490ba05c
2022-07-01 13:54:03 +03:00
Motiejus Jakštys 4cfc30dd1c [fastbuild] use -fno-lto
This is very cache-unfriendly, because quite a lot of work is done
during the final linking stage. Let's see how this improves performance
of fastbuild.
2022-06-21 08:45:03 +03:00
laurynasl b73d167c6c Support bazel compilation_mode
Bazel has a special command line option (--compilation_mode) for specifying how
c artifacts should be compiled. Copy over the implementation without too much
thought on whether they make sense.

See https://docs.bazel.build/versions/main/user-manual.html#flag--compilation_mode.

!!! Due to a regression in zig-cc, debug symbols are available under --compilation_mode opt

```
laurynasl@laurynasl ~/bazel-zig-cc
 % bazel build -c opt //test/c:which_libc 2>/dev/null && bazel-bin/test/c/which_libc && gdb -batch --ex 'info line main' bazel-bin/test/c/which_libc
glibc_2.19
Line 4 of "test/c/main.c" starts at address 0x2014f0 <main> and ends at 0x2014f1 <main+1>.
laurynasl@laurynasl ~/bazel-zig-cc
 % bazel build -c dbg //test/c:which_libc 2>/dev/null && bazel-bin/test/c/which_libc && gdb -batch --ex 'info line main' bazel-bin/test/c/which_libc
glibc_2.19
Line 4 of "test/c/main.c" starts at address 0x201500 <main> and ends at 0x201504 <main+4>.
laurynasl@laurynasl ~/bazel-zig-cc
 % bazel build -c fastbuild //test/c:which_libc 2>/dev/null && bazel-bin/test/c/which_libc && gdb -batch --ex 'info line main' bazel-bin/test/c/which_libc
glibc_2.19
Function "main" not defined.
```
2022-06-17 14:46:13 +00:00
Jeremy Volkman 921fda9260 Adds dynamic_library_linkopts to zig_cc_toolchain_config
If specified, the flags in dynamic_library_linkopts are included in
cpp_link_dynamic_library and cpp_link_nodeps_dynamic_library actions.
2022-06-01 11:49:13 +03:00
Motiejus Jakštys 94d5864cb7 move `--no-gc-sections` hack to the toolchain definition
Thanks laurynasl for the tip.
2022-05-05 14:36:36 +03:00
Motiejus Jakštys dbff5afa75 buildifier 2021-06-10 13:12:54 +03:00
Motiejus Jakštys 100c1e3727 remove `.2.19` from toolchain params
Only the default toolchain can be exposed.
2021-06-10 13:02:35 +03:00
Motiejus Jakštys 670276e5be rename directory 2021-06-08 05:06:58 +03:00