Project

General

Profile

Actions

Bug #3116

closed

Build failure with autotools and gcc 4.8 since version 1.4.60

Added by fontaine.fabrice@gmail.com about 3 years ago. Updated about 3 years ago.

Status:
Fixed
Priority:
Normal
Category:
build_autotools
Target version:
ASK QUESTIONS IN Forums:
No

Description

We have the following build failure on buildroot with autotools and gcc 4.8 since version 1.4.60:

array.c: In function 'array_free_data':
array.c:138:2: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
  data_unset ** const data = a->data;
  ^

This build failure can be fixed by running autoreconf so I assume that the configure provided in the official tarball has not been rebuilt after
https://github.com/lighttpd/lighttpd1.4/commit/73865025729897d11494de56a29c77c4fc8e5702.

Can you confirm this issue and fix it for version 1.4.62?

Full build log: http://autobuild.buildroot.org/results/0349d8fed35b0766796dd9ba3b8de6ff8bd68fe7/build-end.log

Actions #1

Updated by gstrauss about 3 years ago

  • Status changed from New to Invalid
  • Target version deleted (1.4.62)

Note: The C99 standard is 22 years old. lighttpd has been using C99 for many, many years. This does not appear to be an issue with the source code distributed on this site by the lighttpd organization.

Please file this issue with the buildroot package maintainers. There are hundreds (thousands?) of OS distros. This is not the place to report issues for each OS distro.

Actions #2

Updated by arnout about 3 years ago

Please file this issue with the buildroot package maintainers.

Fabrice is one of the buildroot package maintainers.

His analysis of the issue was however wrong. The problem stems from commit bb1d35dc17671bc308e25651b4f5fa0c3008cc69, which removed AC_PROG_CC_STDC. This macro will expand to -std=gnu99 on GCC versions that don't already default to C99 or later.

We happen to be able to work around the problem by re-generating the configure script, because we use autoconf 2.71, and that one expands AC_PROG_CC to test for C11, C99 and C89 compiler flags and add the highest one automatically. Autoconf 2.69 only adds the one for C89.

Bottom line: to support older compilers that don't have C99 or later by default, you need to either regenerate the configure script with autoconf 2.71, or (probably better) add AC_PROG_CC_C99.

Actions #3

Updated by gstrauss about 3 years ago

  • Status changed from Invalid to Patch Pending
  • Target version set to 1.4.62

arnout Thank you for the correction.

The initial post said "so I assume that the configure provided in the official tarball has not been rebuilt after ...". While I do not have <fill in your distro here>, I downloaded the lighttpd release tarball on my system and verified that "./configure && make" worked just fine. I apologize that I do not have the time to assess all "my distro does not work" posts, as there are many, many, many more of such posts made by users than there are posts by maintainers.

The commit bb1d35dc identified by arnout is the output from running autoupdate. Thanks autoupdate. I'll add AC_PROG_CC_C99 as arnout suggested.

As an aside, if you detest autotools as much as I do, then if alternative build systems are supported by buildroot, you might consider building lighttpd with meson (as is done in OpenWRT and some others), or with CMake, or with SCons.

Actions #4

Updated by gstrauss about 3 years ago

BTW, one of my test systems Fedora 35 has autoconf 2.69, automake 1.16.2, and libtool 2.4.6. When I downloaded the release tarball, unpacked, and built in a clean directory, lighttpd did not have any trouble building C99. As arnout noted, that is because the compiler defaults to (at least) C99. On Fedora 35, the compiler is gcc 11.2.1 and clang 13.0.0.

FYI, the last release of gcc 4.8 was gcc 4.8.5, released June 23, 2015.
https://gcc.gnu.org/releases.html
https://gcc.gnu.org/develop.html#timeline

Actions #5

Updated by gstrauss about 3 years ago

  • Status changed from Patch Pending to Fixed
Actions #6

Updated by gstrauss about 3 years ago

reference: buildroot mailing list discussion of this issue: https://lore.kernel.org/buildroot/20211123193321.074e7cd8@gmx.net/T/

Actions

Also available in: Atom