zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit d7b73af8f65bb891c8700ed47777144bb6f35fe1 (tree)
parent c76ce25a6165e96015b11d506e3c968c6c8dca2c
Author: Jan200101 <sentrycraft123@gmail.com>
Date:   Wed,  7 Jun 2023 12:44:27 +0200

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

Diffstat:
Mlib/std/zig/system/NativePaths.zig | 1+
Msrc/Compilation.zig | 2+-
2 files changed, 2 insertions(+), 1 deletion(-)

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