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