Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 289947 - Allow an ~amd64 system with 32-bit libraries in /lib and /usr/lib to build properly
Summary: Allow an ~amd64 system with 32-bit libraries in /lib and /usr/lib to build pr...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://www.pathname.com/fhs/pub/fhs-2...
Whiteboard:
Keywords:
Depends on:
Blocks: 358149
  Show dependency tree
 
Reported: 2009-10-21 03:41 UTC by Jonathan Callen (RETIRED)
Modified: 2011-08-22 23:03 UTC (History)
1 user (show)

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


Attachments
Patch for toolchain.eclass (toolchain.eclass.patch,395 bytes, patch)
2009-10-21 03:42 UTC, Jonathan Callen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Callen (RETIRED) gentoo-dev 2009-10-21 03:41:11 UTC
I have been trying to get my amd64 system to use the FHS-compliant[1] locations for libraries (32-bit in {,/usr,/usr/local}/lib, 64-bit in {,/usr,/usr/local}/lib64).  After removing my {,/usr}/lib symlinks, I created real directories in those locations, then moved everything that is in {,/usr}/lib64 that portage thought was installed into {,/usr}/lib into {,/usr}/lib.  I then added the following lines to /etc/make.conf:

SYMLINK_LIB="no"
LIBDIR_x86="lib"

After that, I rebuilt all the packages that installed into {,/usr}/lib32.  Everything built properly, with the exception of GCC.  GCC itself built fine, but then, in gcc_movelibs() (in toolchain.eclass), I noticed an issue that causes the system to become non-functional.  Namely, the eclass attempts to move all the libraries in ${PREFIX}/lib/${MULTIDIR} to ${LIBPATH}/${MULTIDIR}.  For the amd64 ABI, this expands to "/usr/lib/." -> "/usr/lib/gcc/${CHOST}/${PV}/.", which ends up moving the 32-bit libs into the 64-bit directory, *after* having moved the 64-bit libs there.  Obviously, there is something wrong with this.  As I noticed that GCC never installs anything to /usr/lib/32 (which is what ${PREFIX}/lib/${MULTIDIR} is for the x86 ABI), I simply applied the attached patch, which removes that one directory from the list of paths to move things out of.

The only other package that has ever been an issue with this is old versions of baselayout and openrc, but there are no issues in the latest ~amd64 versions of each.  While there is a patch applied to binutils that hardcodes /lib32, et al. into the linker search path, that patch only ends up *prepending* that to the regular search path, so no modifications were actually needed to binutils.

[1] http://www.pathname.com/fhs/pub/fhs-2.3.html#LIB64
Comment 1 Jonathan Callen (RETIRED) gentoo-dev 2009-10-21 03:42:42 UTC
Created attachment 207780 [details, diff]
Patch for toolchain.eclass
Comment 2 Matt Turner gentoo-dev 2011-08-22 23:03:58 UTC
Committed after testing in bug 35814. Thanks a ton for the patch! :)