Skip to content

Commit ae2cd5f

Browse files
committed
Revert "Never implicitly add rpaths for each lib dir, add NixOS libdir to rpath"
This reverts commit d7b73af. I did not look at this closely enough. This is incorrect; it should not implicitly add rpaths for every library, and it should not disable the nice default of each_lib_path when compiling for the native OS. See #16062 where we are working on a follow-up improvement to this.
1 parent 470d887 commit ae2cd5f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

lib/std/zig/system/NativePaths.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ pub fn detect(arena: Allocator, native_info: NativeTargetInfo) !NativePaths {
6161
} else if (word.len > 2 and word[0] == '-' and word[1] == 'L') {
6262
const lib_path = word[2..];
6363
try self.addLibDir(lib_path);
64-
try self.addRPath(lib_path);
6564
} else {
6665
try self.addWarningFmt("Unrecognized C flag from NIX_LDFLAGS: {s}", .{word});
6766
break;

src/Compilation.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
16621662
.llvm_cpu_features = llvm_cpu_features,
16631663
.skip_linker_dependencies = options.skip_linker_dependencies,
16641664
.parent_compilation_link_libc = options.parent_compilation_link_libc,
1665-
.each_lib_rpath = options.each_lib_rpath orelse false,
1665+
.each_lib_rpath = options.each_lib_rpath orelse options.is_native_os,
16661666
.build_id = build_id,
16671667
.cache_mode = cache_mode,
16681668
.disable_lld_caching = options.disable_lld_caching or cache_mode == .whole,

0 commit comments

Comments
 (0)