public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug general/24964] New: elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required
@ 2019-09-04  7:34 slyfox at inbox dot ru
  2019-09-04 15:49 ` [Bug general/24964] " mark at klomp dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: slyfox at inbox dot ru @ 2019-09-04  7:34 UTC (permalink / raw)
  To: elfutils-devel

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

            Bug ID: 24964
           Summary: elfutils fails to configure/build on CC=clang:
                    configure: error: gcc with GNU99 support required
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: general
          Assignee: unassigned at sourceware dot org
          Reporter: slyfox at inbox dot ru
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

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

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required
  2019-09-04  7:34 [Bug general/24964] New: elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required slyfox at inbox dot ru
@ 2019-09-04 15:49 ` mark at klomp dot org
  2021-08-10 13:15 ` adrian.ratiu at collabora dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mark at klomp dot org @ 2019-09-04 15:49 UTC (permalink / raw)
  To: elfutils-devel

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required
  2019-09-04  7:34 [Bug general/24964] New: elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required slyfox at inbox dot ru
  2019-09-04 15:49 ` [Bug general/24964] " mark at klomp dot org
@ 2021-08-10 13:15 ` adrian.ratiu at collabora dot com
  2021-08-10 13:16 ` adrian.ratiu at collabora dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: adrian.ratiu at collabora dot com @ 2021-08-10 13:15 UTC (permalink / raw)
  To: elfutils-devel

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

Adrian Ratiu <adrian.ratiu at collabora dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adrian.ratiu at collabora dot com

--- Comment #2 from Adrian Ratiu <adrian.ratiu at collabora dot com> ---
Created attachment 13611
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13611&action=edit
Clang configure.ac fix

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required
  2019-09-04  7:34 [Bug general/24964] New: elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required slyfox at inbox dot ru
  2019-09-04 15:49 ` [Bug general/24964] " mark at klomp dot org
  2021-08-10 13:15 ` 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
  4 siblings, 0 replies; 6+ messages in thread
From: adrian.ratiu at collabora dot com @ 2021-08-10 13:16 UTC (permalink / raw)
  To: elfutils-devel

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

--- Comment #3 from Adrian Ratiu <adrian.ratiu at collabora dot com> ---
Hi,

Clang builds work fine after the latest fixes in the elfutils codebase, so we
can just drop the configure checks generating the failures above.

I've sent a patch for it [1] which should be enough to close this bug. Attached
it to this bug report as well.

[1] https://sourceware.org/pipermail/elfutils-devel/2021q3/004033.html

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required
  2019-09-04  7:34 [Bug general/24964] New: elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required slyfox at inbox dot ru
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: adrian.ratiu at collabora dot com @ 2021-09-16 21:52 UTC (permalink / raw)
  To: elfutils-devel

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

--- Comment #4 from Adrian Ratiu <adrian.ratiu at collabora dot com> ---
FYI: This should be fixed now in latest dev branch. Thanks!

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug general/24964] elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required
  2019-09-04  7:34 [Bug general/24964] New: elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required slyfox at inbox dot ru
                   ` (3 preceding siblings ...)
  2021-09-16 21:52 ` adrian.ratiu at collabora dot com
@ 2021-09-16 23:00 ` mark at klomp dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mark at klomp dot org @ 2021-09-16 23:00 UTC (permalink / raw)
  To: elfutils-devel

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

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Mark Wielaard <mark at klomp dot org> ---
commit 6eb991a9ebc45cc468a049ef30a98a0f7cad4a0d
Author: Adrian Ratiu <adrian.ratiu@collabora.com>
Date:   Mon Aug 30 18:43:13 2021 +0300

    configure.ac: rework gnu99 ext check to allow clang

    It is true that Clang does not support all gnu99 extensions [1],
    but not all of them are used in the codebase and over time there
    have been code cleanup efforts to improve Clang support.

    For example after commit 779c57ea ("readelf: Pull advance_pc()
    in file scope") there are no more nested function declarations
    and elfutils now builds fine with Clang.

    So in the interest of enabling Clang builds we remove the only
    remaining blocker: the configure checks for nested functions and
    variable length arrays which are also unused.

    Considering mixed decls and code is also part of c99 standard,
    the entire check becomes redundant and we can just replace
    AC_PROG_CC -> AC_PROG_CC_C99.

    [1] https://sourceware.org/bugzilla/show_bug.cgi?id=24964
    Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-16 23:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04  7:34 [Bug general/24964] New: elfutils fails to configure/build on CC=clang: configure: error: gcc with GNU99 support required slyfox at inbox dot ru
2019-09-04 15:49 ` [Bug general/24964] " mark at klomp dot org
2021-08-10 13:15 ` 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

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).