Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 117875 - toolchain.eclass overwrites native libstdc++ when using no-symlinks/no-lib32 profile.
Summary: toolchain.eclass overwrites native libstdc++ when using no-symlinks/no-lib32 ...
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 140851 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-05 05:00 UTC by Herbie Hopkins (RETIRED)
Modified: 2007-02-01 16:09 UTC (History)
3 users (show)

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


Attachments
Don't overwrite native libs in gcc_movelibs (toolchain-eclass-no-symlinks.diff,1.06 KB, patch)
2006-01-05 05:02 UTC, Herbie Hopkins (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Herbie Hopkins (RETIRED) gentoo-dev 2006-01-05 05:00:11 UTC
There seems to be a problem with gcc_movelibs function in toolchain.eclass with regards to amd64's no-symlinks/no-lib32 profile. In this case we have that ${OS_MULTIDIR} for default abi is equal to ${MULTIDIR} for the alternate abi resulting in the native amd64 libs being overwritten by the x86 libs in gcc_movelibs (leaving in a faily broken system). This did actually work at one point and seems to have been broken by a recent cleanup of the gcc_movelibs function in toolchain.eclass.
Comment 1 Herbie Hopkins (RETIRED) gentoo-dev 2006-01-05 05:02:18 UTC
Created attachment 76230 [details, diff]
Don't overwrite native libs in gcc_movelibs
Comment 2 SpanKY gentoo-dev 2006-01-05 18:48:14 UTC
i dont get it ... it sounds like your solution to avoid breaking the native ABI is to remove all alternative ABI libraries in which case you should be using the 'no-multilib' profile
Comment 3 Herbie Hopkins (RETIRED) gentoo-dev 2006-01-06 02:32:13 UTC
The rmdir will fail if the directory is empty, in which case the it contains libs for an alternate abi and will be moved in the next round. This is actually exactly what was done before your cleanup of gcc_movelibs, see:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/eclass/toolchain.eclass?r1=1.225&r2=1.226
Notice the mv command was commented out, I assume for this reason.

Comment 4 Herbie Hopkins (RETIRED) gentoo-dev 2006-01-06 02:36:02 UTC
I guess we could check for the existence of say libstdc++.so in said directory if you don't trust rmdir to not delete an occupied directory?
Comment 5 SpanKY gentoo-dev 2006-01-06 15:16:08 UTC
the point of using rmdir is that the dir is supposed to be empty

as the comment says, there should be nothing in it ... not even libiberty.a is in it because that lib is removed from $D before gcc_movelibs is executed
Comment 6 Herbie Hopkins (RETIRED) gentoo-dev 2006-01-06 16:33:39 UTC
(In reply to comment #5)
> the point of using rmdir is that the dir is supposed to be empty
> 
> as the comment says, there should be nothing in it ... not even libiberty.a is
> in it because that lib is removed from $D before gcc_movelibs is executed

In the second round once the native libs and the x86 libs have both been moved to their correct location it is empty and so gets removed. I guess I'm really not explaining the situation very well so lets spell it out:

During the first round we have
  multiarg=""
  OS_MULTIDIR="../lib64"
  MULTIDIR="."
now,
  ${D}${PREFIX}/lib/${OS_MULTIDIR} = ${D}${PREFIX}/lib/../lib64
containing native libs and
  ${D}${PREFIX}/lib/${MULTIDIR} = ${D}${PREFIX}/lib/.
containing x86 libs (and libiberty.a before it was removed)
The contents of both currently get moved to the same ${TODIR} and so one overwrites the other (the point of the patch and the commented out mv line in the origional gcc_movelibs being to avoid this).

In the second round we have
 multiarg="-m32"
 OS_MULTIDIR="../lib"
 MULTIDIR="32"
so,
 ${D}${PREFIX}/lib/${OS_MULTIDIR} = ${D}${PREFIX}/lib/../lib
which should contain the x86 libs but uh-oh we moved them during the first round...
 ${D}${PREFIX}/lib/${MULTIDIR} = ${D}${PREFIX}/lib/${MULTIDIR}
which is empty since all that was here was libiberty.a and so the directory is simply removed.
Comment 7 Jeremy Huddleston (RETIRED) gentoo-dev 2006-03-16 11:44:10 UTC
Shouldn't the solution be to just not move stuff from ${PREFIX}/lib/${MULTIDIR} if MULTDIR is '.'?  Then it'd get picked up correctly when doing i386 when:
${D}${PREFIX}/lib/${OS_MULTIDIR} = ${D}${PREFIX}/lib/../lib

Stuff is installed in there when MULTDIR is not . (hence why it ended up in the list to begin with).  I'll need to check this out again and with different versions of gcc to see where things are thrown.
Comment 8 Herbie Hopkins (RETIRED) gentoo-dev 2006-03-17 02:43:16 UTC
Afaics the only thing that gets installed in ${PREFIX}/lib/${MULTIDIR} is libiberty.a which is deleted earlier in the install (unless we get some overlap with an alt ABI as we do here). What else are you suggesting is installed there? In the i386 case we have
${D}${PREFIX}/lib/${OS_MULTIDIR} = ${D}${PREFIX}/lib/../lib
and
${D}${PREFIX}/lib/${MULTIDIR} = ${D}${PREFIX}/lib/.
so we're currently just passing the same directory twice right?
Comment 9 SpanKY gentoo-dev 2006-04-20 20:30:52 UTC
latest toolchain.eclass should handle this properly ...
Comment 10 Herbie Hopkins (RETIRED) gentoo-dev 2006-04-25 09:09:31 UTC
Nope, latest toolchain.eclass has the exact same problem.
Comment 11 SpanKY gentoo-dev 2006-04-25 22:23:09 UTC
well setup a chroot on one of the amd64 dev machines for me to test or post a new patch ... the one you posted is outdated
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2006-07-18 00:42:18 UTC
*** Bug 140851 has been marked as a duplicate of this bug. ***
Comment 13 Simon Stelling (RETIRED) gentoo-dev 2007-02-01 16:09:57 UTC
atm the no-symlinks/no-lib32 profile is rather useless as too many packages that need fixing, and this is no priority at all in the current state of the arch, so i'm marking this LATER