I don't use ArchLinux, but this seems fairly reasonable to me. If any ArchLinux users pipe up to request a different approach I'm all ears, but for now I've committed your patch in r126476 (modulo sorting the enum). Please let me know if that works? I'd be interested to know that Clang is working mostly out-of-the-box on ArchLinux.<div>
<br></div><div>Thanks,</div><div>-Chandler<br><br><div class="gmail_quote">On Thu, Feb 24, 2011 at 4:39 PM, Kevin Winchester <span dir="ltr"><<a href="mailto:kjwinchester@gmail.com">kjwinchester@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I need to apply the patch below in order for clang to work properly on<br>
Arch Linux, due to errors finding crt*.o.  I am not sure if this is<br>
the best way to fix the issue, but it seems to work for me.  I've<br>
attached the patch as a file as well, since I know that GMail tends to<br>
mangle them.<br>
<br>
--<br>
Kevin Winchester<br>
<br>
---<br>
<br>
Index: lib/Driver/ToolChains.cpp<br>
===================================================================<br>
--- lib/Driver/ToolChains.cpp   (revision 126451)<br>
+++ lib/Driver/ToolChains.cpp   (working copy)<br>
@@ -1281,6 +1281,7 @@<br>
   UbuntuKarmic,<br>
   UbuntuLucid,<br>
   UbuntuMaverick,<br>
+  ArchLinux,<br>
   UnknownDistro<br>
 };<br>
<br>
@@ -1367,6 +1368,9 @@<br>
   if (!llvm::sys::fs::exists("/etc/exherbo-release", Exists) && Exists)<br>
     return Exherbo;<br>
<br>
+  if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)<br>
+    return ArchLinux;<br>
+<br>
   return UnknownDistro;<br>
 }<br>
<br>
@@ -1436,7 +1440,7 @@<br>
       GccTriple = "i586-suse-linux";<br>
   }<br>
<br>
-  const char* GccVersions[] = {"4.5.1", "4.5", "4.4.5", "4.4.4",<br>
"4.4.3", "4.4",<br>
+  const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5",<br>
"4.4.4", "4.4.3", "4.4",<br>
                                "4.3.4", "4.3.3", "4.3.2", "4.3"};<br>
   std::string Base = "";<br>
   for (unsigned i = 0; i < sizeof(GccVersions)/sizeof(char*); ++i) {<br>
@@ -1498,6 +1502,9 @@<br>
       Distro == UbuntuKarmic)<br>
     ExtraOpts.push_back("--build-id");<br>
<br>
+  if (Distro == ArchLinux)<br>
+    Lib = "lib";<br>
+<br>
   Paths.push_back(Base + Suffix);<br>
   if (HasMultilib(Arch, Distro)) {<br>
     if (IsOpenSuse(Distro) && Is32Bits)<br>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>