diff --git a/src/glibc.zig b/src/glibc.zig index c9d43f0199c1..f0896e406094 100644 --- a/src/glibc.zig +++ b/src/glibc.zig @@ -652,8 +652,13 @@ fn add_include_dirs_arch( try args.append(try path.join(arena, &[_][]const u8{ dir, "riscv" })); } } else if (arch.isLoongArch()) { - try args.append("-I"); - try args.append(try path.join(arena, &[_][]const u8{ dir, "loongarch" })); + if (opt_nptl) |nptl| { + try args.append("-I"); + try args.append(try path.join(arena, &[_][]const u8{ dir, "loongarch", nptl })); + } else { + try args.append("-I"); + try args.append(try path.join(arena, &[_][]const u8{ dir, "loongarch" })); + } } }