Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 673386 - dev-lang/go: gcc-386-freebsd-exec forces 32-bit glibc libs to be perpetually preserved
Summary: dev-lang/go: gcc-386-freebsd-exec forces 32-bit glibc libs to be perpetually ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-18 11:28 UTC by kfm
Modified: 2020-04-12 23:10 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kfm 2018-12-18 11:28:07 UTC
This issue was discovered in the course of switching an installation from a multilib profile to a non-multilib profile, where dev-lang/go was already installed.

Specifically, I switched from "default/linux/amd64/17.1/hardened" to "default/linux/amd64/17.1/no-multilib/hardened". I then ran emerge -auUD @world, which covers glibc as a result of the multilib flag being masked. After finishing with glibc, portage reported the following preserved-libs.

>>> package: sys-libs/glibc-2.27-r6
 *  - /lib/ld-2.27.so
 *  - /lib/ld-linux.so.2
 *  - /lib/libc-2.27.so
 *  - /lib/libc.so.6
 *      used by /usr/lib/go/src/debug/elf/testdata/gcc-386-freebsd-exec (dev-lang/go-1.10.3)

Naturally, the proposition to emerge @preserved-rebuild does not result in these libraries being cleaned up and removed.

I'm uncertain as to how gcc-386-freebsd-exec fits into the golang toolchain as a whole. If it is genuinely required then I think that the ebuild needs to express that requirement by coercing the use of a multilib-enabled glibc. Impeding the use of a no-multilib profile would be a costly outcome, however.

Better still would be to avoid the installation of gcc-386-freebsd-exec for no-multilib systems, if to do so would not unduly compromise the functionality of the toolchain.
Comment 1 Kirill Kirilenko 2020-02-19 14:04:46 UTC
It is quite possible that all files in /usr/lib/go/src/debug are unnecessary for production usage, but to be safe I use this workaround:

# cat /etc/portage/env/dev-lang/go 
post_pkg_postinst () {
        rm -f /usr/lib/go/src/debug/elf/testdata/gcc-386-freebsd-exec
        sed -i '/gcc-386-freebsd-exec/d' /var/db/pkg/dev-lang/go-1.12.15/CONTENTS
}
Comment 2 Jake Strieter 2020-03-12 23:27:09 UTC
I'm also experiencing this with go-1.13.8 after switching to the default/linux/amd64/17.1/no-multilib/hardened profile.
Comment 3 William Hubbs gentoo-dev 2020-04-12 23:10:19 UTC
This is fixed in go-1.14.2. by removing the testdata directories from
the installation.