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

Bug 596218

Summary: games-engines/love-0.7.2-r1 and 0.8.0: "Can't LÖVE without DevIL" error due to missing '-pthread' in configure test
Product: Gentoo Linux Reporter: segmentation fault <segmentation-fault>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: games
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: The configure test that is failing

Description segmentation fault 2016-10-05 09:40:06 UTC
Created attachment 449218 [details]
The configure test that is failing

Trying to install games-engines/love-0.7.2-r1, I got:

checking for library containing lua_pcall... -llua
checking for library containing ilInit... no
configure: error: Can't LÖVE without DevIL

The configure log at 

/host/var/tmp/portage/games-engines/love-0.7.2-r1/work/love-HEAD/config.log

showed the reason:

Reason
======

configure:15361: i686-pc-linux-gnu-gcc -o conftest -O2 -march=pentium4 -pipe  -Wl,-O1 -Wl,--as-needed conftest.c -lIL  -llua -lopenal -lGL -lSDL -lm  >&5
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `pthread_create'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_wait'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_init'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_destroy'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_getvalue'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_post'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_trywait'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status

Attempt to resolve
=============

Re-merging media-libs/ilmbase-2.1.0 (which is the owner of /usr/lib/libIlmThread-2_1.so.11) did NOT resolve the issue.

Trying the configure test as a separate program, say, love.c (see attachment), showed why:

i686-pc-linux-gnu-gcc -o love -O2 -march=pentium4 -pipe  -Wl,-O1 -Wl,--as-needed love.c -lIL  -llua -lopenal -lGL -lSDL -lm

/usr/lib/libIlmThread-2_1.so.11: undefined reference to `pthread_create'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_wait'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_init'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_destroy'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_getvalue'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_post'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `sem_trywait'
/usr/lib/libIlmThread-2_1.so.11: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status

Adding -pthread to the invocation resolves the problem:

i686-pc-linux-gnu-gcc -pthread -o love -O2 -march=pentium4 -pipe  -Wl,-O1 -Wl,--as-needed love.c -lIL  -llua -lopenal -lGL -lSDL -lm

(no errors, love executable created).


Solution
=======

The configure script should use '-pthread' as above for its devil test, before it spits "Can't LÖVE without DevIL".
Comment 1 tonemgub 2017-08-26 14:42:52 UTC
Confirming. This bug also affects love-0.8.0, not sure how to proceed.
Comment 2 Pacho Ramos gentoo-dev 2018-06-20 14:46:08 UTC
I cannot reproduce with 0.7.2-r2 or 0.8.0-r1

Please retry
Comment 3 Samuel Bauer 2021-02-14 23:14:15 UTC
Suddenly hitten by this one also, due to recent lua.*eclasses

The really weird thing is that only one of my box is affected, the two other gentoo boxes, upgraded without any troubles.

The three boxes have slightly different use flag, but mainly share the same base.
Comment 4 Samuel Bauer 2021-03-03 03:05:46 UTC
nvtt flag is culprit on my box

so may be love:0.7 and love:0.8 should depend on media-libs/devil[-nvtt]
I'll may dig further, to expose a real fix, rather than a workaround