[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libraries compiled with clang



On 18 June 2013 11:05, Richi Lists <ricul77@gmail.com> wrote:
> Hi everybody,
>
> gcc is the default compiler for debian, and all the libraries in the
> repository are compiled with gcc.
> clang is also in the repository. But if I want to compile anything other
> than the simplest toy program, I also need libraries. Maintaining them
> by hand is a nightmare if you're used to just apt-get them.
>
> So, is there any official guideline for inclusion of libraries compiled
> with alternative compilers into the repository.
> I read recently that one of the BSD distros switched to using clang as
> the default compiler. I'm not suggesting that debian should do that.
> I 'm just trying to find out what would be a good solution to have the
> same ease of use in debian for compiling with clang as we have for gcc.
>
> I thought about the following alternatives:
> 1) have them in the same repository
>   + easy to compile your app for gcc and clang at the same time
>   - adds a lot of duplication
>   - users might not know which versions of a lib they need
> 2) handle it like a separate architecture
>   + good separation
>   + maybe possible to compile without modification of the packaging
>   - would result in n*m architecture/repositories
>   - separate installation required (unless multiarch could suffice here)
>
> Some time ago, I started by building some packages for the boost libs
> compiled with clang. (http://blog.ulrichard.ch/?p=324) It's in no shape
> to be included anywhere.
> I'm just curious if its worth continuing in that direction, or if there
> is already a consent for another solution.

I'm not sure what it gains you..... you can use gcc compiled shared
libraries with clang and vice versa, there is no need to recompile the
lib$world.
That said, there have been multiple benchmarks done for various
parameters and at the moment gcc still produces faster code / smaller
binaries in debian and supports far more targets than clang.

Look at clang availability:
https://buildd.debian.org/status/package.php?p=llvm-toolchain-3.2
http://buildd.debian-ports.org/status/package.php?p=llvm-toolchain-3.2

At the moment, I only choose to use clang during development when I do
something stupid and I am confused about template errors. But do note
that gcc-4.8 got so much better with template errors, it now also
shows where/what/why came from.

Regards,

Dmitrijs.


Reply to: