[Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required

mark at klomp dot org sourceware-bugzilla@sourceware.org
Wed Sep 4 15:49:00 GMT 2019


Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
                 CC|                            |mark at klomp dot org

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
(In reply to Sergei Trofimovich from comment #0)
> People use clang more and more as their default C compiler and rediscover
> that elfutils does not build against clang. Downstream bug reports:
>     https://bugzilla.redhat.com/show_bug.cgi?id=1211357
>     https://bugs.gentoo.org/685688
> elfutils fails on latest git tree and recent releases:
>   $ ./configure CC=clang CXX=clang++
>   ...
>   checking for gcc with GNU99 support... no
>   configure: error: gcc with GNU99 support required

The configure check is correct. It was added because clang claims to support
-std=gnu99 but doesn't really do that. So otherwise you would get (obscure)
compile failures.

Really this is a clang bug, it simply has to implement the various GNU
extensions it claims to support.

See the comment in the configure.ac file that explain what is being checked:

# We use -std=gnu99 but have explicit checks for some language constructs
# and GNU extensions since some compilers claim GNU99 support, but don't
# really support all language extensions. In particular we need
# Mixed Declarations and Code
# https://gcc.gnu.org/onlinedocs/gcc/Mixed-Declarations.html
# Nested Functions
# https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
# Arrays of Variable Length
# https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html

> Posting here some past iterations of the patches:
>     https://sourceware.org/ml/elfutils-devel/imported/msg02830.html

yes, there were about 20 patches, that tried to rework code to work around
clang deficiencies. Those have been accepted and incorporated. But more work
would be needed. Patches welcome.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Elfutils-devel mailing list