[cfe-dev] Clang support for Arch Linux

Mulder, Jonathan mulderje at muohio.edu
Thu Feb 24 23:57:46 PST 2011


Hi Chandler,

I had submitted a patch a while back for this that didn't get picked up, in
order to compile anything c++ related I also needed to include the attached
portion.

Note: I've only actually tried this on a 32-bit machine, but the 64bit path
was what I saw in the arch package when I checked online.

Also, I didn't need the Lib = "lib" chunk; although it doesn't seem to break
anything for me. Maybe that's needed for the 64bit?

Thanks,
Jon

On Fri, Feb 25, 2011 at 12:44 AM, Chandler Carruth <chandlerc at google.com>wrote:

> 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
>>
>>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>


-- 
Jon Mulder
C 847.899.3664
E mulderje at muohio.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110225/b0f5d3b9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ArchInitHeaderSearch.patch
Type: application/octet-stream
Size: 854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110225/b0f5d3b9/attachment.obj>


More information about the cfe-dev mailing list