1

split all tools to per-codename subdirectories

Go ignores CFLAGS for some commands. That causes unnecessary build of
glibc shims (and libc++.a).

In the GCC days cross-compiler toolchains used to expose a "tool" per
architecture. Let's do the same here. Then Go cannot cheat with skipping
CFLAGS which we normally *always* expect.

The wrapper code is getting gnarly, I know. But it still fits in my head
somehow, so we can still keep adding to it.
This commit is contained in:
Motiejus Jakštys
2022-10-01 14:26:45 +03:00
parent e96f5bb59c
commit 9b510810cc
3 changed files with 33 additions and 22 deletions

View File

@@ -25,7 +25,10 @@ def declare_cc_toolchains(os, zig_sdk_path, zig_include_root):
if path[0] == "/":
absolute_tool_paths[name] = path
continue
tool_path = zig_tool_path(os).format(zig_tool = path)
tool_path = zig_tool_path(os).format(
zig_tool = path,
zigtarget = zigtarget,
)
absolute_tool_paths[name] = tool_path
linkopts = target_config.linkopts

View File

@@ -1,4 +1,4 @@
_ZIG_TOOL_PATH = "tools/{zig_tool}"
_ZIG_TOOL_PATH = "tools/{zigtarget}/{zig_tool}"
# Zig supports even older glibcs than defined below, but we have tested only
# down to 2.17.