When I have everything on one partition (as I usually do for workstation installations), I prefer to have only one lib and one bin directory. Gentoo already has /usr/X11R6 as symlink to ../usr but I take it one step further and symlink bin -> usr/bin and lib -> usr/lib. I've been doing this for years and it's saved me a lot of which'ing around, it gives me the good feeling of always knowing where my stuff is, I never have the problem that some package/script expects a file in the wrong bin directory,.... Now that I've switched from LFS to Gentoo I naturally want to keep this layout, but it proves to be more painful than I expected. When installing libraries, Gentoo creates dummy libraries (gen_usr_ldscript) and some packages (e.g. wpa_supplicant) have symlinks to make their binaries appear in both bin directories. Not only are those crutches not necessary when bin and lib are symlinked with /usr/bin and /usr/lib, they're even harmful, because when merging, the dummy libraries and symlinks will happily overwrite the real libraries and binaries. My feature request ist to make the merge step smart enough to recognize the case that 2 files from the same package will install to the same target location, and in that case if one of the conflicting files is a symlink, the non-symlink should take preference. Likewise for libraries, if one of the conflicting libraries is just a linker script, the real library should take preference. Another way to deal with the library case would be to provide a switch to disable gen_usr_ldscript or even better to make gen_usr_ldscript smart enough to automatically realize that $ROOT/usr/lib and $ROOT/lib are the same directory and to do nothing in that case (the smartness would have to be put into the QA check, too, to avoid spurious QA notices). The way I currently solve the problem is with a custom prepall script that scans for conflicts and resolves them. Reproducible: Always Steps to Reproduce:
while true, when you only have 1 bin/lib directory, things will collide, this is an issue to be taken up on the gentoo-dev mailing list to see if we care in general (i know i dont) this certainly is not a portage bug making gen_usr_ldscript change its behavior based on $ROOT is wrong. that breaks accepted methodology (packages in src_* should never peek in $ROOT).
It should be possible to write a /etc/portage/bashrc with a post_src_install function that does the required magic: compare dirs, resolve conflicts as described. Possibly die if any conflicts cannot be resolved this way. This should provide a working solution for those few people using such setups, without burdening common gentoo setups with code or performance penalties for this.
use a mount bind and be done with it: mount --bind /bin /usr/bin mount --bind /sbin /usr/sbin