Summary: | dev-libs/elfutils-0.173-r1: fails to configure with clang, GNU99 test | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Haelwenn (lanodan) Monnier <contact> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | adrian.ratiu, bugs.gentoo.org, jstein, sam, vicalcas |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceware.org/PR24964 | ||
See Also: | https://bugzilla.redhat.com/show_bug.cgi?id=1211357 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 408963 | ||
Attachments: |
/var/tmp/portage/dev-libs/elfutils-0.173-r1/temp/build.log
work/elfutils-0.173-abi_x86_32.x86/config.log |
Description
Haelwenn (lanodan) Monnier
2019-05-12 09:09:17 UTC
Created attachment 576100 [details]
work/elfutils-0.173-abi_x86_32.x86/config.log
Add /var/tmp/portage/dev-libs/elfutils-0.173-r1/work/elfutils-0.173-abi_x86_32.x86/config.log
The errors are the same with dev-libs/elfutils-0.176 btw.
elfutils wants nested local function definitions (don't know if it really uses them or not): configure:5051: clang -m32 -c -Qunused-arguments -O2 -pipe -std=gnu99 conftest.c >&5 conftest.c:20:28: error: function definition is not allowed here double square (double z) { return z * z; } ^ conftest.c:21:10: warning: implicit declaration of function 'square' is invalid in C99 [-Wimplicit-function-declaration] return square (a) + square (b); ^ conftest.c:26:18: error: fields must have a constant size: 'variable length array in structure' extension will never be supported struct S { int x[n]; }; ^ 1 warning and 2 errors generated. configure:5051: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "elfutils" | #define PACKAGE_TARNAME "elfutils" | #define PACKAGE_VERSION "0.173" | #define PACKAGE_STRING "elfutils 0.173" | #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla" | #define PACKAGE_URL "http://elfutils.org/" | #define PACKAGE "elfutils" | #define VERSION "0.173" | #define DEFAULT_AR_DETERMINISTIC false | #define YYTEXT_POINTER 1 | /* end confdefs.h. */ | int foo (int a) | { | for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; return s; | } | | double bar (double a, double b) | { | double square (double z) { return z * z; } | return square (a) + square (b); | } | | void baz (int n) | { | struct S { int x[n]; }; | } configure:5059: result: no configure:5062: error: gcc with GNU99 support required Looking at https://bugzilla.redhat.com/show_bug.cgi?id=1211357 it deliberately uses nested functions and porting to clang will need to happen upstream. Filed upstream as https://sourceware.org/PR24964 The next elfutils release should able to compile with clang. There is only one nested function in current code base. > The next elfutils release should able to compile with clang.
I just tried to build latest elfutils from git but it still failed.
git clone git://sourceware.org/git/elfutils.git .
CC=clang ./configure
configure: No --program-prefix given, using "eu-"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking whether clang understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of clang... gcc3
checking for ranlib... ranlib
checking for bison... bison -y
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking for readelf... readelf
checking for nm... nm
checking for gcc with GNU99 support... no
configure: error: gcc with GNU99 support required
Are there any patches needed?
*** Bug 793188 has been marked as a duplicate of this bug. *** One more patch is needed to drop the unnecessary configure check, I've sent a patch for it [1] but otherwise Clang builds work now with latest mainline dev branch which will become v0.186. [1] https://sourceware.org/pipermail/elfutils-devel/2021q3/004033.html This should've been sorted by https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-libs/elfutils?id=388d62376b0d53e78d347ab890e2b8742aea2e23 AFAIK. |