Compile elfutils with Clang

Mark Wielaard mark@klomp.org
Tue Sep 19 14:27:00 GMT 2017


Hi Dmitry,

On Sat, 2017-09-09 at 13:52 +0300, Dmitry Golovin wrote:
> I've been trying to compile elfutils with clang for a while now and
> I'm wondering maybe someone else is also working on it?
> I found some useful patches written by Chih-Hung Hsieh, but they seem
> to be written over 2 years ago and not maintained.
> Is there a fork or a branch of elfutils that can be compiled with
> clang?

The problem with clang is that it claims to implement -std=gnu99 but
doesn't really. We now have a configure check to make sure the features
used in the code base are actually supported by the compiler. So as
soon as clang gets the needed features it should just work.

Various people have worked on supporting clang as compiler, but it is a
lot of work and nobody succeeded doing it without making the code much 
harder to maintain. But in general elfutils patches to clean up the
code and support alternative compilers (or linkers, libc, kernels,
etc.) are accepted and integrated as long as they improve the code base
and don't make it hard to maintain. But the first target of elfutils is
a normal GNU/Linux system.

You might want to look at the mailinglist archives to find various
attempts. Including a discussion of replacing nested functions with
blocks. Which wasn't accepted because nobody seemed to believe it
actually improved the code.

Cheers,

Mark



More information about the Elfutils-devel mailing list