authorgravatar for sentrycraft123@gmail.comJan200101 <sentrycraft123@gmail.com> 2023-06-07 12:44:27+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-13 11:11:10-07:00
logd7b73af8f65bb891c8700ed47777144bb6f35fe1
treeef656afc1e0813cc0dedb29d6390f3b3d6a8f03a
parentc76ce25a6165e96015b11d506e3c968c6c8dca2c

Never implicitly add rpaths for each lib dir, add NixOS libdir to rpath


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

lib/std/zig/system/NativePaths.zig+1
...@@ -74,6 +74,7 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths...@@ -74,6 +74,7 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths
74 } else if (word.len > 2 and word[0] == '-' and word[1] == 'L') {74 } else if (word.len > 2 and word[0] == '-' and word[1] == 'L') {
75 const lib_path = word[2..];75 const lib_path = word[2..];
76 try self.addLibDir(lib_path);76 try self.addLibDir(lib_path);
77 try self.addRPath(lib_path);
77 } else {78 } else {
78 try self.addWarningFmt("Unrecognized C flag from NIX_LDFLAGS: {s}", .{word});79 try self.addWarningFmt("Unrecognized C flag from NIX_LDFLAGS: {s}", .{word});
79 break;80 break;
src/Compilation.zig+1-1
...@@ -1521,7 +1521,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {...@@ -1521,7 +1521,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
1521 .llvm_cpu_features = llvm_cpu_features,1521 .llvm_cpu_features = llvm_cpu_features,
1522 .skip_linker_dependencies = options.skip_linker_dependencies,1522 .skip_linker_dependencies = options.skip_linker_dependencies,
1523 .parent_compilation_link_libc = options.parent_compilation_link_libc,1523 .parent_compilation_link_libc = options.parent_compilation_link_libc,
1524 .each_lib_rpath = options.each_lib_rpath orelse options.is_native_os,1524 .each_lib_rpath = options.each_lib_rpath orelse false,
1525 .build_id = build_id,1525 .build_id = build_id,
1526 .cache_mode = cache_mode,1526 .cache_mode = cache_mode,
1527 .disable_lld_caching = options.disable_lld_caching or cache_mode == .whole,1527 .disable_lld_caching = options.disable_lld_caching or cache_mode == .whole,