public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "mark at klomp dot org" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required
Date: Wed, 04 Sep 2019 15:49:00 -0000	[thread overview]
Message-ID: <bug-24964-10460-iNF5ZkO9h2@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24964-10460@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=24964

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.

  reply	other threads:[~2019-09-04 15:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  7:34 [Bug general/24964] New: " slyfox at inbox dot ru
2019-09-04 15:49 ` mark at klomp dot org [this message]
2021-08-10 13:15 ` [Bug general/24964] " adrian.ratiu at collabora dot com
2021-08-10 13:16 ` adrian.ratiu at collabora dot com
2021-09-16 21:52 ` adrian.ratiu at collabora dot com
2021-09-16 23:00 ` mark at klomp dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-24964-10460-iNF5ZkO9h2@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=elfutils-devel@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).