Skip to content

Commit 1079974

Browse files
committed
glibc: Don't link libpthread stub if all modules are single-threaded
Part of #24347.
1 parent b461d07 commit 1079974

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/link/Lld.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,7 @@ fn elfLink(lld: *Lld, arena: Allocator) !void {
12171217
if (lib.removed_in) |rem_in| {
12181218
if (target.os.versionRange().gnuLibCVersion().?.order(rem_in) != .lt) continue;
12191219
}
1220+
if (std.mem.eql(u8, lib.name, "pthread") and !comp.config.any_non_single_threaded) continue;
12201221

12211222
const lib_path = try std.fmt.allocPrint(arena, "{}{c}lib{s}.so.{d}", .{
12221223
comp.glibc_so_files.?.dir_path, fs.path.sep, lib.name, lib.sover,

0 commit comments

Comments
 (0)