Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 481316 - media-libs/mesa[llvm] fails to build with >=sys-devel/llvm-3.4[ncurses] - /usr/lib64/llvm/libLLVMSupport.a(Process.o): In function `llvm::sys::Process::FileDescriptorHasColors(int)': (.text+0x587): undefined reference to `setupterm'
Summary: media-libs/mesa[llvm] fails to build with >=sys-devel/llvm-3.4[ncurses] - /us...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal with 2 votes (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
: 497420 499412 500626 501608 501682 502374 502402 502430 502572 502992 503086 503154 503642 503736 509042 509102 509152 509272 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-16 14:06 UTC by Ivan Iraci
Modified: 2014-11-04 17:22 UTC (History)
62 users (show)

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


Attachments
The complete build log. (build.log.bz2,33.75 KB, application/x-bzip2)
2013-08-16 14:09 UTC, Ivan Iraci
Details
The ebuild environment file. (environment,165.01 KB, text/plain)
2013-08-16 14:09 UTC, Ivan Iraci
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Iraci 2013-08-16 14:06:15 UTC
Since 2013-08-10 it's impossible to emerge mesa-9999 from x11 overlay

Reproducible: Always

Steps to Reproduce:
1. emerge =mesa-9999
2. KABOOOOM!!!
Actual Results:  
/usr/lib64/llvm/libLLVMSupport.a(Process.o): In function `llvm::sys::Process::FileDescriptorHasColors(int)':
(.text+0x587): undefined reference to `setupterm'
/usr/lib64/llvm/libLLVMSupport.a(Process.o): In function `llvm::sys::Process::FileDescriptorHasColors(int)':
(.text+0x5b0): undefined reference to `tigetnum'
collect2: error: ld returned 1 exit status
gmake[3]: *** [egl_gallium.la] Errore 1
gmake[2]: *** [all-recursive] Errore 1
gmake[1]: *** [all-recursive] Errore 1
make: *** [all-recursive] Errore 1


Expected Results:  
Mesa should compile.

# emerge --info '=media-libs/mesa-9999::x11':

Portage 2.2.0 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.17, 3.9.10-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.9.10-gentoo-x86_64-AMD_Phenom-tm-_II_X4_965_Processor-with-gentoo-2.2
KiB Mem:     7921872 total,   4566656 free
KiB Swap:    8393956 total,   8393956 free
Timestamp of tree: Fri, 16 Aug 2013 05:15:01 +0000
ld ld di GNU (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r1, 3.2.5-r1, 3.3.2-r1
dev-util/cmake:           2.8.11.1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.6, 1.14
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo vmware sunrise maksbotan booboo enlightenment mozilla x11
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.1/conf /var/lib/hsqldb /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/games/angband/edit/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-activ
e/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn u
nmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.modulix.net/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://gentoo.wheel.sk/ http://gentoo.inode.at/ htt
p://gentoo.mirror.dkm.cz/pub/gentoo/"
LANG="it_IT.UTF-8"
LC_ALL="it_IT.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-s -j4"
PKGDIR="/usr/portage/packages"
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 --exclud
e=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/vmware /var/lib/layman/sunrise /var/lib/layman/maksbotan /var/lib/layman/l29ah /var/lib/layman/enlightenment /var/lib/layman/mozilla /var/lib/layman/x11"
SYNC="rsync://eeebox.axis.lan/gentoo-portage"
USE="3dnow 3dnowext X acl amd64 bash-completion berkdb bzip2 cairo cgroup cli cracklib crypt cups curl cxx dbus dri exif fat fontconfig fortran gallium gcj gdbm gtk gtk3 hfs iconv ipv6 ithreads jfs jpeg jpeg2k mm
x modules mudflap multilib ncurses nls nptl nptlonly ntfs opengl openmp pam pcre png pulseaudio qt3support qt4 quicktime readline reiser4 reiserfs session sse sse2 ssl tcpd threads tiff truetype unicode vaapi vdp
au vpx vserver xattr xfs zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio
 via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_own
er authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation pro
xy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan s
heets stage tables krita karbon braindump author" CAMERAS="spca50x sq905" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="nss" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate e
vermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse void" KERNE
L="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-minimizer nlpsolver scripting-javascript wiki-publisher" LINGUAS="it" NGINX_MODULES_
HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_req limit_zone map memcached proxy referer rewrite ssi upstream_ip_hash userid spdy push" OFFICE_IMPLEMENTATION="libreoffice" PHP
_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2 python3_3" RUBY_TARGETS="ruby18 ruby19 ruby20 jruby" SANE_BACKENDS="hp hp3500 hp3900 hp4200 hp5400 hp5590 hpljm1005 hpsj5s hs
2p net" USERLAND="GNU" VIDEO_CARDS="v4l vga ati radeon r600" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpma
c delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

media-libs/mesa-9999 was built with the following:
USE="classic egl gallium gbm gles2 llvm nptl openvg osmesa r600-llvm-compiler vdpau xa xvmc -bindist -debug -gles1 -opencl -pax_kernel -pic (-selinux) -wayland -xorg" PYTHON_SINGLE_TARGET="python2_7 -python2_6" P
YTHON_TARGETS="python2_7 -python2_6" VIDEO_CARDS="r600 radeon -freedreno -i915 -i965 -ilo -intel -nouveau -r100 -r200 -r300 -radeonsi -vmware"
CXXFLAGS="-O2 -march=native -pipe -DNDEBUG"

# emerge -pqv '=media-libs/mesa-9999::x11':
[ebuild   R   ] media-libs/mesa-9999  USE="classic egl gallium gbm gles2 llvm nptl openvg osmesa r600-llvm-compiler vdpau xa xvmc -bindist -debug -gles1 -opencl -pax_kernel -pic (-selinux) -wayland -xorg" PYTHON_SINGLE_TARGET="python2_7 -python2_6" PYTHON_TARGETS="python2_7 -python2_6" VIDEO_CARDS="r600 radeon (-freedreno) -i915 -i965 -ilo -intel -nouveau -r100 -r200 -r300 -radeonsi -vmware"
Comment 1 Ivan Iraci 2013-08-16 14:09:03 UTC
Created attachment 356212 [details]
The complete build log.
Comment 2 Ivan Iraci 2013-08-16 14:09:40 UTC
Created attachment 356214 [details]
The ebuild environment file.
Comment 3 Rafał Mużyło 2013-08-16 16:34:02 UTC
Probably ncurses[tinfo] case.
Comment 4 Ivan Iraci 2013-08-18 09:14:20 UTC
(In reply to Rafał Mużyło from comment #3)

> Probably ncurses[tinfo] case.

I reemerged ncurses with tinfo use flag and tried again: same error.
I even tried to emerge mesa-9999 with /etc/portage/env/media-libs/mesa containing:

CFLAGS="-O2 -march=native -pipe -lncurses -ltinfo"
CXXFLAGS="${CFLAGS}"

Same error.
Comment 5 Rafał Mużyło 2013-08-18 15:04:03 UTC
(In reply to Ivan Iraci from comment #4)
> (In reply to Rafał Mużyło from comment #3)
> 
> > Probably ncurses[tinfo] case.
> 
> I reemerged ncurses with tinfo use flag and tried again: same error.
> I even tried to emerge mesa-9999 with /etc/portage/env/media-libs/mesa
> containing:
> 
> CFLAGS="-O2 -march=native -pipe -lncurses -ltinfo"

LIBS shouldn't go into CFLAGS.
Also, what I've meant was "problem that happens *when* ncurses is built with tinfo useflag set".
Comment 6 Ivan Iraci 2013-08-24 15:50:54 UTC
(In reply to Rafał Mużyło from comment #5)

> Also, what I've meant was "problem that happens *when* ncurses is built with
> tinfo useflag set".

When I wrote this bug report ncurses was built with tinfo useflag disabled.
Comment 7 Ivan Iraci 2013-08-31 09:02:46 UTC
mesa compiles with egl USEFLAG disabled but xf86-video-ati isn't working fine:
$ LIBGL_DEBUG=verbose glxgears
libGL: OpenDriver: trying /usr/lib64/dri/tls/r600_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/r600_dri.so
libGL error: dlopen /usr/lib64/dri/r600_dri.so failed (/usr/lib64/dri/r600_dri.so: undefined symbol: setupterm)
Comment 8 Ivan Iraci 2013-08-31 09:04:09 UTC
Before you ask about it:
ncurses is built with tinfo useflag *UN*set.
Comment 9 Ivan Iraci 2013-08-31 10:53:04 UTC
Resolved by editing llvm-9999 ebuild and recompiling it:

multilib_src_configure() {
    local CONF_FLAGS="--enable-keep-symbols
        --enable-shared
        --disable-terminfo ## <-- Line added by me
        --with-optimize-option=
        $(use_enable !debug optimized)
        $(use_enable debug assertions)
        $(use_enable debug expensive-checks)"
Comment 10 Ivan Iraci 2013-09-21 09:20:01 UTC
The problem persists. I have to edit llvm ebuild and emerge llvm to succesfully emerge mesa.
Comment 11 Chí-Thanh Christopher Nguyễn gentoo-dev 2013-09-21 09:34:15 UTC
CC'ing sys-devel/llvm maintainers

LLVM sometimes has weird linking problems such as bug 382995 which are seen only by some users and not by others.
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-09-21 09:43:06 UTC
Hmm, looks like llvm's got automagic dep on ncurses...

but anyway, this looks like a classic issue with static linking on Linux. I guess llvm-config fails to list the libs necessary for static linking. But that's just guessing.
Comment 13 Ivan Iraci 2013-10-11 07:01:25 UTC
The problem still exists.
Comment 14 Alexander Tsoy 2014-01-08 20:34:42 UTC
*** Bug 497420 has been marked as a duplicate of this bug. ***
Comment 15 Alexander Tsoy 2014-01-08 20:56:38 UTC
Same problem with mesa-10.0.1[-llvm-shared-libs] + llvm-3.4[ncurses] from the portage tree. mesa[-llvm-shared-libs,-openvg] builda fine on my systems, but causes runtime failures (undefined symbols).

upstream bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=70410
https://bugs.freedesktop.org/show_bug.cgi?id=72307
Comment 16 Alexander Tsoy 2014-01-09 10:35:07 UTC
@x11:
What do you think about Michał's suggestions [1]? May be it's time to implement them at least in mesa-10* ebuilds?

[1] https://bugs.gentoo.org/show_bug.cgi?id=488216#c27
Comment 17 Benjamin Lee 2014-01-10 06:58:25 UTC
Upstream bug #72307 lists building llvm[-ncurses] as a workaround.  I can confirm mesa-10.0.2 built successfully against llvm-3.4[-ncurses] on my system.  I did not modify any ebuilds.
Comment 18 Matt Turner gentoo-dev 2014-01-27 03:21:55 UTC
*** Bug 499412 has been marked as a duplicate of this bug. ***
Comment 19 Pavel Volkov 2014-02-07 09:51:39 UTC
I have this error with mesa 9.2.5 from main tree.
Comment 20 Jeroen Roovers (RETIRED) gentoo-dev 2014-02-07 16:13:12 UTC
*** Bug 500626 has been marked as a duplicate of this bug. ***
Comment 21 Geoff Madden 2014-02-09 04:51:06 UTC
I followed ivan's suggestion regarding rebuilding llvm -terminfo.
then tried building mesa-9.2.5  and have to report a successful build.
Comment 22 Robert Cabrera 2014-02-11 17:46:41 UTC
I just got hit with this on my ~amd64 laptop. I had previously masked llvm-3.4 due to emerge blockage with xorg and legacy nvidia-drivers my laptop requires. I was cleaning cruft out of various config files this weekend and noticed the block was no longer valid and removed the mask. llvm emerged successfully, however, now mesa is failing to compile against it with the same errors listed here. I will attempt to rebuild llvm with USE="-ncurses" as has been suggested, and see if this workaround resolves the problem building mesa.
Comment 23 Robert Cabrera 2014-02-11 19:19:47 UTC
I too can now confirm that building llvm with USE="-ncurses" allows mesa to emerge as expected.
Comment 24 Keith Harrison 2014-02-13 15:52:53 UTC
after recompiling llvm with -ncurses, remerging mesa fails with:

gmake[4]: Entering directory '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86/src/gallium/targets/egl-static'
gmake[4]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/var/tmp/portage/media-libs/mesa-9.2.5/image//usr/lib32/egl'
 /bin/sh ../../../../libtool   --mode=install /usr/bin/install -c   egl_gallium.la '/var/tmp/portage/media-libs/mesa-9.2.5/image//usr/lib32/egl'
libtool: install: warning: relinking `egl_gallium.la'
libtool: install: (cd /var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86/src/gallium/targets/egl-static; /bin/sh /var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86/libtool  --tag CXX --mode=relink x86_64-pc-linux-gnu-g++ -m32 -O2 -march=native -pipe -fomit-frame-pointer -Wall -fno-strict-aliasing -fno-builtin-memcmp -Wl,--no-undefined -Wl,--allow-multiple-definition -avoid-version -module -L/usr/lib32 -lz -lpthread -lffi -ldl -lm -Wl,-O1 -Wl,--as-needed -o egl_gallium.la -rpath /usr/lib32/egl egl.lo egl_pipe.lo egl_st.lo ../../../../src/gallium/auxiliary/libgallium.la ../../../../src/gallium/drivers/identity/libidentity.la ../../../../src/gallium/drivers/trace/libtrace.la ../../../../src/gallium/drivers/rbug/librbug.la ../../../../src/gallium/state_trackers/egl/libegl.la ../../../../src/egl/main/libEGL.la -L/usr/lib32 -ludev -ldl -lpthread -lm ../../../../src/gallium/winsys/sw/xlib/libws_xlib.la -lX11 -lXext -lXfixes -L/usr/lib32 -ldrm ../../../../src/mesa/libmesagallium.la ../../../../src/mapi/shared-glapi/libglapi.la ../../../../src/gallium/drivers/softpipe/libsoftpipe.la ../../../../src/gallium/drivers/llvmpipe/libllvmpipe.la -lLLVMMCJIT -lLLVMBitWriter -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -inst-prefix-dir /var/tmp/portage/media-libs/mesa-9.2.5/image/)
libtool: relink: x86_64-pc-linux-gnu-g++ -m32  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib32/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/32/crtbeginS.o  .libs/egl.o .libs/egl_pipe.o .libs/egl_st.o  -Wl,--whole-archive ../../../../src/gallium/auxiliary/.libs/libgallium.a ../../../../src/gallium/drivers/identity/.libs/libidentity.a ../../../../src/gallium/drivers/trace/.libs/libtrace.a ../../../../src/gallium/drivers/rbug/.libs/librbug.a ../../../../src/gallium/state_trackers/egl/.libs/libegl.a ../../../../src/gallium/winsys/sw/xlib/.libs/libws_xlib.a ../../../../src/mesa/.libs/libmesagallium.a ../../../../src/gallium/drivers/softpipe/.libs/libsoftpipe.a ../../../../src/gallium/drivers/llvmpipe/.libs/libllvmpipe.a -Wl,--no-whole-archive  -L/usr/lib32 -Wl,--as-needed -L/var/tmp/portage/media-libs/mesa-9.2.5/image//usr/lib32 -lEGL -lX11-xcb -lxcb-dri2 -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -ludev -lX11 -lXext -lXfixes -ldrm -lglapi -lz -lpthread -lffi -ldl -lLLVMMCJIT -lLLVMBitWriter -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/32 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib32 -L/lib/../lib32 -L/usr/lib/../lib32 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/32/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib32/crtn.o  -m32 -O2 -march=native -Wl,--no-undefined -Wl,--allow-multiple-definition -Wl,-O1   -pthread -Wl,-soname -Wl,egl_gallium.so -o .libs/egl_gallium.so
.libs/egl.o: In function `create_drm_screen':
egl.c:(.text+0x73): undefined reference to `_eglLog'
egl.c:(.text+0x147): undefined reference to `_eglLog'
egl.c:(.text+0x1fa): undefined reference to `_eglLog'
egl.c:(.text+0x222): undefined reference to `_eglLog'
egl.c:(.text+0x269): undefined reference to `_eglLog'
.libs/egl.o:egl.c:(.text+0x291): more undefined references to `_eglLog' follow
../../../../src/gallium/state_trackers/egl/.libs/libegl.a(egl_g3d_api.o): In function `egl_g3d_show_screen_surface':
egl_g3d_api.c:(.text+0x1a4): undefined reference to `_eglError'
egl_g3d_api.c:(.text+0x1c2): undefined reference to `_eglError'
egl_g3d_api.c:(.text+0x1e2): undefined reference to `_eglError'
egl_g3d_api.c:(.text+0x20a): undefined reference to `_eglError

.
.
.

Makefile:603: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
 * ERROR: media-libs/mesa-9.2.5::gentoo failed (install phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=media-libs/mesa-9.2.5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/mesa-9.2.5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/mesa-9.2.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/mesa-9.2.5/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86'
 * S: '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5'

 * Messages for package media-libs/mesa-9.2.5:

 * ERROR: media-libs/mesa-9.2.5::gentoo failed (install phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=media-libs/mesa-9.2.5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=media-libs/mesa-9.2.5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/media-libs/mesa-9.2.5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-libs/mesa-9.2.5/temp/environment'.
 * Working directory: '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86'
 * S: '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5'
 * 
 * The following package has failed to build or install:
 * 
 *  (media-libs/mesa-9.2.5::gentoo, ebuild scheduled for merge), Log file:
 *   '/var/tmp/portage/media-libs/mesa-9.2.5/temp/build.log'
Comment 25 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-02-13 16:08:49 UTC
(In reply to Keith Harrison from comment #24)
> .libs/egl.o: In function `create_drm_screen':
> egl.c:(.text+0x73): undefined reference to `_eglLog'

That problem is probably not related to this bug.
Comment 26 Geoff Madden 2014-02-13 16:14:24 UTC
(In reply to Keith Harrison from comment #24)
> after recompiling llvm with -ncurses, remerging mesa fails with:
> 
> gmake[4]: Entering directory
> '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86/src/gallium/
> targets/egl-static'
> gmake[4]: Nothing to be done for 'install-exec-am'.
>  /bin/mkdir -p '/var/tmp/portage/media-libs/mesa-9.2.5/image//usr/lib32/egl'
>  /bin/sh ../../../../libtool   --mode=install /usr/bin/install -c  
> egl_gallium.la '/var/tmp/portage/media-libs/mesa-9.2.5/image//usr/lib32/egl'
> libtool: install: warning: relinking `egl_gallium.la'
> libtool: install: (cd
> /var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86/src/gallium/
> targets/egl-static; /bin/sh
> /var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86/libtool  --tag
> CXX --mode=relink x86_64-pc-linux-gnu-g++ -m32 -O2 -march=native -pipe
> -fomit-frame-pointer -Wall -fno-strict-aliasing -fno-builtin-memcmp
> -Wl,--no-undefined -Wl,--allow-multiple-definition -avoid-version -module
> -L/usr/lib32 -lz -lpthread -lffi -ldl -lm -Wl,-O1 -Wl,--as-needed -o
> egl_gallium.la -rpath /usr/lib32/egl egl.lo egl_pipe.lo egl_st.lo
> ../../../../src/gallium/auxiliary/libgallium.la
> ../../../../src/gallium/drivers/identity/libidentity.la
> ../../../../src/gallium/drivers/trace/libtrace.la
> ../../../../src/gallium/drivers/rbug/librbug.la
> ../../../../src/gallium/state_trackers/egl/libegl.la
> ../../../../src/egl/main/libEGL.la -L/usr/lib32 -ludev -ldl -lpthread -lm
> ../../../../src/gallium/winsys/sw/xlib/libws_xlib.la -lX11 -lXext -lXfixes
> -L/usr/lib32 -ldrm ../../../../src/mesa/libmesagallium.la
> ../../../../src/mapi/shared-glapi/libglapi.la
> ../../../../src/gallium/drivers/softpipe/libsoftpipe.la
> ../../../../src/gallium/drivers/llvmpipe/libllvmpipe.la -lLLVMMCJIT
> -lLLVMBitWriter -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen
> -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc
> -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld
> -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts
> -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget
> -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -inst-prefix-dir
> /var/tmp/portage/media-libs/mesa-9.2.5/image/)
> libtool: relink: x86_64-pc-linux-gnu-g++ -m32  -fPIC -DPIC -shared -nostdlib
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib32/crti.o
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/32/crtbeginS.o  .libs/egl.o
> .libs/egl_pipe.o .libs/egl_st.o  -Wl,--whole-archive
> ../../../../src/gallium/auxiliary/.libs/libgallium.a
> ../../../../src/gallium/drivers/identity/.libs/libidentity.a
> ../../../../src/gallium/drivers/trace/.libs/libtrace.a
> ../../../../src/gallium/drivers/rbug/.libs/librbug.a
> ../../../../src/gallium/state_trackers/egl/.libs/libegl.a
> ../../../../src/gallium/winsys/sw/xlib/.libs/libws_xlib.a
> ../../../../src/mesa/.libs/libmesagallium.a
> ../../../../src/gallium/drivers/softpipe/.libs/libsoftpipe.a
> ../../../../src/gallium/drivers/llvmpipe/.libs/libllvmpipe.a
> -Wl,--no-whole-archive  -L/usr/lib32 -Wl,--as-needed
> -L/var/tmp/portage/media-libs/mesa-9.2.5/image//usr/lib32 -lEGL -lX11-xcb
> -lxcb-dri2 -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -ludev -lX11 -lXext
> -lXfixes -ldrm -lglapi -lz -lpthread -lffi -ldl -lLLVMMCJIT -lLLVMBitWriter
> -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG
> -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info
> -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld
> -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts
> -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget
> -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport
> -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/32
> -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib32 -L/lib/../lib32
> -L/usr/lib/../lib32 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2
> -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/lib
> -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../.. -lstdc++ -lm -lc -lgcc_s
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/32/crtendS.o
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib32/crtn.o  -m32 -O2
> -march=native -Wl,--no-undefined -Wl,--allow-multiple-definition -Wl,-O1  
> -pthread -Wl,-soname -Wl,egl_gallium.so -o .libs/egl_gallium.so
> .libs/egl.o: In function `create_drm_screen':
> egl.c:(.text+0x73): undefined reference to `_eglLog'
> egl.c:(.text+0x147): undefined reference to `_eglLog'
> egl.c:(.text+0x1fa): undefined reference to `_eglLog'
> egl.c:(.text+0x222): undefined reference to `_eglLog'
> egl.c:(.text+0x269): undefined reference to `_eglLog'
> .libs/egl.o:egl.c:(.text+0x291): more undefined references to `_eglLog'
> follow
> ../../../../src/gallium/state_trackers/egl/.libs/libegl.a(egl_g3d_api.o): In
> function `egl_g3d_show_screen_surface':
> egl_g3d_api.c:(.text+0x1a4): undefined reference to `_eglError'
> egl_g3d_api.c:(.text+0x1c2): undefined reference to `_eglError'
> egl_g3d_api.c:(.text+0x1e2): undefined reference to `_eglError'
> egl_g3d_api.c:(.text+0x20a): undefined reference to `_eglError
> 
> .
> .
> .
> 
> Makefile:603: recipe for target 'install-recursive' failed
> make: *** [install-recursive] Error 1
>  * ERROR: media-libs/mesa-9.2.5::gentoo failed (install phase):
>  *   emake failed
>  * 
>  * If you need support, post the output of `emerge --info
> '=media-libs/mesa-9.2.5::gentoo'`,
>  * the complete build log and the output of `emerge -pqv
> '=media-libs/mesa-9.2.5::gentoo'`.
>  * The complete build log is located at
> '/var/tmp/portage/media-libs/mesa-9.2.5/temp/build.log'.
>  * The ebuild environment file is located at
> '/var/tmp/portage/media-libs/mesa-9.2.5/temp/environment'.
>  * Working directory:
> '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86'
>  * S: '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5'
> 
>  * Messages for package media-libs/mesa-9.2.5:
> 
>  * ERROR: media-libs/mesa-9.2.5::gentoo failed (install phase):
>  *   emake failed
>  * 
>  * If you need support, post the output of `emerge --info
> '=media-libs/mesa-9.2.5::gentoo'`,
>  * the complete build log and the output of `emerge -pqv
> '=media-libs/mesa-9.2.5::gentoo'`.
>  * The complete build log is located at
> '/var/tmp/portage/media-libs/mesa-9.2.5/temp/build.log'.
>  * The ebuild environment file is located at
> '/var/tmp/portage/media-libs/mesa-9.2.5/temp/environment'.
>  * Working directory:
> '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5-x86'
>  * S: '/var/tmp/portage/media-libs/mesa-9.2.5/work/Mesa-9.2.5'
>  * 
>  * The following package has failed to build or install:
>  * 
>  *  (media-libs/mesa-9.2.5::gentoo, ebuild scheduled for merge), Log file:
>  *   '/var/tmp/portage/media-libs/mesa-9.2.5/temp/build.log'

Do you have the egl flag activated in your make.conf ???
Comment 27 Mike Johnson 2014-02-14 05:11:52 UTC
I initially had the *exact* build output of Ivan's post #1.  After stumbling upon this bug I emerged llvm with -ncurses.  And then I got the *exact* output as described by Keith Harrison in post #24.  Is it really not related?
And no, I do not have egl in my make.conf file.
This machine was rebuilt with emerge -e @system @world 1 week ago.  Mesa compiled then.  I had nvidia-drivers 331.38.  I installed nvidia-drivers 334.16 and this trouble began.  I cannot downgrade due to some mess the new driver leaves behind, libGLES.so and libEGL.so files.  Slightly off-topic but related.
Comment 28 Mike Johnson 2014-02-14 07:57:02 UTC
I solved the issue here by downgrading to nvidia-drivers-304.119.  Mesa still gave the errors as in post #1.  But this time I emerged llvm with -ncurses and then mesa compiled.
Also, while still fighting with the new driver I did try Ivan's fix in post #9 - no help.  I also tried that fix with llvm -ncurses.  Nope.
So the issue may be problems with llvm, but at least in this case, the new driver played a part also.
This was with the mesa-9.25 driver in the main tree.
Comment 29 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-02-14 09:32:31 UTC
Please report the issue with undefined _eglLog and _eglError in combination with nvidia-drivers in a separate bug. It has nothing to do with llvm.
Comment 30 James L. Hammons 2014-02-14 18:15:05 UTC
Wanted to confirm that building llvm with -ncurses allows mesa to emerge as expected. This is with mesa-9.2.5 on ~amd64.
Comment 31 Geoff Madden 2014-02-15 02:38:23 UTC
(In reply to James L. Hammons from comment #30)
> Wanted to confirm that building llvm with -ncurses allows mesa to emerge as
> expected. This is with mesa-9.2.5 on ~amd64.
On my amd64 single core unit,this is so
Comment 32 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-15 07:53:47 UTC
Can we stop this non-sense now and just enable/force USE=llvm-shared-libs, please? :)
Comment 33 Oleh 2014-02-15 12:25:43 UTC
with llvm-shared-libs USE flag enabled it merged fine.
Comment 34 Saul Peebsen 2014-02-17 02:45:28 UTC
I'm having this very problem with 9.2.5.
Comment 35 James L. Hammons 2014-02-17 16:56:53 UTC
On a second system I have here (~amd64, mesa-9.2.5), I was able to get mesa to build with +llvm-shared-libs--but I also had to add -llvm (would not build with +llvm). Just thought I'd add that to Oleg's report, in case anyone runs into trouble.

Flags for llvm installed here (v3.4): libffi ncurses python static-analyzer xml -clang -debug -doc -gold -multitarget -ocaml -test -udis86
Comment 36 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-02-17 17:57:19 UTC
*** Bug 501608 has been marked as a duplicate of this bug. ***
Comment 37 Rafał Mużyło 2014-02-18 14:05:19 UTC
*** Bug 501682 has been marked as a duplicate of this bug. ***
Comment 38 Sergei Trofimovich (RETIRED) gentoo-dev 2014-02-22 21:14:09 UTC
Same here on ~amd64.
Comment 39 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-02-25 08:52:12 UTC
*** Bug 502374 has been marked as a duplicate of this bug. ***
Comment 40 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-02-25 13:04:11 UTC
*** Bug 502402 has been marked as a duplicate of this bug. ***
Comment 41 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-02-26 12:56:09 UTC
*** Bug 502430 has been marked as a duplicate of this bug. ***
Comment 42 N. Andrew Walsh 2014-02-26 21:18:58 UTC
running ~amd64, with nvidia-drivers-334.16-r7, llvm-3.4, and mesa-9.2.5-r1, I encounter first the problem as described in #1. Emerging llvm with USE="-ncurses" leads to the problem as described in #24. Emerging mesa with USE="llvm-shared-libs -llvm" as described in #35 resulted in mesa emerging successfully.

Cheers.
Comment 43 Jeroen Roovers (RETIRED) gentoo-dev 2014-02-26 22:56:33 UTC
*** Bug 502572 has been marked as a duplicate of this bug. ***
Comment 44 Uros 2014-02-27 06:06:25 UTC
As #42 already mentioned, emerging llvm with USE="-ncurses" leads to another problem, but can be avoided with switching opengl to xorg-x11 before emerging mesa as mentioned @ https://bugs.gentoo.org/show_bug.cgi?id=501328#c8.

media-libs/mesa-9.2.5-r1
x11-drivers/nvidia-drivers-334.16-r7
sys-devel/llvm-3.4 -ncurses
Comment 45 Ben Kohler gentoo-dev 2014-02-27 20:11:41 UTC
*** Bug 502992 has been marked as a duplicate of this bug. ***
Comment 46 Alex Xu (Hello71) 2014-03-01 02:13:58 UTC
*** Bug 503086 has been marked as a duplicate of this bug. ***
Comment 47 Thomas Capricelli 2014-03-01 12:09:40 UTC
Hello, i'm hit by this bug on ~amd64 using VIDEO_CARDS="r600 radeon" and have r600-llvm-compiler in my main USE.

The weird thing is that mesa-9.2.5 had had no problem emerging on january 15th, and now 9.2.5-r1 is failing with this error. Since then, llvm has been updated from 3.3-r1 to 3.4, so i guess this is the problem.

Adding llvm-shared-libs to my make.conf, i can emerge it again.
Comment 48 Ben Kohler gentoo-dev 2014-03-02 00:26:37 UTC
*** Bug 503154 has been marked as a duplicate of this bug. ***
Comment 49 László Szalma 2014-03-02 12:28:00 UTC
[ebuild   R    ] sys-devel/llvm-3.4:0/3.4  USE="libffi ncurses static-analyzer -clang -debug -doc -gold -multitarget -ocaml -python {-test} -udis86 -xml" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python2_7 -pypy2_0 -python2_6" VIDEO_CARDS="-radeon" 0 kB
[ebuild   R    ] media-libs/mesa-9.2.5-r1  USE="classic egl gallium gles2 llvm-shared-libs nptl vdpau -bindist -debug -gbm -gles1 -llvm -opencl -openvg -osmesa -pax_kernel -pic -r600-llvm-compiler (-selinux) -wayland -xa -xorg -xvmc" ABI_X86="(64) -32 (-x32)" VIDEO_CARDS="(-freedreno) -i915 -i965 -ilo -intel -nouveau -r100 -r200 -r300 -r600 -radeon -radeonsi -vmware" 0 kB

i confirm -llvm +llvm-shared-libs fixes the build problem. (must use both)
Comment 50 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-06 17:49:41 UTC
*** Bug 503642 has been marked as a duplicate of this bug. ***
Comment 51 Jeroen Roovers (RETIRED) gentoo-dev 2014-03-07 15:29:19 UTC
*** Bug 503736 has been marked as a duplicate of this bug. ***
Comment 52 jospezial 2014-03-09 07:47:05 UTC
This bug has hit me yesterday with media-libs/mesa-10.1.0 .
But it was fixed with that change:

"Remove non-existant openmax (available in next Mesa release) and correct llvm-shared-libs flag, bug #503888."
Comment 53 Francesco Riosa 2014-03-11 23:39:15 UTC
for another software it was fixed by this commit:

http://cgit.freedesktop.org/beignet/commit/?id=9acc4ce5d1e4d166f9fb916d3417ea52fbe16b70
Comment 54 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-04-10 17:18:57 UTC
So I went ahead and finally committed my changes to mesa-9999.

[master f22a1a8] media-libs/mesa: Require llvm-3.3-r3 (for new llvm-config path + bug #506180). Always use shared libs to avoid the issues related to static linking (e.g. bug #481316).
 1 file changed, 5 insertions(+), 10 deletions(-)

@x11, consider moving it to one of the releases? Just please make sure to take one with AC_PATH_TOOL check for llvm-config (and possibly other llvm shared-libs fixes).
Comment 55 jospezial 2014-04-29 18:33:42 UTC
I get that bug now with media-libs/mesa-10.1.1 .
Comment 56 Jeroen Roovers (RETIRED) gentoo-dev 2014-04-29 19:04:03 UTC
*** Bug 509102 has been marked as a duplicate of this bug. ***
Comment 57 Jeroen Roovers (RETIRED) gentoo-dev 2014-04-29 19:04:50 UTC
*** Bug 509042 has been marked as a duplicate of this bug. ***
Comment 58 Ben Kohler gentoo-dev 2014-04-29 19:13:03 UTC
Those other bugs have new info, apparently the fix was not implemented correctly to force llvm-shared-libs on.  I'm not sure if this is 100% accurate but I think it is worth copying here if the other bugs remain closed DUP:

(In reply to Jana Saout from comment #1)
> Errr...
> 
> I think this change:
> 
> -		$(use_with llvm-shared-libs) \
> +		--enable-llvm-shared-libs \
> 
> was supposed to say
> 
> --with-llvm-shared-libs
> 
> Mesa is actually compiled against the static libraries for me (which fails
> if they are not available).
Comment 59 Alexander Tsoy 2014-04-29 19:25:24 UTC
(In reply to Ben Kohler from comment #58)
> Those other bugs have new info, apparently the fix was not implemented
> correctly to force llvm-shared-libs on.

The fix in ebuild is implemented correctly, but there is a bug in mesa build system: https://bugs.gentoo.org/show_bug.cgi?id=509034#c8
Comment 60 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-04-30 12:36:33 UTC
*** Bug 509152 has been marked as a duplicate of this bug. ***
Comment 61 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-01 18:51:50 UTC
*** Bug 509272 has been marked as a duplicate of this bug. ***
Comment 62 jospezial 2014-05-02 00:28:37 UTC
 01 May 2014; Michał Górny <mgorny@gentoo.org> mesa-10.1.1.ebuild:
  Remove --enable-llvm-shared-libs since the switch is broken in this version
  and causes shared linking to be disabled. In fact, the default is for shared
  linking to be enabled, so removing the switch leaves it that way.


That helped me. Thank you!
Comment 63 jospezial 2014-07-30 11:38:48 UTC
I think that bug is fixed and can be closed.
Comment 64 Geoff Madden 2014-07-30 12:36:06 UTC
I agree,it compiles up just fine now.
Comment 65 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-11-04 17:22:00 UTC
Marking as fixed per the previous comments.