[cfe-dev] Odd piece of Clang 2.1 behaviour

Dallman, John john.dallman at siemens.com
Wed Oct 12 03:04:56 PDT 2011


Eli Friedman wrote:
> > It's a bug; IIRC, it's already fixed in clang trunk.

Chris Lattner wrote:

> For what it's worth, Xcode 4.2 includes a vastly updated version
> of Clang (branded "Apple LLVM Compiler 3.0" instead of "2.1" by
> the apple marketing people).  It recently came out of Beta.  I
> recommend upgrading to it if you can.

That's a bit interesting. The libraries I produce are a product in their own
right, used in many different applications. It is going to be important that
the Clang-built versions be usable for development on Mac OS X 10.6 as well
as 10.7, and with GCC as well as Clang on 10.7.

If you trust Clang, this is no problem for the libraries I build from C,
and for the ones built from C++, it only requires using -stdlib=libstdc++.

But I have customers who aren't switching to Clang immediately, because
their code (which requires "permissive" with GCC) won't compile with Clang,
until they do some extra work, and they are nervous about Clang. So staying
on a Clang that definitely has a corresponding conventional GCC is going
to be good for their peace of mind.

And as best I know, Xcode 4.2 removes the conventional GCC, and only provides
an LLVM-based GCC. Is that correct?

--
John Dallman

-----Original Message-----
From: Chris Lattner [mailto:clattner at apple.com]
Sent: 07 October 2011 19:10
To: Dallman, John
Cc: clang-dev Developers
Subject: Re: [cfe-dev] Odd piece of Clang 2.1 behaviour


On Oct 7, 2011, at 9:40 AM, Eli Friedman wrote:

> On Fri, Oct 7, 2011 at 9:26 AM, Dallman, John <john.dallman at siemens.com> wrote:
>> I'm experimenting with Clang as a replacement for GCC in building my employers'
>> products, and liking it a great deal. It's the easiest new compiler I've dealt
>> with in 15 years of porting this code to a wide variety of platforms.
>>
>> I'm working on Mac OS X 10.7 with the Clang 2.1 from Xcode 4.1, and it's doing
>> something that I could believe was deliberate, but isn't helpful to me.
>>
>> Object files are created with permissions of "-rw-------". llvm-gcc-4.2 creates
>> them in the same setup with permissions of "-rw-rw-r--".
>>
>> This creates a problem for me, because we have a centralised build system,
>> running under a special account, and developers working against it need to
>> link against object files produced by the special account. They are members
>> of the same group, so permissions of "-rw-r-----" would work fine.
>>
>> This doesn't seem to be being caused by my umask. Obviously, I can change the
>> permissions on the .o files once they exist, so it isn't a big problem, but
>> I was curious if this was deliberate, and if so, why?
>
> It's a bug; IIRC, it's already fixed in clang trunk.

For what it's worth, Xcode 4.2 includes a vastly updated version of Clang (branded "Apple LLVM Compiler 3.0" instead of "2.1" by the apple marketing people).  It recently came out of Beta.  I recommend upgrading to it if you can.

-Chris




More information about the cfe-dev mailing list