| ... | @@ -227,20 +227,15 @@ fn findLLVM(b: *Builder, llvm_config_exe: []const u8) !LibraryDep { | ... | @@ -227,20 +227,15 @@ fn findLLVM(b: *Builder, llvm_config_exe: []const u8) !LibraryDep { |
| 227 | while (it.next()) |lib_arg| { | 227 | while (it.next()) |lib_arg| { |
| 228 | if (mem.startsWith(u8, lib_arg, "-l")) { | 228 | if (mem.startsWith(u8, lib_arg, "-l")) { |
| 229 | try result.system_libs.append(lib_arg[2..]); | 229 | try result.system_libs.append(lib_arg[2..]); |
| 230 | } else if (fs.path.isAbsolute(lib_arg)) { | | |
| 231 | if (mem.endsWith(u8, lib_arg, "libz.so")) { | | |
| 232 | // llvm-config version 10 started giving an absolute path to zlib as | | |
| 233 | // a shared object, which fails to deal with rpaths correctly. Here | | |
| 234 | // we change it to a normal -lz | | |
| 235 | try result.system_libs.append("z"); | | |
| 236 | } else { | | |
| 237 | try result.libs.append(lib_arg); | | |
| 238 | } | | |
| 239 | } else { | 230 | } else { |
| 240 | if (mem.endsWith(u8, lib_arg, ".lib")) { | 231 | if (fs.path.isAbsolute(lib_arg)) { |
| 241 | lib_arg = lib_arg[0 .. lib_arg.len - 4]; | 232 | try result.libs.append(lib_arg); |
| | 233 | } else { |
| | 234 | if (mem.endsWith(u8, lib_arg, ".lib")) { |
| | 235 | lib_arg = lib_arg[0 .. lib_arg.len - 4]; |
| | 236 | } |
| | 237 | try result.system_libs.append(lib_arg); |
| 242 | } | 238 | } |
| 243 | try result.system_libs.append(lib_arg); | | |
| 244 | } | 239 | } |
| 245 | } | 240 | } |
| 246 | } | 241 | } |