From d979df585d05de8d7385495fe6aee2b1d4e1380f Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Mon, 8 Apr 2024 00:23:37 -0400 Subject: cbe: remove threadlocal variables in single threaded mode --- src/codegen/c.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/codegen/c.zig') diff --git a/src/codegen/c.zig b/src/codegen/c.zig index ed5ab74405..95f4ecc4ac 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -2078,7 +2078,7 @@ pub const DeclGen = struct { else false; if (variable.is_weak_linkage or export_weak_linkage) try fwd.writeAll("zig_weak_linkage "); - if (variable.is_threadlocal) try fwd.writeAll("zig_threadlocal "); + if (variable.is_threadlocal and !dg.mod.single_threaded) try fwd.writeAll("zig_threadlocal "); try dg.renderTypeAndName( fwd, decl.typeOf(zcu), @@ -2899,7 +2899,7 @@ pub fn genDecl(o: *Object) !void { const w = o.writer(); if (!is_global) try w.writeAll("static "); if (variable.is_weak_linkage) try w.writeAll("zig_weak_linkage "); - if (variable.is_threadlocal) try w.writeAll("zig_threadlocal "); + if (variable.is_threadlocal and !o.dg.mod.single_threaded) try w.writeAll("zig_threadlocal "); if (zcu.intern_pool.stringToSliceUnwrap(decl.@"linksection")) |s| try w.print("zig_linksection({s}) ", .{fmtStringLiteral(s, null)}); const decl_c_value = .{ .decl = decl_index }; -- cgit v1.2.3