Merge branch 'alexnask-fix_6868' into master

Closes #7139
Closes #6868
master
Andrew Kelley 2020-11-30 18:12:07 -07:00
commit c55984b58f
3 changed files with 7 additions and 6 deletions

View File

@ -1980,13 +1980,10 @@ pub const LibExeObjStep = struct {
try zig_args.append(other.getOutputPath());
},
.Lib => {
if (!other.is_dynamic or self.target.isWindows()) {
try zig_args.append(other.getOutputLibPath());
} else {
const full_path_lib = other.getOutputPath();
try zig_args.append("--library");
try zig_args.append(full_path_lib);
const full_path_lib = other.getOutputPath();
try zig_args.append(full_path_lib);
if (other.is_dynamic and !self.target.isWindows()) {
if (fs.path.dirname(full_path_lib)) |dirname| {
try zig_args.append("-rpath");
try zig_args.append(dirname);

View File

@ -3809,6 +3809,7 @@ pub fn faccessatW(dirfd: fd_t, sub_path_w: [*:0]const u16, mode: u32, flags: u32
.SUCCESS => return,
.OBJECT_NAME_NOT_FOUND => return error.FileNotFound,
.OBJECT_PATH_NOT_FOUND => return error.FileNotFound,
.OBJECT_NAME_INVALID => unreachable,
.INVALID_PARAMETER => unreachable,
.ACCESS_DENIED => return error.PermissionDenied,
.OBJECT_PATH_SYNTAX_BAD => unreachable,

View File

@ -1401,6 +1401,9 @@ fn buildOutputType(
_ = system_libs.orderedRemove(i);
continue;
}
if (std.fs.path.isAbsolute(lib_name)) {
fatal("cannot use absolute path as a system library: {s}", .{lib_name});
}
i += 1;
}
}