You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by aniket ray <an...@gmail.com> on 2011/12/07 12:43:41 UTC

Building trafficserver 3.0.0 with clang

Has anybody had any success with building TS3.0 with clang (from latest trunk)?
I've tried doing it with a view to try out the address sanitizer
library (http://code.google.com/p/address-sanitizer/) but I was
hitting many errors (after turning off -Werror) in the template code.

I see that there was an effort in the 2.1.4 timeframe
(https://issues.apache.org/jira/browse/TS-427)

Is clang still a supported compiler?

Thanks,
-aniket

Re: Building trafficserver 3.0.0 with clang

Posted by Igor Galić <i....@brainsware.org>.
Unrelated, 

> > Igor Galić wrote:

I � Unicode

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE

Re: Building trafficserver 3.0.0 with clang

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> Igor Galić wrote:
> 
> >   n.b.: Right now, this does not work, because our code has long
> >   since
> >   (v2.1.4/TS-427) parted with clang compatibility.
> >   XXX: Why are we not checking for clang on darwin? Isn't XCode the
> >   default.. thing? Doesn't it come with clang? How often more will
> >   I
> >   write clang in this commit message? Questions...
> 
> Trunk compiles on my Mac using XCode without problem... Maybe Apple
> made
> changes to make it "compatible" with gcc? I use
> 
> Using built-in specs.
> Target: i686-apple-darwin11
> Configured with:
> /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure
> --disable-checking --enable-werror
> --prefix=/Developer/usr/llvm-gcc-4.2
> --mandir=/share/man --enable-languages=c,objc,c++,obj-c++
> --program-prefix=llvm-
> --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
> --with-slibdir=/usr/lib --build=i686-apple-darwin11
> --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local
> --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11
> --target=i686-apple-darwin11
> --with-gxx-include-dir=/usr/include/c++/4.2.1
> Thread model: posix
> gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build
> 2336.1.00)
> 
> 
> I guess I'm to blame for breaking clang building ... I'm curious
> though,
> what is it that we're "missing" from not supporting clang? I mean,
> yes, we
> should support it, but is there really something we'd change in our
> code
> to take advantage of something clang specific?

Well, for one, as aniket points out:

  I've tried doing it with a view to try out the address sanitizer
  library (http://code.google.com/p/address-sanitizer/) but I was

I only mentioned this briefly on IRC when I saw the 3.0 release
but there's a quite a bit from clang land that can benefit us:

  http://llvm.org/releases/3.0/docs/ReleaseNotes.html#externalproj

AddressSanitizer and ThreadSanitizer for one, and SAFECode.
Polly might also be interesting. And, of course, like always
--analyze -- the static analyzer.


> -- Leif

So long,
i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE

Re: Building trafficserver 3.0.0 with clang

Posted by Leif Hedstrom <zw...@apache.org>.
Igor Galić wrote:

>   n.b.: Right now, this does not work, because our code has long since
>   (v2.1.4/TS-427) parted with clang compatibility.
>   XXX: Why are we not checking for clang on darwin? Isn't XCode the
>   default.. thing? Doesn't it come with clang? How often more will I
>   write clang in this commit message? Questions...

Trunk compiles on my Mac using XCode without problem... Maybe Apple made
changes to make it "compatible" with gcc? I use

Using built-in specs.
Target: i686-apple-darwin11
Configured with:
/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure
--disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2
--mandir=/share/man --enable-languages=c,objc,c++,obj-c++
--program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-slibdir=/usr/lib --build=i686-apple-darwin11
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local
--program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11
--target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)


I guess I'm to blame for breaking clang building ... I'm curious though,
what is it that we're "missing" from not supporting clang? I mean, yes, we
should support it, but is there really something we'd change in our code
to take advantage of something clang specific?

-- Leif



Re: Building trafficserver 3.0.0 with clang

Posted by Igor Galić <i....@brainsware.org>.

----- Original Message -----
> Has anybody had any success with building TS3.0 with clang (from
> latest trunk)?
> I've tried doing it with a view to try out the address sanitizer
> library (http://code.google.com/p/address-sanitizer/) but I was
> hitting many errors (after turning off -Werror) in the template code.
> 
> I see that there was an effort in the 2.1.4 timeframe
> (https://issues.apache.org/jira/browse/TS-427)
> 
> Is clang still a supported compiler?

Unfortunately, it is no more - and that's a pity.
There's lots of things clang would offer us, if we maintained
compatibility with it.

In r1211432 that I just committed I added the possibility to option to
compile with clang as compiler (on Linux)

  http://svn.apache.org/viewvc?view=revision&revision=1211432

Let me restate the questions pointed out in my silly commit message:

  n.b.: Right now, this does not work, because our code has long since
  (v2.1.4/TS-427) parted with clang compatibility.
  XXX: Why are we not checking for clang on darwin? Isn't XCode the
  default.. thing? Doesn't it come with clang? How often more will I
  write clang in this commit message? Questions...

But more importantly: Should I persuade our Infra folks to provide
a clang 3.0 install (Preferably, of course, on all build machines)?
This could be valuable for other projects, too: apr, httpd, subversion..
...and I think that's it - we don't have much more C or C++ based
projects at Apache (well, there's libcxx, but that's.. quite silent)


> Thanks,
> -aniket

Thank you for pointing this out and raising the issue, I would've
forgotten about it :)

So long,
i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE