Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685688 - dev-libs/elfutils-0.173-r1: fails to configure with clang, GNU99 test
Summary: dev-libs/elfutils-0.173-r1: fails to configure with clang, GNU99 test
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://sourceware.org/PR24964
Whiteboard:
Keywords:
: 793188 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-12 09:09 UTC by Haelwenn (lanodan) Monnier
Modified: 2021-05-31 10:52 UTC (History)
4 users (show)

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


Attachments
/var/tmp/portage/dev-libs/elfutils-0.173-r1/temp/build.log (build.log,5.78 KB, text/x-log)
2019-05-12 09:09 UTC, Haelwenn (lanodan) Monnier
Details
work/elfutils-0.173-abi_x86_32.x86/config.log (config.log,62.82 KB, text/x-log)
2019-05-12 09:14 UTC, Haelwenn (lanodan) Monnier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Haelwenn (lanodan) Monnier 2019-05-12 09:09:17 UTC
Created attachment 576098 [details]
/var/tmp/portage/dev-libs/elfutils-0.173-r1/temp/build.log

Portage 2.3.62 (python 3.6.5-final-0, platforms/pc, gcc-8.2.0, glibc-2.28-r6, 4.19.27-gentoo-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.27-gentoo-r1-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-gentoo-2.6
KiB Mem:    16377392 total,   5479724 free
KiB Swap:          0 total,         0 free
Head commit of repository gentoo: 83a7b166ebd273834a9e6e48eaae24e93685c0e1

sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.31.1 p7) 2.31.1
distcc 3.3.2 x86_64-pc-linux-gnu [disabled]
ccache version 3.6 [disabled]
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/ccache:          3.6::gentoo
dev-util/cmake:           3.9.6::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::lanodanOverlay
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.14.1-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r6::gentoo
sys-devel/gcc:            8.2.0-r6::gentoo, 8.3.0-r1::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/gentoo.git
    priority: -1000

laurentb
    location: /var/lib/layman/laurentb
    sync-type: laymansync
    sync-uri: git://github.com/laurentb/gentoo-overlay.git
    masters: gentoo
    priority: 40

4nykey
    location: /var/lib/layman/4nykey
    sync-type: laymansync
    sync-uri: https://github.com/4nykey/4nykey.git
    masters: gentoo
    priority: 50

ArtSoftware
    location: /var/lib/layman/ArtSoftware
    sync-type: laymansync
    sync-uri: http://git.art-software.fr/ArtSoftware/portageLocalRepo.git
    masters: gentoo
    priority: 50

audio-overlay
    location: /var/lib/layman/audio-overlay
    sync-type: laymansync
    sync-uri: https://github.com/gentoo-audio/audio-overlay.git
    masters: gentoo
    priority: 50

betagarden
    location: /var/lib/layman/betagarden
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/betagarden.git
    masters: gentoo
    priority: 50

bobwya
    location: /var/lib/layman/bobwya
    sync-type: laymansync
    sync-uri: https://github.com/bobwya/miscellaneous_ebuilds.git
    masters: gentoo
    priority: 50

booboo
    location: /var/lib/layman/booboo
    sync-type: laymansync
    sync-uri: https://github.com/l29ah/booboo.git
    masters: gentoo
    priority: 50

cg
    location: /var/lib/layman/cg
    sync-type: laymansync
    sync-uri: https://github.com/brothermechanic/cg.git
    masters: gentoo
    priority: 50

chaoslab
    location: /var/lib/layman/chaoslab
    sync-type: laymansync
    sync-uri: https://gitlab.com/chaoslab/chaoslab-overlay.git
    masters: gentoo
    priority: 50

das-labor
    location: /var/lib/layman/das-labor
    sync-type: laymansync
    sync-uri: https://github.com/das-labor/labor-overlay.git
    masters: gentoo
    priority: 50

dlang
    location: /var/lib/layman/dlang
    sync-type: laymansync
    sync-uri: https://github.com/gentoo/dlang.git
    masters: gentoo
    priority: 50

dotnet
    location: /var/lib/layman/dotnet
    sync-type: laymansync
    sync-uri: https://github.com/gentoo/dotnet.git
    masters: gentoo
    priority: 50

flussence
    location: /var/lib/layman/flussence
    sync-type: laymansync
    sync-uri: https://gitlab.com/flussence/overlay.git
    masters: gentoo
    priority: 50

go-overlay
    location: /var/lib/layman/go-overlay
    sync-type: laymansync
    sync-uri: https://github.com/Dr-Terrible/go-overlay.git
    masters: gentoo
    priority: 50

guru
    location: /var/lib/layman/guru
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru.git
    masters: gentoo
    priority: 50

haskell
    location: /var/lib/layman/haskell
    sync-type: laymansync
    sync-uri: https://github.com/gentoo-haskell/gentoo-haskell.git
    masters: gentoo
    priority: 50

java
    location: /var/lib/layman/java
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/java.git
    masters: gentoo
    priority: 50

jorgicio
    location: /var/lib/layman/jorgicio
    sync-type: laymansync
    sync-uri: https://github.com/jorgicio/jorgicio-gentoo.git
    masters: gentoo
    priority: 50

libressl
    location: /var/lib/layman/libressl
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/repo/proj/libressl.git
    masters: gentoo
    priority: 50

lua
    location: /var/lib/layman/lua
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/lua.git
    masters: gentoo
    priority: 50

pentoo
    location: /var/lib/layman/pentoo
    sync-type: laymansync
    sync-uri: git://github.com/pentoo/pentoo-overlay.git
    masters: gentoo
    priority: 50

vampire
    location: /var/lib/layman/vampire
    sync-type: laymansync
    sync-uri: https://github.com/TheCrueltySage/vampire-overlay.git
    masters: gentoo
    priority: 50

lanodanOverlay
    location: /var/lib/layman/lanodanOverlay
    sync-type: laymansync
    sync-uri: https://gitlab.com/lanodan/overlay.git
    masters: gentoo lua
    priority: 100

Installed sets: @games, @graphical, @haiku-dev, @math, @office, @peertube, @prosody
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-Qunused-arguments -O2 -pipe -march=native -mtune=native -Wall -Wextra -Wconversion -Wsign-conversion -Wformat -Wformat-security -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /lib/udev/rules.d/ /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXX="clang++"
CXXFLAGS="-Qunused-arguments -O2 -pipe -march=native -mtune=native -Wall -Wextra -Wconversion -Wsign-conversion -Wformat -Wformat-security -ggdb"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned python-trace sandbox sfperms sign splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://hp2125/gentoo/ https://mirror.swordarmor.fr/gentoo https://mirrors.dotsrc.org/gentoo/ https://gentoo.osuosl.org/ http://distfiles.gentoo.org"
INSTALL_MASK="/usr/lib/systemd /usr/lib64/systemd /etc/systemd /etc/sudoers /etc/sudoers.d"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,relro -Wl,-z,now"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="true"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="(cuda) (opencl) (pgo) X accessibility acl acpi alsa amd64 bzip2 cacert caps ccache cjk clang crypt cryptsetup cxx d3d9 dane default-compiler-rt default-libcxx device-mapper dri egl eme-free gentoo-dev glamor gles gles1 gles2 gpg gtk3 hardened iconv icu idn iproute2 ipv6 jingle jpeg jumbo-build ldns libcxx libedit libressl libtirpc libtommath libzfs lm_sensors luajit mandoc mikmod modplug multilib multitarget ncurses nls nptl opengl openmp opus pam pcre pie png portaudio qt3support readline sanitize sasl sctp seccomp smp spell ssl ssp symlink system-binutils system-boost system-cairo system-capstone system-clang system-cmark system-crontab system-ffmpeg system-harfbuzz system-heimdal system-icu system-jpeg system-jsoncpp system-libevent system-libmspack system-libs system-libvpx system-libyaml system-lua system-mitkrb5 system-qemu system-qt system-renpy system-seabios system-snappy system-sqlite system-tbb system-uulib system-wide system-wine system-zlib threads truetype udev unicode urandom usb uvm vaapi vdpau vorbis vulkan wayland xattr xcsecurity xft xinerama xtpax xwayland zfs zlib" ABI_X86="32 64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="cgroups conntrack contextswitch cpu df disk dns entropy fhcount fscache hddtemp interface memory processes protocols rrdtool sensors smart swap thermal uptime users wireless zfs_arc" CPU_FLAGS_X86="aes avx fma3 fma4 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" CURL_SSL="libressl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="wacom libinput keyboard" KERNEL="linux" L10N="en en-US en-GB fr fr-FR fr-CA fr-CH fr-BE ja ja-JP is jbo de de-DE" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AArch64 ARM Hexagon Mips MSP430 PowerPC Sparc SystemZ XCore AMDGPU BPF NVPTX Lanai RISCV" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" NGINX_MODULES_HTTP="access autoindex charset fastcgi gzip gzip_static limit_conn limit_req map memcached metrics mirror proxy push_stream rewrite scgi split_clients ssi upstream_hash upstream_ip_hash upstream_keepalive upstream_least_conn upstream_zone userid uwsgi vhost_traffic_status headers_more stub_status" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6" QEMU_SOFTMMU_TARGETS="arm armeb i386 sparc x86_64" QEMU_USER_TARGETS="arm armeb i386 sparc x86_64" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="radeonsi amdgpu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-libs/elfutils-0.170-r1::gentoo was built with the following:
USE="bzip2 nls utils -lzma -static-libs -test (-threads)" ABI_X86="32 (64) (-x32)"
CFLAGS="-O2 -pipe -march=native -mtune=native -Wall -Wextra -Wconversion -Wsign-conversion -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pie -fPIE -fPIC"
CXXFLAGS="-O2 -pipe -march=native -mtune=native -Wall -Wextra -Wconversion -Wsign-conversion -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -pie -fPIE -fPIC"
Comment 1 Haelwenn (lanodan) Monnier 2019-05-12 09:14:23 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.
Comment 2 Sergei Trofimovich gentoo-dev 2019-05-12 10:54:56 UTC
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
Comment 3 Sergei Trofimovich gentoo-dev 2019-05-12 10:56:43 UTC
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.
Comment 4 Sergei Trofimovich gentoo-dev 2019-09-04 07:35:32 UTC
Filed upstream as https://sourceware.org/PR24964
Comment 5 12101111 2021-04-16 18:42:20 UTC
The next elfutils release should able to compile with clang.
There is only one nested function in current code base.
Comment 6 Manoj Gupta 2021-05-26 18:05:52 UTC
> 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?
Comment 7 Sergei Trofimovich gentoo-dev 2021-05-31 10:52:23 UTC
*** Bug 793188 has been marked as a duplicate of this bug. ***