Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 451986 - dev-libs/elfutils does not build with sys-devel/clang
Summary: dev-libs/elfutils does not build with sys-devel/clang
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang
  Show dependency tree
 
Reported: 2013-01-14 08:28 UTC by Hendrik v. Raven
Modified: 2016-03-30 19:10 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log of =dev-libs/elfutils-0.155 (build.log,14.05 KB, text/plain)
2013-01-14 08:28 UTC, Hendrik v. Raven
Details
build log (dev-libs:elfutils-0.158:20150710-151924.log,19.88 KB, text/x-log)
2015-07-10 15:25 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
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.