Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 728722 - toolchain.eclass installs /usr/bin/c{89,99} in pkg_postinst, uses 'gcc' directly
Summary: toolchain.eclass installs /usr/bin/c{89,99} in pkg_postinst, uses 'gcc' directly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 737662 (view as bug list)
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2020-06-19 05:46 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2020-09-03 18:52 UTC (History)
3 users (show)

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 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-06-19 05:46:43 UTC
> toolchain_pkg_postinst() {
> ...
> # Since these aren't critical files and portage sucks with
> # handling of binpkgs, don't require these to be found
> cp "${ROOT%/}${DATAPATH}"/c{89,99} "${EROOT%/}"/usr/bin/ 2>/dev/null


If these are actually of value, then:
1. They should probably be handled by gcc-config, not a dumb copy during pkg_postinst
2. If they are installed to /usr/bin at all, then at very least, their internal invocations should also be things that work

As is, this being there can trip up vlc, which detects this, and tries to use it, which fails, because it breaks down to being a wrapper to call "exec gcc" with extra arguments.

And gcc not being a thing in any PATH due to gcc-config[-native-symlinks] means this becomes an indirect failure when that is attempted to be used.
Comment 1 Sergei Trofimovich gentoo-dev 2020-06-19 06:53:41 UTC
Yeah, these are very old scripts without ${CHOST}- counterparts. If ebuilds use it the ebuilds are probably buggy.

It should be safe to remove them from gcc eclass and give a chance to provide the file from somewhere else. As it's an unowned file removing it is tricky.
Comment 2 Arfrever Frehtes Taifersar Arahesis 2020-06-19 07:13:39 UTC
Maybe simply replace `cp` in toolchain_pkg_postinst() with:
rm "${EROOT%/}"/usr/bin/c{89,99} 2>/dev/null


If you want to not delete customly modified c{89,99}, then:
if [[ -f "${EROOT%/}/usr/bin/c89" && $(md5sum "${EROOT%/}/usr/bin/c89") == "c1a72946570d6c8cb0577f2ad4b871ab "* ]]; then
  rm "${EROOT%/}/usr/bin/c89"
fi
if [[ -f "${EROOT%/}/usr/bin/c99" && $(md5sum "${EROOT%/}/usr/bin/c99") == "1676942af711f01087b5d0666b0e1874 "* ]]; then echo
  rm "${EROOT%/}/usr/bin/c99"
fi

(After some years, drop above code completely.)
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-06-19 21:44:04 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #2)
> Maybe simply replace `cp` in toolchain_pkg_postinst() with:
> rm "${EROOT%/}"/usr/bin/c{89,99} 2>/dev/null
> 
> 
> If you want to not delete customly modified c{89,99}, then:
> if [[ -f "${EROOT%/}/usr/bin/c89" && $(md5sum "${EROOT%/}/usr/bin/c89") ==
> "c1a72946570d6c8cb0577f2ad4b871ab "* ]]; then
>   rm "${EROOT%/}/usr/bin/c89"
> fi
> if [[ -f "${EROOT%/}/usr/bin/c99" && $(md5sum "${EROOT%/}/usr/bin/c99") ==
> "1676942af711f01087b5d0666b0e1874 "* ]]; then echo
>   rm "${EROOT%/}/usr/bin/c99"
> fi
> 
> (After some years, drop above code completely.)

Or ... 

1. Stop installing it, but don't handle its removal in GCC
2. Adapt gcc-config so it
   a. manages that file properly with --enable-native-links
   b. prunes that file with --disable-native-links
Comment 4 Sergei Trofimovich gentoo-dev 2020-06-20 19:34:20 UTC
Moving it to gcc-config sounds reasonable. There will be a race window though when both gcc-config and gcc packages will fight for the contents.

It should not be a big deal.
Comment 5 Larry the Git Cow gentoo-dev 2020-06-20 21:12:18 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=06f9083246c2d705520ab82e8bd822fd2428e12f

commit 06f9083246c2d705520ab82e8bd822fd2428e12f
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-06-20 21:07:59 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-06-20 21:07:59 +0000

    gcc-config: install /usr/bin/c{89,99}, take over from toolchain.eclass
    
    Reported-by: Kent Fredric
    Bug: https://bugs.gentoo.org/728722
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 .gitignore                                         |  2 ++
 Makefile                                           | 34 ++++++++++++++++++++--
 c89                                                | 22 ++++++++++++++
 c99                                                | 23 +++++++++++++++
 gcc-config                                         | 14 ++++++++-
 .../multi-native-configs/usr/share/gcc-config/c89  |  0
 .../multi-native-configs/usr/share/gcc-config/c99  |  0
 .../usr/share/gcc-config/c89                       |  0
 .../usr/share/gcc-config/c99                       |  0
 9 files changed, 91 insertions(+), 4 deletions(-)
Comment 6 Larry the Git Cow gentoo-dev 2020-06-20 21:20:14 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3530072da1b5cc5b1ac8cf5f0bf86cddce3949b7

commit 3530072da1b5cc5b1ac8cf5f0bf86cddce3949b7
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-06-20 21:19:45 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-06-20 21:20:09 +0000

    sys-devel/gcc-config: add new TOOLCHAIN_PREFIX= to live ebuild
    
    Bug: https://bugs.gentoo.org/728722
    Package-Manager: Portage-2.3.101, Repoman-2.3.22
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-devel/gcc-config/gcc-config-9999.ebuild | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
Comment 7 Sergei Trofimovich gentoo-dev 2020-06-20 21:21:47 UTC
Give gcc-config-9999 a try. If it looks reasonable I'll cut a new gcc-config release.

Once new gcc-config is stable we can remove c89/c99 handling from toolchain.eclass.
Comment 8 Larry the Git Cow gentoo-dev 2020-06-21 12:00:00 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75874f9e8cd115255238361a6dcef3f85787aed8

commit 75874f9e8cd115255238361a6dcef3f85787aed8
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-06-21 11:59:31 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-06-21 11:59:55 +0000

    sys-devel/gcc-config: bump up to 2.3.1
    
    Single change:
    gcc-config: install /usr/bin/c{89,99}, take over from toolchain.eclass
    
    Reported-by: Kent Fredric
    Bug: https://bugs.gentoo.org/728722
    Package-Manager: Portage-2.3.101, Repoman-2.3.22
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-devel/gcc-config/Manifest                |  1 +
 sys-devel/gcc-config/gcc-config-2.3.1.ebuild | 61 ++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)
Comment 9 Luke-Jr 2020-07-30 15:25:35 UTC
How is this supposed to work? The new gcc-config has collisions with the existing file...
Comment 10 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-07-30 22:41:15 UTC
(In reply to Luke-Jr from comment #9)
> How is this supposed to work? The new gcc-config has collisions with the
> existing file...

Under default configuration, that collision should be ignored (as in, you'll get a warning, but portage should decide to proceed), as the existing files are "unowned" due to being injected during pkg_postinst.
Comment 11 Luke-Jr 2020-07-30 23:17:41 UTC
(In reply to Kent Fredric (IRC: kent\n) from comment #10)
> (In reply to Luke-Jr from comment #9)
> > How is this supposed to work? The new gcc-config has collisions with the
> > existing file...
> 
> Under default configuration, that collision should be ignored (as in, you'll
> get a warning, but portage should decide to proceed), as the existing files
> are "unowned" due to being injected during pkg_postinst.

Is FEATURES=collision-protect no longer supported, then?

And even if it does get installed, won't the next emerge of gcc overwrite the Portage-installed version?
Comment 12 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-07-31 01:10:57 UTC
(In reply to Luke-Jr from comment #11)
> (In reply to Kent Fredric (IRC: kent\n) from comment #10)
> > (In reply to Luke-Jr from comment #9)
> > > How is this supposed to work? The new gcc-config has collisions with the
> > > existing file...
> > 
> > Under default configuration, that collision should be ignored (as in, you'll
> > get a warning, but portage should decide to proceed), as the existing files
> > are "unowned" due to being injected during pkg_postinst.
> 
> Is FEATURES=collision-protect no longer supported, then?
> 
> And even if it does get installed, won't the next emerge of gcc overwrite
> the Portage-installed version?

I believe FEATURES="protect-owned" is preferred, for situations exactly like this.

> protect-owned
>  This is identical to the collision-protect feature except that files may be overwritten if they are not explicitly listed in the contents of a currently installed package. This is particularly useful on systems that have lots of orphan files that have been left
>  behind by older versions of portage that did not support the unmerge-orphans feature. Like collision-protect, the COLLISION_IGNORE variable can be used to selectively disable this feature. It is recommended to leave either protect-owned or collision-protect en‐
>  abled at all times, since otherwise file collisions between packages may result in files being overwritten or uninstalled at inappropriate times.  If collision-protect is enabled then it takes precedence over protect-owned.

but this is a messy problem that is there for anything doing filesystem modification during post_inst

Especially as one can't simply arbitrarily ensure gcc reaps those files, because ... they're not owned by it, and it could reap files that are owned by gcc-config after a migration completes.

I suspect gcc-config just needs to employ COLLISION_IGNORE to ensure it doesn't run afoul of this.
Comment 13 Luke-Jr 2020-07-31 01:59:15 UTC
Shouldn't this work? And add a post-depend on the new gcc-config?

(By Arfrever Frehtes Taifersar Arahesis in comment #2)
> If you want to not delete customly modified c{89,99}, then:
> if [[ -f "${EROOT%/}/usr/bin/c89" && $(md5sum "${EROOT%/}/usr/bin/c89") ==
> "c1a72946570d6c8cb0577f2ad4b871ab "* ]]; then
>   rm "${EROOT%/}/usr/bin/c89"
> fi
> if [[ -f "${EROOT%/}/usr/bin/c99" && $(md5sum "${EROOT%/}/usr/bin/c99") ==
> "1676942af711f01087b5d0666b0e1874 "* ]]; then echo
>   rm "${EROOT%/}/usr/bin/c99"
> fi
Comment 14 Larry the Git Cow gentoo-dev 2020-08-19 08:28:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eaa3057f4602c72ef847775109663cd03578d0f9

commit eaa3057f4602c72ef847775109663cd03578d0f9
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-08-19 08:26:15 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-08-19 08:26:15 +0000

    toolchain.eclass: stop installing /usr/bin/c89 and /usr/bin/c99
    
    Ownership of /usr/bin/c89 and /usr/bin/c99 was switched to
    sys-devel/gcc-config-2.3.1.
    
    Closes: https://bugs.gentoo.org/728722
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 dev-lang/gnat-gpl/files/c89 | 20 --------------------
 dev-lang/gnat-gpl/files/c99 | 21 ---------------------
 eclass/toolchain.eclass     | 15 ---------------
 sys-devel/gcc/files/c89     | 20 --------------------
 sys-devel/gcc/files/c99     | 21 ---------------------
 5 files changed, 97 deletions(-)
Comment 15 Sergei Trofimovich gentoo-dev 2020-08-19 08:30:41 UTC
*** Bug 737662 has been marked as a duplicate of this bug. ***
Comment 16 Marcin Mirosław 2020-08-29 16:07:12 UTC
Bug is "fixed" but I still have file collision.
Comment 17 Sergei Trofimovich gentoo-dev 2020-08-30 20:00:18 UTC
(In reply to Marcin Mirosław from comment #16)
> Bug is "fixed" but I still have file collision.

Please provide emerge --info and log of failed upgrade.
Comment 18 Luke-Jr 2020-08-30 21:01:32 UTC
(In reply to Sergei Trofimovich from comment #17)
> (In reply to Marcin Mirosław from comment #16)
> > Bug is "fixed" but I still have file collision.
> 
> Please provide emerge --info and log of failed upgrade.

Why waste his time with this? It isn't fixed. There is no reason to expect anything other than collisions.

I went to the effort to make a fix in https://github.com/gentoo/gentoo/pull/17318 but you chose not to fix it.
Comment 19 Marcin Mirosław 2020-09-03 08:26:21 UTC
(In reply to Sergei Trofimovich from comment #17)
> (In reply to Marcin Mirosław from comment #16)
> > Bug is "fixed" but I still have file collision.
> 
> Please provide emerge --info and log of failed upgrade.

Here you are:
Portage 3.0.4 (python 3.7.8-final-0, default/linux/amd64/17.0/no-multilib/hardened, gcc-9.3.0, glibc-2.31-r6, 5.8.0-00295-g7e04f345cc3a x86_64)
=================================================================
System uname: Linux-5.8.0-00295-g7e04f345cc3a-x86_64-Intel-R-_Xeon-R-_CPU_E3-1230_v5_@_3.40GHz-with-gentoo-2.7
KiB Mem:     8416784 total,    871264 free
KiB Swap:    1060856 total,   1059576 free
Timestamp of repository gentoo: Thu, 03 Sep 2020 06:05:34 +0000
Head commit of repository gentoo: 0a6b88ae27b92fab4846f5894bd238ea4df0ea52

sh bash 5.0_p18
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
ccache version 3.7.11 [disabled]
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r1::gentoo, 3.7.8-r2::gentoo, 3.8.5::gentoo
dev-util/ccache:          3.7.11::gentoo
dev-util/cmake:           3.16.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0-r1::gentoo
sys-devel/gcc-config:     2.3::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.31-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    sync-user: portage:portage
    priority: -1000

Installed sets: @masscheck, @nagios-plugins
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=westmere -mtune=native    -fno-unwind-tables -fuse-linker-plugin  -ftracer    -fuse-ld=gold -fvar-tracking-assignments"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=westmere -mtune=native    -fno-unwind-tables -fuse-linker-plugin  -ftracer    -fuse-ld=gold -fvar-tracking-assignments"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O3 -pipe -march=westmere -mtune=native    -fno-unwind-tables -fuse-linker-plugin  -ftracer    -fuse-ld=gold -fvar-tracking-assignments"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup collision-protect compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O3 -pipe -march=westmere -mtune=native    -fno-unwind-tables -fuse-linker-plugin  -ftracer    -fuse-ld=gold -fvar-tracking-assignments"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="pl_PL.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
LINGUAS="en"
MAKEOPTS="-j4 -l5"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl aio amd64 apache2 bash-completion bzip2 caps crypt hardened iconv idn ipv6 jit libglvnd libtirpc lto modules nano-syntax ncurses nls nptl openmp pcre pie readline seccomp smp split-usr ssl ssp threads unicode vhosts vim-syntax xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2018" APACHE2_MODULES="alias authn_core access_compat auth_basic authz_core authn_alias authn_anon auth_digest authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cgi dav dav_fs dav_lock dir env expires ext_filter filter headers hugepages include info log_config logio mime mime_magic negotiation remoteip rewrite setenvif status unique_id unixd socache_shmcb usertrack vhost_alias" APACHE2_MPMS="itk" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="apache aggregation bind cgroups conntrack contextswitch cpu curl curl_json df disk dns email entropy ethstat exec filecount hugepages interface iptables irq lvm match_regex mysql netlink load memory network nginx notify_email ntpd openvpn ping postgresql processes protocols redis rrdcached rrdtool snmp statsd swap syslog tail tail_csv tcpconns unixsock uptime vmem" CPU_FLAGS_X86="aes mmx mmxext sse sse2 sse3 ssse3" ELIBC="glibc" GRUB_PLATFORMS="pc" KERNEL="linux" L10N="en" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NGINX_MODULES_HTTP="access autoindex browser charset fastcgi gzip map limit_zone proxy rewrite http2 stub_status gzip_static" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" XTABLES_ADDONS="fuzzy geoip lscan psd sysrq tarpit"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS




>>> Source compiled.
>>> Test phase [not enabled]: sys-devel/gcc-config-2.3.1

>>> Install sys-devel/gcc-config-2.3.1 into /var/tmp/portage/sys-devel/gcc-config-2.3.1/image
make -j4 -l5 PV=2.3.1 SUBLIBDIR=lib64 USE_NATIVE_LINKS=yes TOOLCHAIN_PREFIX=x86_64-pc-linux-gnu- DESTDIR=/var/tmp/portage/sys-devel/gcc-config-2.3.1/image install
mkdir -p -m 755 /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/bin /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/share/eselect/modules /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/share/gcc-config /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/share/doc/gcc-config-2.3.1
install -m 755 .gcc-config /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/bin/gcc-config
install -m 755 .c89 /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/share/gcc-config/c89
install -m 755 .c99 /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/share/gcc-config/c99
if [ "yes" = yes ] ; then \
        install -m 755 .c89 /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/bin/c89 && \
        install -m 755 .c99 /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/bin/c99 ;  \
fi
install -m 644 gcc.eselect /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/share/eselect/modules
install -m 644 README /var/tmp/portage/sys-devel/gcc-config-2.3.1/image/usr/share/doc/gcc-config-2.3.1
>>> Completed installing sys-devel/gcc-config-2.3.1 into /var/tmp/portage/sys-devel/gcc-config-2.3.1/image

 * Final size of build directory: 728 KiB
 * Final size of installed tree:   92 KiB

 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at https://bugs.gentoo.org/ unless you report exactly
 * which two packages install the same file(s). See
 * https://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how
 * to solve the problem. And once again, please do NOT file a bug report
 * unless you have completely understood the above message.
 *
 * package sys-devel/gcc-config-2.3.1 NOT merged
 *
 * Detected file collision(s):
 *
 *      /usr/bin/c99
 *      /usr/bin/c89
 *
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *
 * None of the installed packages claim the file(s).
 *
 * Package 'sys-devel/gcc-config-2.3.1' NOT merged due to file
 * collisions. If necessary, refer to your elog messages for the whole
 * content of the above message.
Comment 20 Sergei Trofimovich gentoo-dev 2020-09-03 18:45:58 UTC
(In reply to Marcin Mirosław from comment #19)
> (In reply to Sergei Trofimovich from comment #17)
> > (In reply to Marcin Mirosław from comment #16)
> > > Bug is "fixed" but I still have file collision.

Aha, that is caused by:

> FEATURES="... collision-protect ..."

You will either need to remove files manually or disable FEATURES="collision-protect" for a time of gcc-config update.
Comment 21 Sergei Trofimovich gentoo-dev 2020-09-03 18:52:35 UTC
(In reply to Luke-Jr from comment #18)
> (In reply to Sergei Trofimovich from comment #17)
> > (In reply to Marcin Mirosław from comment #16)
> > > Bug is "fixed" but I still have file collision.
> > 
> > Please provide emerge --info and log of failed upgrade.
> 
> Why waste his time with this? It isn't fixed. There is no reason to expect
> anything other than collisions.

The problematic configuration needs to be stated explicitly.

> I went to the effort to make a fix in
> https://github.com/gentoo/gentoo/pull/17318 but you chose not to fix it.

There is no good fix for FEATURES="collision-protect" case. Manual intervention while annoying is least dangerous.