[PATCH] Don't set $LIB if we're not targetting windows.

Reid Kleckner rnk at google.com
Thu Feb 19 12:58:27 PST 2015

I think this is probably a good change. I believe the compiler-rt test suite supports running the tests one some OS other than the host, and this supports that on Windows.

Comment at: test/lit.common.cfg:64
@@ -63,2 +63,3 @@
 # Help MSVS link.exe find the standard libraries.
-if platform.system() == 'Windows':
+# Make sure we only try to use it when targetting Windows
+if platform.system() == 'Windows' and config.target_triple.endswith('win32'):
timurrrr wrote:
> I don't understand the comment and how it is related to the change in the code.
> You've probably meant to write the condition meaning `"if MSVC:"` ?
> If so, I don't think you need an extra comment:
> ```
>   # On Windows, help MSVS link.exe find the standard libraries.
>   if platform.system() == 'Windows' and ...:
> ```
> Deferring the condition to Reid and Hans who know the triples better.
For the triple check, how about:
  "-win" not in config.target_triple

This will cover *-windows-msvc, *-windows, and *-win32. It will also cover *-windows-gnu, but that matches current behavior and it shouldn't matter because GNU ld doesn't respect LIB so far as I know.



More information about the llvm-commits mailing list