authorgravatar for piotr@aviatrix.comPiotr Sikora <piotr@aviatrix.com> 2022-12-21 17:56:07+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-04-10 20:04:29-04:00
logcb54e9a3c20783863cf346dc935e2940d26d26d0
tree70abe546abab01c885bf3a40a464b0583236c8a1
parent311d50f9dc96c3d397081a1afcc3b519ae1e973f

glibc: allow linking against external libcrypt.

Support for the built-in libcrypt was removed in commit 6b7ddfba, but the -lcrypt flag remained ignored, preventing linking against external libcrypt. Fixes #5990. Signed-off-by: Piotr Sikora <piotr@aviatrix.com>

1 files changed, 5 insertions(+), 2 deletions(-)

src/target.zig+5-2
......@@ -375,8 +375,6 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
375375 return true;
376376 if (eqlIgnoreCase(ignore_case, name, "pthread"))
377377 return true;
378 if (eqlIgnoreCase(ignore_case, name, "crypt"))
379 return true;
380378 if (eqlIgnoreCase(ignore_case, name, "util"))
381379 return true;
382380 if (eqlIgnoreCase(ignore_case, name, "xnet"))
......@@ -387,6 +385,11 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool {
387385 return true;
388386 }
389387
388 if (target.abi.isMusl() or target.os.tag.isDarwin()) {
389 if (eqlIgnoreCase(ignore_case, name, "crypt"))
390 return true;
391 }
392
390393 if (target.os.tag.isDarwin() and eqlIgnoreCase(ignore_case, name, "System"))
391394 return true;
392395