aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-09-28 15:42:09 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-09-28 15:42:09 -0700
commit412a2f966e18aa792089ac1f41482222d7f2434f (patch)
tree36f4d7f00ce93bc3f10844e3bbf56f75c8ddba8d /src/Module.zig
parent91a73a177bc20fa0219dbb6c3cf3dda1c2a465db (diff)
downloadzig-412a2f966e18aa792089ac1f41482222d7f2434f.tar.gz
zig-412a2f966e18aa792089ac1f41482222d7f2434f.zip
store stage1 flags in a trailing byte in the hash id symlink
When we get a cache hit for a stage1 compilation, we need to know about some of the flags such as have_winmain or have_dllmain to know which subsystem to infer during linking. To do this, we append a hex-encoded byte into the intentionally-dangling symlink which contains the cache hash digest rather than a filename. The hex-encoded byte contains the flags we need to infer the subsystem during linking.
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 8f87b7a521..4fcf72f4ff 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -75,12 +75,15 @@ global_error_set: std.StringHashMapUnmanaged(u16) = .{},
/// previous analysis.
generation: u32 = 0,
-have_winmain: bool = false,
-have_wwinmain: bool = false,
-have_winmain_crt_startup: bool = false,
-have_wwinmain_crt_startup: bool = false,
-have_dllmain_crt_startup: bool = false,
-have_c_main: bool = false,
+stage1_flags: packed struct {
+ have_winmain: bool = false,
+ have_wwinmain: bool = false,
+ have_winmain_crt_startup: bool = false,
+ have_wwinmain_crt_startup: bool = false,
+ have_dllmain_crt_startup: bool = false,
+ have_c_main: bool = false,
+ reserved: u2 = 0,
+} = .{},
pub const Export = struct {
options: std.builtin.ExportOptions,