Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 451986

Summary: dev-libs/elfutils does not build with sys-devel/clang
Product: Gentoo Linux Reporter: Hendrik v. Raven <hendrik>
Component: [OLD] DevelopmentAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED UPSTREAM    
Severity: normal CC: mgorny, ryao, ss23
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: http://code.google.com/p/chromium-os/issues/detail?id=35619
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 408963    
Attachments: build log of =dev-libs/elfutils-0.155
build log

Description Hendrik v. Raven 2013-01-14 08:28:31 UTC
Created attachment 335570 [details]
build log of =dev-libs/elfutils-0.155

Propably due to some GNU extensions clang fails to build elfutils (see attached build log).
Tested it for 0.155 and 0.149, both produce the same error.
Comment 1 Bernard Cafarelli gentoo-dev 2013-01-21 14:03:52 UTC
Added similar report in chromium-os
Comment 2 SpanKY gentoo-dev 2013-09-19 19:22:52 UTC
should be all set now in the tree; thanks for the report!

Commit message: Fix building with clang due to small nested function
http://sources.gentoo.org/dev-libs/elfutils/elfutils-0.156.ebuild?r1=1.1&r2=1.2
http://sources.gentoo.org/dev-libs/elfutils/files/elfutils-0.156-nested-funcs.patch?rev=1.1
Comment 3 SpanKY gentoo-dev 2013-09-30 05:54:55 UTC
unfortunately, that one fix isn't sufficient.  the elfutils code is riddled with nested functions.
Comment 4 Stephen Shkardoon 2013-09-30 06:10:34 UTC
I haven't tested it myself, but it looks like https://github.com/m0use/elfutils-clang-patches/blob/master/elfutils-0.152-clang.patch is all the places that are affected (more than just the one tested here, at least). Might be worth checking for an easy fix.
Comment 5 SpanKY gentoo-dev 2013-12-23 10:12:04 UTC
(In reply to Stephen Shkardoon from comment #4)

pretty sure i hit more than just that
Comment 6 Austin English (RETIRED) gentoo-dev 2014-02-25 21:06:52 UTC
In clang-3.3:

utils-0.158/work/elfutils-0.158/lib -I.. -std=gnu99 -Wall -Wshadow -Wunused -Wextra -Wformat=2 -O2 -march=corei7 -g -pipe -c -o elf_begin.os -fpic -DPIC -DSHARED /var/tmp/portage/dev-libs/elfutils-0.158/work/elfutils-0.158/libelf/elf_begin.c
/var/tmp/portage/dev-libs/elfutils-0.158/work/elfutils-0.158/libelf/elf_begin.c:1041:3: error: function definition is not allowed here
  {
  ^
Comment 7 Agostino Sarubbo gentoo-dev 2015-07-10 15:25:09 UTC
Created attachment 406466 [details]
build log

Full (updated) build log of dev-libs/elfutils-0.158 with clang-3.6.1-r100
Comment 8 Agostino Sarubbo gentoo-dev 2015-07-10 15:31:52 UTC
FTR, the latest has this problem:

checking for gcc with GNU99 support... no
configure: error: gcc with GNU99 support required

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/dev-libs/elfutils-0.163/work/elfutils-0.163-abi_x86_64.amd64/config.log
 * ERROR: dev-libs/elfutils-0.163::gentoo failed (configure phase):
Comment 9 SpanKY gentoo-dev 2016-03-30 19:10:21 UTC
i've looked at this a bit and it's a mess.  if someone wants to tackle, feel free to do so upstream.  they're aware of the issues as well.