[cfe-dev] Clang support for Arch Linux

Chandler Carruth chandlerc at google.com
Thu Feb 24 22:44:36 PST 2011


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.

Thanks,
-Chandler

On Thu, Feb 24, 2011 at 4:39 PM, Kevin Winchester <kjwinchester at gmail.com>wrote:

> Hi,
>
> I need to apply the patch below in order for clang to work properly on
> Arch Linux, due to errors finding crt*.o.  I am not sure if this is
> the best way to fix the issue, but it seems to work for me.  I've
> attached the patch as a file as well, since I know that GMail tends to
> mangle them.
>
> --
> Kevin Winchester
>
> ---
>
> Index: lib/Driver/ToolChains.cpp
> ===================================================================
> --- lib/Driver/ToolChains.cpp   (revision 126451)
> +++ lib/Driver/ToolChains.cpp   (working copy)
> @@ -1281,6 +1281,7 @@
>   UbuntuKarmic,
>   UbuntuLucid,
>   UbuntuMaverick,
> +  ArchLinux,
>   UnknownDistro
>  };
>
> @@ -1367,6 +1368,9 @@
>   if (!llvm::sys::fs::exists("/etc/exherbo-release", Exists) && Exists)
>     return Exherbo;
>
> +  if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
> +    return ArchLinux;
> +
>   return UnknownDistro;
>  }
>
> @@ -1436,7 +1440,7 @@
>       GccTriple = "i586-suse-linux";
>   }
>
> -  const char* GccVersions[] = {"4.5.1", "4.5", "4.4.5", "4.4.4",
> "4.4.3", "4.4",
> +  const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5",
> "4.4.4", "4.4.3", "4.4",
>                                "4.3.4", "4.3.3", "4.3.2", "4.3"};
>   std::string Base = "";
>   for (unsigned i = 0; i < sizeof(GccVersions)/sizeof(char*); ++i) {
> @@ -1498,6 +1502,9 @@
>       Distro == UbuntuKarmic)
>     ExtraOpts.push_back("--build-id");
>
> +  if (Distro == ArchLinux)
> +    Lib = "lib";
> +
>   Paths.push_back(Base + Suffix);
>   if (HasMultilib(Arch, Distro)) {
>     if (IsOpenSuse(Distro) && Is32Bits)
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110224/2b1e106b/attachment.html>


More information about the cfe-dev mailing list