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

Bug 508906

Summary: app-emulation/emul-linux-x86-*: SYMLINK_LIB=no LIBDIR_x86=lib results in broken pkgconfig files
Product: Gentoo Linux Reporter: Alexander Tsoy <alexander>
Component: EclassesAssignee: Multilib team <multilib+disabled>
Severity: normal CC: floppym
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 506276    
Attachments: wine-x86-config.log

Description Alexander Tsoy 2014-04-27 20:15:48 UTC
Created attachment 375896 [details]

emul-linux-x86.eclass is already doing some dangerous things like renaming lib32 dirs and fixing ldscripts. May be it could also fix pkgconfig files? :)

Currently wine fails to configure for x86 on my system.
Comment 1 Mike Gilbert gentoo-dev 2014-04-27 20:35:06 UTC
I have this hack in /etc/portage/bashrc. ^_^

post_src_install() {
    if [[ ${CATEGORY}/${PN} == app-emulation/emul-linux-x86-* ]]; then
        grep -RlZ --include="*.la" --include="*.pc" lib32 "${D}" | xargs -0 sed -i -e "s:lib32:lib:g"
Comment 2 Alexander Tsoy 2014-04-27 20:42:22 UTC
Created attachment 375898 [details, diff]
Comment 3 Alexander Tsoy 2014-04-28 14:28:49 UTC
Seems this does not worth the effort. There are a lot of other things that should be fixed to make emul-linux-x86-* packages usable. :( Some examples:

- RPATHs and RUNPATHS points to */lib32/*. This leads to runtime failures. For example I was able to run skype only after fixing RPATH in

$ LANG=C readelf -d /usr/lib/ | grep PATH
 0x0000000f (RPATH)                      Library rpath: [/usr/lib32/pulseaudio]
 0x0000001d (RUNPATH)                    Library runpath: [/usr/lib32/pulseaudio]

- eclass actually does not fix ldscripts. :) While the following condition is true when executed from interactive shell, it is false when executed from ebuild:

if ldscripts=( $(grep -ls '^GROUP.*/lib32/' *.so) ) ; then

As a result, sed command does not get executed. The following patch fixes the issue:

@@ -67,7 +67,8 @@
 		# Fix linker script paths.
 		local ldscripts
-		if ldscripts=( $(grep -ls '^GROUP.*/lib32/' *.so) ) ; then
+		ldscripts=( $(grep -ls '^GROUP.*/lib32/' *.so) )
+		if (( "${#ldscripts[@]}" )) ; then
 			sed -i \
 				-e "s:/lib32/:/${x86_libdir}/:" \
 				"${ldscripts[@]}" || die
Comment 4 SpanKY gentoo-dev 2014-05-06 20:03:59 UTC
Comment on attachment 375898 [details, diff]

one line fix:

 find pkgconfig/ -type f -exec \
   sed -i -r -e s:/lib32($|[[:space:]]|/):/${x86_libdir}\1:g" {} +
Comment 5 SpanKY gentoo-dev 2014-05-06 20:04:57 UTC
(In reply to Alexander Tsoy from comment #3)

yes, the SYMLINK_LIB migration logic was a "best effort".  adding .pc and ldscript munging seems pretty easy, so let's do that.  i wouldn't worry about the rpath stuff as emul-* packages are getting killed in favor of ABI_X86.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-06-02 08:33:45 UTC
The emul-linux-x86 packages have been removed.